From 8682f760f5d80aefd0086d2dcfb04b38ec5fecb8 Mon Sep 17 00:00:00 2001 From: Ganden Schaffner Date: Fri, 9 Aug 2019 16:40:21 -0700 Subject: [PATCH] [redbulltv] Support .com w/ rrn ID when api.redbull.tv/v3/products/ works URLs that now work: https://www.redbull.com/int-en/episodes/AP-1PMHKJFCW1W11 (working api.redbull.tv/v3/products/, "AP-..." ID) https://www.redbull.com/us-en/events/AP-1XJS6EYM12111/live/AP-1YM8YVH1D2111 (working api.redbull.tv/v3/products/, "rrn:..." ID) URLs that fail: https://www.redbull.com/int-en/films/AP-1ZSMAW8FH2111 (failing api.redbull.tv/v3/products/, "rrn:..." ID) --- youtube_dl/extractor/redbulltv.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/redbulltv.py b/youtube_dl/extractor/redbulltv.py index dbe1aaded..2179133ca 100644 --- a/youtube_dl/extractor/redbulltv.py +++ b/youtube_dl/extractor/redbulltv.py @@ -10,7 +10,7 @@ from ..utils import ( class RedBullTVIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?redbull(?:\.tv|\.com(?:/[^/]+)?(?:/tv)?)(?:/events/[^/]+)?/(?:videos?|live)/(?PAP-\w+)' + _VALID_URL = r'https?://(?:www\.)?redbull\.com/[^/]+/(?:videos|recap-videos|events|episodes|films)/(?PAP-\w+)' _TESTS = [{ # film 'url': 'https://www.redbull.tv/video/AP-1Q6XCDTAN1W11', @@ -76,6 +76,12 @@ class RedBullTVIE(InfoExtractor): title = video['title'].strip() + # use an 'rrn:...' ID instead of an 'AP-...' ID if necessary + content_path = video.get('status', {}).get('play') + if content_path: + # trim '/content/' from '/content/rrn:...' + video_id = content_path[9:] + formats = self._extract_m3u8_formats( 'https://dms.redbull.tv/v3/%s/%s/playlist.m3u8' % (video_id, token), video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')