1 from __future__ import unicode_literals
5 from .common import InfoExtractor
13 class WDRIE(InfoExtractor):
14 _PLAYER_REGEX = '-(?:video|audio)player(?:_size-[LMS])?'
15 _VALID_URL = r'(?P<url>https?://www\d?\.(?:wdr\d?|funkhauseuropa)\.de/)(?P<id>.+?)(?P<player>%s)?\.html' % _PLAYER_REGEX
19 'url': 'http://www1.wdr.de/mediathek/video/sendungen/servicezeit/videoservicezeit560-videoplayer_size-L.html',
23 'title': 'Servicezeit',
24 'description': 'md5:c8f43e5e815eeb54d0b96df2fba906cb',
25 'upload_date': '20140310',
28 'skip_download': True,
32 'url': 'http://www1.wdr.de/themen/av/videomargaspiegelisttot101-videoplayer.html',
36 'title': 'Marga Spiegel ist tot',
37 'description': 'md5:2309992a6716c347891c045be50992e4',
38 'upload_date': '20140311',
41 'skip_download': True,
45 'url': 'http://www1.wdr.de/themen/kultur/audioerlebtegeschichtenmargaspiegel100-audioplayer.html',
46 'md5': '83e9e8fefad36f357278759870805898',
50 'title': 'Erlebte Geschichten: Marga Spiegel (29.11.2009)',
51 'description': 'md5:2309992a6716c347891c045be50992e4',
52 'upload_date': '20091129',
56 'url': 'http://www.funkhauseuropa.de/av/audiogrenzenlosleckerbaklava101-audioplayer.html',
57 'md5': 'cfff440d4ee64114083ac44676df5d15',
61 'title': 'Grenzenlos lecker - Baklava',
62 'description': 'md5:7b29e97e10dfb6e265238b32fa35b23a',
63 'upload_date': '20140311',
68 def _real_extract(self, url):
69 mobj = re.match(self._VALID_URL, url)
70 page_url = mobj.group('url')
71 page_id = mobj.group('id')
73 webpage = self._download_webpage(url, page_id)
75 if mobj.group('player') is None:
77 self.url_result(page_url + href, 'WDR')
78 for href in re.findall(r'<a href="/?(.+?%s\.html)" rel="nofollow"' % self._PLAYER_REGEX, webpage)
80 return self.playlist_result(entries, page_id)
82 flashvars = compat_urlparse.parse_qs(
83 self._html_search_regex(r'<param name="flashvars" value="([^"]+)"', webpage, 'flashvars'))
85 page_id = flashvars['trackerClipId'][0]
86 video_url = flashvars['dslSrc'][0]
87 title = flashvars['trackerClipTitle'][0]
88 thumbnail = flashvars['startPicture'][0] if 'startPicture' in flashvars else None
90 if 'trackerClipAirTime' in flashvars:
91 upload_date = flashvars['trackerClipAirTime'][0]
93 upload_date = self._html_search_meta('DC.Date', webpage, 'upload date')
96 upload_date = unified_strdate(upload_date)
98 if video_url.endswith('.f4m'):
99 video_url += '?hdcore=3.2.0&plugin=aasp-3.2.0.77.18'
102 ext = determine_ext(video_url)
104 description = self._html_search_meta('Description', webpage, 'description')
111 'description': description,
112 'thumbnail': thumbnail,
113 'upload_date': upload_date,