mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-01-24 11:49:54 +00:00
Support _non_-tokenized source URLs too
This commit is contained in:
parent
b675a6e6b9
commit
ce604ae7dc
@ -477,7 +477,9 @@ class NBCOlympicsIE(InfoExtractor):
|
|||||||
class NBCOlympicsStreamIE(AdobePassIE):
|
class NBCOlympicsStreamIE(AdobePassIE):
|
||||||
IE_NAME = 'nbcolympics:stream'
|
IE_NAME = 'nbcolympics:stream'
|
||||||
_VALID_URL = r'https?://stream\.nbcolympics\.com/(?P<id>[0-9a-z-]+)'
|
_VALID_URL = r'https?://stream\.nbcolympics\.com/(?P<id>[0-9a-z-]+)'
|
||||||
_TEST = {
|
_TESTS = [
|
||||||
|
# "Tokenized" .m3u8 source URL
|
||||||
|
{
|
||||||
'url': 'https://stream.nbcolympics.com/womens-soccer-group-round-11',
|
'url': 'https://stream.nbcolympics.com/womens-soccer-group-round-11',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2019740',
|
'id': '2019740',
|
||||||
@ -488,7 +490,21 @@ class NBCOlympicsStreamIE(AdobePassIE):
|
|||||||
# m3u8 download
|
# m3u8 download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
# Plain .m3u8 source URL
|
||||||
|
{
|
||||||
|
'url': 'https://stream.nbcolympics.com/gymnastics-event-finals-mens-floor-pommel-horse-womens-vault-bars',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '2021729',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': r're:Event Finals: M Floor, W Vault, M Pommel, W Uneven Bars [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
_DATA_URL_TEMPLATE = 'http://stream.nbcolympics.com/data/%s_%s.json'
|
_DATA_URL_TEMPLATE = 'http://stream.nbcolympics.com/data/%s_%s.json'
|
||||||
_LEAP_URL_TEMPLATE = 'https://api-leap.nbcsports.com/feeds/assets/%s?application=NBCOlympics&platform=%s&format=nbc-player&env=staging'
|
_LEAP_URL_TEMPLATE = 'https://api-leap.nbcsports.com/feeds/assets/%s?application=NBCOlympics&platform=%s&format=nbc-player&env=staging'
|
||||||
|
|
||||||
@ -521,7 +537,8 @@ class NBCOlympicsStreamIE(AdobePassIE):
|
|||||||
media_token = self._extract_mvpd_auth(
|
media_token = self._extract_mvpd_auth(
|
||||||
url, pid, event_config.get('requestorId', 'NBCOlympics'), ap_resource)
|
url, pid, event_config.get('requestorId', 'NBCOlympics'), ap_resource)
|
||||||
|
|
||||||
tokenized_url = self._download_json(
|
if event_config.get('cdnToken') is True:
|
||||||
|
source_url = self._download_json(
|
||||||
'https://tokens.playmakerservices.com/',
|
'https://tokens.playmakerservices.com/',
|
||||||
pid,
|
pid,
|
||||||
'Retrieving tokenized URL',
|
'Retrieving tokenized URL',
|
||||||
@ -543,7 +560,7 @@ class NBCOlympicsStreamIE(AdobePassIE):
|
|||||||
}).encode(),
|
}).encode(),
|
||||||
)['akamai'][0]['tokenizedUrl']
|
)['akamai'][0]['tokenizedUrl']
|
||||||
|
|
||||||
formats = self._extract_m3u8_formats(tokenized_url, pid, 'mp4')
|
formats = self._extract_m3u8_formats(source_url, pid, 'mp4')
|
||||||
for f in formats:
|
for f in formats:
|
||||||
f['_seekable'] = False
|
f['_seekable'] = False
|
||||||
f['_http_seekable'] = False
|
f['_http_seekable'] = False
|
||||||
|
Loading…
Reference in New Issue
Block a user