[srgssr] Extract ID from popup player
This commit is contained in:
parent
503b604a31
commit
5a55a7512b
@ -106,7 +106,7 @@ class SRGSSRIE(InfoExtractor):
|
||||
|
||||
class SRGSSRPlayIE(InfoExtractor):
|
||||
IE_DESC = 'srf.ch, rts.ch, rsi.ch, rtr.ch and swissinfo.ch play sites'
|
||||
_VALID_URL = r'https?://(?:(?:www|play)\.)?(?P<bu>srf|rts|rsi|rtr|swissinfo)\.ch/play/(?:tv|radio)/[^/]+/(?P<type>video|audio)/[^?]+\?id=(?P<id>[0-9a-f\-]{36}|\d+)'
|
||||
_VALID_URL = r'https?://(?:(?:www|play)\.)?(?P<bu>srf|rts|rsi|rtr|swissinfo)\.ch/play/(?:tv|radio)/(?:[^/]+/(?P<type>video|audio)/[^?]+|popup(?P<type_popup>video|audio)player)\?id=(?P<id>[0-9a-f\-]{36}|\d+)'
|
||||
|
||||
_TESTS = [{
|
||||
'url': 'http://www.srf.ch/play/tv/10vor10/video/snowden-beantragt-asyl-in-russland?id=28e1a57d-5b76-4399-8ab3-9097f071e6c5',
|
||||
@ -163,9 +163,23 @@ class SRGSSRPlayIE(InfoExtractor):
|
||||
# m3u8 download
|
||||
'skip_download': True,
|
||||
}
|
||||
}, {
|
||||
# popup player
|
||||
'url': 'https://www.srf.ch/play/tv/popupvideoplayer?id=5b4097ab-8c3f-4487-9dfc-6596cd478c01',
|
||||
'info_dict': {
|
||||
'id': '5b4097ab-8c3f-4487-9dfc-6596cd478c01',
|
||||
'ext': 'mp4',
|
||||
'upload_date': '20180124',
|
||||
'title': 'Der Generalstreik',
|
||||
'description': 'md5:94ccd63d72045a3a9eec74f16bfe56ee',
|
||||
'timestamp': 1516787425,
|
||||
},
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
}
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
bu, media_type, media_id = re.match(self._VALID_URL, url).groups()
|
||||
bu, media_type, media_type_popup, media_id = re.match(self._VALID_URL, url).groups()
|
||||
# other info can be extracted from url + '&layout=json'
|
||||
return self.url_result('srgssr:%s:%s:%s' % (bu[:3], media_type, media_id), 'SRGSSR')
|
||||
return self.url_result('srgssr:%s:%s:%s' % (bu[:3], media_type or media_type_popup, media_id), 'SRGSSR')
|
||||
|
Loading…
x
Reference in New Issue
Block a user