[wdr] Updated tests and found bugs

This commit is contained in:
Jürn Brodersen 2015-07-04 02:58:46 +02:00
parent 657be7fa62
commit b4fd2653ea

View File

@ -21,54 +21,41 @@ class WDRIE(InfoExtractor):
_VALID_URL = r'(?P<url>https?://www\d?\.(?:wdr\d?|funkhauseuropa)\.de/)(?P<id>.+?)\.html' _VALID_URL = r'(?P<url>https?://www\d?\.(?:wdr\d?|funkhauseuropa)\.de/)(?P<id>.+?)\.html'
_TESTS = [ _TESTS = [
{ {
'url': 'http://www1.wdr.de/mediathek/video/sendungen/servicezeit/videoservicezeit560-videoplayer_size-L.html', 'url': 'http://www1.wdr.de/mediathek/video/sendungen/hier_und_heute/videostreetfoodpioniere100.html',
'info_dict': { 'info_dict': {
'id': 'mdb-362427', 'id': 'mdb-750693',
'ext': 'flv', 'ext': 'mp4',
'title': 'Servicezeit', 'title': 'Streetfood-Pioniere',
'description': 'md5:c8f43e5e815eeb54d0b96df2fba906cb', 'description': 'md5:bff1fdc6de7df044ac2bec13ab46e6a9',
'upload_date': '20140310', 'upload_date': '20150703',
'is_live': False 'is_live': False
}, },
'params': { 'params': {
'skip_download': True, 'skip_download': True,
'format': 'best'
}, },
}, },
{ {
'url': 'http://www1.wdr.de/themen/av/videomargaspiegelisttot101-videoplayer.html', 'url': 'http://www1.wdr.de/mediathek/audio/1live/einslive-bahnansage-100.html',
'md5': '87c389aac18ee6fc041aa1ced52aac76',
'info_dict': { 'info_dict': {
'id': 'mdb-363194', 'id': 'mdb-726385',
'ext': 'flv',
'title': 'Marga Spiegel ist tot',
'description': 'md5:2309992a6716c347891c045be50992e4',
'upload_date': '20140311',
'is_live': False
},
'params': {
'skip_download': True,
},
},
{
'url': 'http://www1.wdr.de/themen/kultur/audioerlebtegeschichtenmargaspiegel100-audioplayer.html',
'md5': '83e9e8fefad36f357278759870805898',
'info_dict': {
'id': 'mdb-194332',
'ext': 'mp3', 'ext': 'mp3',
'title': 'Erlebte Geschichten: Marga Spiegel (29.11.2009)', 'title': 'Weselsky | 1LIVE Bahnansage (04.06.2015)',
'description': 'md5:2309992a6716c347891c045be50992e4', 'description': 'md5:8b9ef2af8c1bb01394ab98f3450ff04d',
'upload_date': '20091129', 'upload_date': '20150604',
'is_live': False 'is_live': False
}, },
}, },
{ {
'url': 'http://www.funkhauseuropa.de/av/audioflaviacoelhoamaramar100-audioplayer.html', 'url': 'http://www.funkhauseuropa.de/musik/musikspecials/roskilde-zweitausendfuenfzehn-100.html',
'md5': '99a1443ff29af19f6c52cf6f4dc1f4aa', 'md5': 'e50e0c8900f6558ae12cd9953aca5a20',
'info_dict': { 'info_dict': {
'id': 'mdb-478135', 'id': 'mdb-752045',
'ext': 'mp3', 'ext': 'mp3',
'title': 'Flavia Coelho: Amar é Amar', 'title': 'Roskilde Festival 2015',
'description': 'md5:7b29e97e10dfb6e265238b32fa35b23a', 'description': 'md5:48e7a0a884c0e841a9d9174e27c67df3',
'upload_date': '20140717', 'upload_date': '20150702',
'is_live': False 'is_live': False
}, },
}, },
@ -83,10 +70,10 @@ class WDRIE(InfoExtractor):
'url': 'http://www1.wdr.de/mediathek/video/livestream/index.html', 'url': 'http://www1.wdr.de/mediathek/video/livestream/index.html',
'info_dict': { 'info_dict': {
'id': 'mdb-103364', 'id': 'mdb-103364',
'title': 're:^WDR Fernsehen [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$', 'title': 're:^24 Stunden Livestream [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'description': 'md5:ae2ff888510623bf8d4b115f95a9b7c9', 'description': 'md5:ae2ff888510623bf8d4b115f95a9b7c9',
'ext': 'flv', 'ext': 'flv',
'upload_date': '20150212', 'upload_date': '20150101',
'is_live': True 'is_live': True
}, },
'params': { 'params': {
@ -122,7 +109,7 @@ class WDRIE(InfoExtractor):
webpage = self._download_webpage(url, page_id) webpage = self._download_webpage(url, page_id)
entries = re.search(r'%s' % self._PLAYER_REGEX, webpage) entries = re.search(r'%s' % self._PLAYER_REGEX, webpage)
if entries == None: # Overview page if entries is None: # Overview page
return self._overiew_page_extractor(page_url, page_id, webpage) return self._overiew_page_extractor(page_url, page_id, webpage)
jsonpage = self._download_webpage(entries.group(0), entries.group(0)) jsonpage = self._download_webpage(entries.group(0), entries.group(0))
@ -138,7 +125,8 @@ class WDRIE(InfoExtractor):
video_url = video_field['audioURL'] video_url = video_field['audioURL']
else: else:
break break
is_live = video_field.get('flashvarsExt', {'isLive': '0'}) == {'isLive': '1'} is_live = video_field.get('flashvarsExt', {'isLive': '0'})
is_live = is_live.get('isLive', '0') == '1'
if video_url.endswith('.f4m'): if video_url.endswith('.f4m'):
video_url += '?hdcore=3.2.0&plugin=aasp-3.2.0.77.18' video_url += '?hdcore=3.2.0&plugin=aasp-3.2.0.77.18'
@ -156,7 +144,7 @@ class WDRIE(InfoExtractor):
formats.append({'url': video_url, 'ext': ext, 'format_id': _id}) formats.append({'url': video_url, 'ext': ext, 'format_id': _id})
thumbnail = re.search('<div class="illustrationCont w960">\n<div class="linkCont">\n<img src="(?P<thumbnail>.+?)"', webpage) thumbnail = re.search('<div class="illustrationCont w960">\n<div class="linkCont">\n<img src="(?P<thumbnail>.+?)"', webpage)
if thumbnail != None: if thumbnail is not None:
thumbnail = page_url + thumbnail.group('thumbnail') thumbnail = page_url + thumbnail.group('thumbnail')
if is_live: if is_live: