mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
Merge f333ff8f7c
into 05c8023a27
This commit is contained in:
commit
256ce56d11
1 changed files with 42 additions and 13 deletions
|
@ -1,9 +1,6 @@
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..networking.exceptions import HTTPError
|
from ..networking.exceptions import HTTPError
|
||||||
from ..utils import (
|
from ..utils import ExtractorError, float_or_none, traverse_obj
|
||||||
ExtractorError,
|
|
||||||
float_or_none,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RedBullTVIE(InfoExtractor):
|
class RedBullTVIE(InfoExtractor):
|
||||||
|
@ -168,12 +165,22 @@ class RedBullIE(InfoExtractor):
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'AA-1MT8DQWA91W14',
|
'id': 'AA-1MT8DQWA91W14',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Grime - Hashtags S2E4',
|
'title': 'Grime',
|
||||||
'description': 'md5:5546aa612958c08a98faaad4abce484d',
|
'description': 'md5:5546aa612958c08a98faaad4abce484d',
|
||||||
|
'duration': 904.0,
|
||||||
},
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.redbull.com/int-en/films/kilimanjaro-mountain-of-greatness',
|
'url': 'https://www.redbull.com/int-en/films/kilimanjaro-mountain-of-greatness',
|
||||||
'only_matching': True,
|
'md5': 'db8271a7200d40053a1809ed0dd574ff',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'AA-1UDTFEPTW1W12',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Kilimanjaro: Mountain of Greatness',
|
||||||
|
'description': 'md5:e44aedc87ff8587307a4a20fdfe8db61',
|
||||||
|
'duration': 1834.0,
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.redbull.com/int-en/recap-videos/uci-mountain-bike-world-cup-2017-mens-xco-finals-from-vallnord',
|
'url': 'https://www.redbull.com/int-en/recap-videos/uci-mountain-bike-world-cup-2017-mens-xco-finals-from-vallnord',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
@ -210,14 +217,36 @@ def _real_extract(self, url):
|
||||||
regions.append('INT')
|
regions.append('INT')
|
||||||
locale = '>'.join([f'{lang}-{reg}' for reg in regions])
|
locale = '>'.join([f'{lang}-{reg}' for reg in regions])
|
||||||
|
|
||||||
rrn_id = self._download_json(
|
rrn_data = self._download_json(
|
||||||
'https://www.redbull.com/v3/api/graphql/v1/v3/query/' + locale,
|
f'https://www.redbull.com/v3/api/graphql/v1/v3/feed/{locale}',
|
||||||
display_id, query={
|
display_id, query={
|
||||||
'filter[type]': filter_type,
|
'filter[type]': filter_type,
|
||||||
|
'page[limit]': 1,
|
||||||
'filter[uriSlug]': display_id,
|
'filter[uriSlug]': display_id,
|
||||||
'rb3Schema': 'v1:hero',
|
'disableUsageRestrictions': 'true',
|
||||||
})['data']['id']
|
'rb3Schema': 'v1:pageConfig',
|
||||||
|
'rb3PageUrl': f'/{region.lower()}-{lang.lower()}/{filter_type}/{display_id}',
|
||||||
|
})['data']
|
||||||
|
|
||||||
return self.url_result(
|
rrn_id = rrn_data.get('id')
|
||||||
'https://www.redbull.com/embed/' + rrn_id,
|
|
||||||
RedBullEmbedIE.ie_key(), rrn_id)
|
video_info = self._download_json(
|
||||||
|
'https://api-player.redbull.com/rbcom/videoresource', rrn_id, query={
|
||||||
|
'videoId': rrn_id,
|
||||||
|
'localeMixing': locale,
|
||||||
|
})
|
||||||
|
|
||||||
|
video_id = video_info.get('assetId')
|
||||||
|
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||||
|
video_info.get('videoUrl'), video_id, 'mp4', m3u8_id='hls')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
**traverse_obj(video_info, {
|
||||||
|
'title': 'title',
|
||||||
|
'duration': 'duration',
|
||||||
|
}),
|
||||||
|
'description': traverse_obj(rrn_data, ('pageMeta', 'description')),
|
||||||
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue