2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..utils import int_or_none
8 class DWIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?dw\.com/(?:[^/]+/)+av-(?P<id>\d+)'
11 'url': 'http://www.dw.com/en/intelligent-light/av-19112290',
12 'md5': '7372046e1815c5a534b43f3c3c36e6e9',
16 'title': 'Intelligent light',
17 'description': 'md5:90e00d5881719f2a6a5827cb74985af1',
18 'upload_date': '20160311',
22 def _real_extract(self, url):
23 video_id = self._match_id(url)
25 formats = self._extract_smil_formats(
26 'http://www.dw.com/smil/v-%s' % video_id, video_id,
27 transform_source=lambda s: s.replace(
28 'rtmp://tv-od.dw.de/flash/',
29 'http://tv-download.dw.de/dwtv_video/flv/'))
31 webpage = self._download_webpage(url, video_id)
32 hidden_inputs = self._hidden_inputs(webpage)
33 title = hidden_inputs['media_title']
38 'description': self._og_search_description(webpage),
39 'thumbnail': hidden_inputs.get('preview_image'),
40 'duration': int_or_none(hidden_inputs.get('file_duration')),
41 'upload_date': hidden_inputs.get('display_date'),