import re
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
dict_get,
ExtractorError,
int_or_none,
+ join_nonempty,
parse_iso8601,
try_get,
unescapeHTML,
return response
def _real_extract(self, url):
- ref_id, display_id = re.match(self._VALID_URL, url).groups()
+ ref_id, display_id = self._match_valid_url(url).groups()
webpage = self._download_webpage(url, display_id)
app_token = self._search_regex([
r'clientAPI\s*:\s*"([^"]+)"',
elif asset_type == 'audio':
tbr = abr
- format_id = ['http']
- if tbr:
- format_id.append(compat_str(tbr))
-
formats.append({
- 'format_id': '-'.join(format_id),
+ 'format_id': join_nonempty('http', tbr),
'url': unescapeHTML(http_url),
'vbr': vbr,
'abr': abr,
re.sub(r'/od/[^/]+/', '/od/http/', smil_url), video_id,
transform_source=transform_source, fatal=False))
- self._sort_formats(formats)
+ self._sort_formats(formats, ('tbr', )) # Incomplete resolution information
subtitles = {}
for caption in video_data.get('captions', []):