1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-03 08:25:35 +08:00

[iprima] Fix id extraction, add new valid URL patterns

This commit is contained in:
Jiří Helebrant 2017-12-13 15:28:20 +01:00
parent 15960255fe
commit d3410d7f1a

View File

@ -12,7 +12,7 @@ from ..utils import (
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://play\.iprima\.cz/(?:.+/)?(?P<id>[^?#]+)'
_VALID_URL = r'https?://(?:prima|cool|max|zoom|love|play)\.iprima\.cz/(?:.+/)?(?P<id>[^?#]+)'
_GEO_BYPASS = False
_TESTS = [{
@ -40,15 +40,16 @@ class IPrimaIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
video_id = self._search_regex(r'data-product="([^"]+)">', webpage, 'real id')
video_id = self._search_regex(r'(?:prehravac/embedded\?id=|productId: \')(p[0-9]+)', webpage, 'real id')
playerpage = self._download_webpage(
'http://play.iprima.cz/prehravac/init',
'http://api.play-backend.iprima.cz/prehravac/init-embed',
video_id, note='Downloading player', query={
'_infuse': 1,
'_ts': round(time.time()),
'productId': video_id,
}, headers={'Referer': url})
'embed': 'true',
}, headers={'Referer': 'http://api.play-backend.iprima.cz/prehravac/embedded?id=' + video_id})
formats = []