projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f76754
)
[redbulltv] improve support for rebull.com TV localized URLS(#22063)
author
Remita Amine
<remitamine@gmail.com>
Sun, 13 Sep 2020 10:26:11 +0000
(11:26 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Sun, 13 Sep 2020 10:26:11 +0000
(11:26 +0100)
youtube_dl/extractor/redbulltv.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/redbulltv.py
b/youtube_dl/extractor/redbulltv.py
index 06945bd0c0264f47d83b4f70d7eaafd5972ce216..3aae79f5da2a0717c44991130738cfce00760c6b 100644
(file)
--- a/
youtube_dl/extractor/redbulltv.py
+++ b/
youtube_dl/extractor/redbulltv.py
@@
-192,7
+192,14
@@
class RedBullIE(InfoExtractor):
}, {
'url': 'https://www.redbull.com/int-en/live/mens-dh-finals-fort-william',
'only_matching': True,
}, {
'url': 'https://www.redbull.com/int-en/live/mens-dh-finals-fort-william',
'only_matching': True,
+ }, {
+ # only available on the int-en website so a fallback is need for the API
+ # https://www.redbull.com/v3/api/graphql/v1/v3/query/en-GB>en-INT?filter[uriSlug]=fia-wrc-saturday-recap-estonia&rb3Schema=v1:hero
+ 'url': 'https://www.redbull.com/gb-en/live/fia-wrc-saturday-recap-estonia',
+ 'only_matching': True,
}]
}]
+ _INT_FALLBACK_LIST = ['de', 'en', 'es', 'fr']
+ _LAT_FALLBACK_MAP = ['ar', 'bo', 'car', 'cl', 'co', 'mx', 'pe']
def _real_extract(self, url):
region, lang, filter_type, display_id = re.search(self._VALID_URL, url).groups()
def _real_extract(self, url):
region, lang, filter_type, display_id = re.search(self._VALID_URL, url).groups()
@@
-201,8
+208,16
@@
class RedBullIE(InfoExtractor):
elif filter_type == 'live':
filter_type = 'live-videos'
elif filter_type == 'live':
filter_type = 'live-videos'
+ regions = [region.upper()]
+ if region != 'int':
+ if region in self._LAT_FALLBACK_MAP:
+ regions.append('LAT')
+ if lang in self._INT_FALLBACK_LIST:
+ regions.append('INT')
+ locale = '>'.join(['%s-%s' % (lang, reg) for reg in regions])
+
rrn_id = self._download_json(
rrn_id = self._download_json(
- 'https://www.redbull.com/v3/api/graphql/v1/v3/query/
%s-%s' % (lang, region.upper())
,
+ 'https://www.redbull.com/v3/api/graphql/v1/v3/query/
' + locale
,
display_id, query={
'filter[type]': filter_type,
'filter[uriSlug]': display_id,
display_id, query={
'filter[type]': filter_type,
'filter[uriSlug]': display_id,