mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-03 05:55:52 +00:00
Compare commits
4 Commits
edf7d0ebd3
...
c7a9c4d250
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7a9c4d250 | ||
|
|
0bc6814c9f | ||
|
|
aa72488bd6 | ||
|
|
7b9398f1d1 |
@ -3,6 +3,7 @@ from ..networking.exceptions import HTTPError
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
|
traverse_obj
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -225,28 +226,35 @@ class RedBullIE(InfoExtractor):
|
|||||||
locale = '>'.join([f'{lang}-{reg}' for reg in regions])
|
locale = '>'.join([f'{lang}-{reg}' for reg in regions])
|
||||||
|
|
||||||
rrn_data = self._download_json(
|
rrn_data = self._download_json(
|
||||||
'https://www.redbull.com/v3/api/graphql/v1/v3/feed/' + locale,
|
f'https://www.redbull.com/v3/api/graphql/v1/v3/feed/{locale}',
|
||||||
display_id, query={
|
display_id, query={
|
||||||
'filter[type]': filter_type, 'page[limit]': 1, 'filter[uriSlug]': display_id,
|
'filter[type]': filter_type,
|
||||||
'disableUsageRestrictions': 'true', 'rb3Schema': 'v1:pageConfig',
|
'page[limit]': 1,
|
||||||
'rb3PageUrl': '/' + region.lower() + '-' + lang.lower() + '/' + filter_type + '/' + display_id,
|
'filter[uriSlug]': display_id,
|
||||||
|
'disableUsageRestrictions': 'true',
|
||||||
|
'rb3Schema': 'v1:pageConfig',
|
||||||
|
'rb3PageUrl': f'/{region.lower()}-{lang.lower()}/{filter_type}/{display_id}',
|
||||||
})['data']
|
})['data']
|
||||||
|
|
||||||
|
rrn_id = rrn_data.get('id')
|
||||||
|
|
||||||
video_info = self._download_json(
|
video_info = self._download_json(
|
||||||
'https://api-player.redbull.com/rbcom/videoresource', display_id, query={
|
'https://api-player.redbull.com/rbcom/videoresource', rrn_id, query={
|
||||||
'videoId': rrn_data['id'],
|
'videoId': rrn_id,
|
||||||
'localeMixing': locale,
|
'localeMixing': locale,
|
||||||
})
|
})
|
||||||
|
|
||||||
video_id = video_info['assetId']
|
video_id = video_info.get('assetId')
|
||||||
formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_info['videoUrl'],
|
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||||
video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
|
video_info.get('videoUrl'), video_id, 'mp4', m3u8_id='hls')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_info['title'],
|
**traverse_obj(video_info, {
|
||||||
'description': rrn_data['pageMeta'].get('description') or None,
|
'title': 'title',
|
||||||
'duration': float_or_none(video_info['duration']),
|
'duration': 'duration',
|
||||||
|
}),
|
||||||
|
'description': traverse_obj(rrn_data, ('pageMeta', 'description')),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user