-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
title = video['title'].strip()
- formats = self._extract_m3u8_formats(
+ formats, subtitles = self._extract_m3u8_formats_and_subtitles(
'https://dms.redbull.tv/v3/%s/%s/playlist.m3u8' % (video_id, token),
video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
- self._sort_formats(formats)
- subtitles = {}
for resource in video.get('resources', []):
if resource.startswith('closed_caption_'):
splitted_resource = resource.split('_')
return self.extract_info(video_id)
-class RedBullEmbedIE(RedBullTVIE):
+class RedBullEmbedIE(RedBullTVIE): # XXX: Do not subclass from concrete IE
_VALID_URL = r'https?://(?:www\.)?redbull\.com/embed/(?P<id>rrn:content:[^:]+:[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}:[a-z]{2}-[A-Z]{2,3})'
_TESTS = [{
# HLS manifest accessible only using assetId
rrn_id = self._match_id(url)
asset_id = self._download_json(
'https://edge-graphql.crepo-production.redbullaws.com/v1/graphql',
- rrn_id, headers={'API-KEY': 'e90a1ff11335423998b100c929ecc866'},
- query={
+ rrn_id, headers={
+ 'Accept': 'application/json',
+ 'API-KEY': 'e90a1ff11335423998b100c929ecc866',
+ }, query={
'query': '''{
resource(id: "%s", enforceGeoBlocking: false) {
%s
}]
def _real_extract(self, url):
- region, lang, rrn_id = re.search(self._VALID_URL, url).groups()
+ region, lang, rrn_id = self._match_valid_url(url).groups()
rrn_id += ':%s-%s' % (lang, region.upper())
return self.url_result(
'https://www.redbull.com/embed/' + rrn_id,
_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()
+ region, lang, filter_type, display_id = self._match_valid_url(url).groups()
if filter_type == 'episodes':
filter_type = 'episode-videos'
elif filter_type == 'live':