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 'upload_date': '20140311',
40 'skip_download': True,
44 'url': 'http://www1.wdr.de/themen/kultur/audioerlebtegeschichtenmargaspiegel100-audioplayer.html',
45 'md5': '83e9e8fefad36f357278759870805898',
49 'title': 'Erlebte Geschichten: Marga Spiegel (29.11.2009)',
50 'upload_date': '20091129',
54 'url': 'http://www.funkhauseuropa.de/av/audiogrenzenlosleckerbaklava101-audioplayer.html',
55 'md5': 'cfff440d4ee64114083ac44676df5d15',
59 'title': 'Grenzenlos lecker - Baklava',
60 'upload_date': '20140311',
65 def _real_extract(self, url):
66 mobj = re.match(self._VALID_URL, url)
67 page_url = mobj.group('url')
68 page_id = mobj.group('id')
70 webpage = self._download_webpage(url, page_id)
72 if mobj.group('player') is None:
74 self.url_result(page_url + href, 'WDR')
75 for href in re.findall(r'<a href="/?(.+?%s\.html)" rel="nofollow"' % self._PLAYER_REGEX, webpage)
77 return self.playlist_result(entries, page_id)
79 flashvars = compat_urlparse.parse_qs(
80 self._html_search_regex(r'<param name="flashvars" value="([^"]+)"', webpage, 'flashvars'))
82 page_id = flashvars['trackerClipId'][0]
83 video_url = flashvars['dslSrc'][0]
84 title = flashvars['trackerClipTitle'][0]
85 thumbnail = flashvars['startPicture'][0] if 'startPicture' in flashvars else None
87 if 'trackerClipAirTime' in flashvars:
88 upload_date = flashvars['trackerClipAirTime'][0]
90 upload_date = self._html_search_meta('DC.Date', webpage, 'upload date')
93 upload_date = unified_strdate(upload_date)
95 if video_url.endswith('.f4m'):
96 video_url += '?hdcore=3.2.0&plugin=aasp-3.2.0.77.18'
99 ext = determine_ext(video_url)
101 description = self._html_search_meta('Description', webpage, 'description')
108 'description': description,
109 'thumbnail': thumbnail,
110 'upload_date': upload_date,