-# coding: utf-8
-from __future__ import unicode_literals
-
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
- compat_str,
determine_ext,
- ExtractorError,
+ join_nonempty,
update_url_query,
)
}]
def _real_extract(self, url):
- domain, video_id, display_id = re.match(self._VALID_URL, url).groups()
+ domain, video_id, display_id = self._match_valid_url(url).groups()
if not video_id:
webpage = self._download_webpage(url, display_id)
grill = re.sub(r'"\s*\+\s*"', '', self._search_regex(
continue
formats.append(f)
continue
- format_id = []
- if flavor_format:
- format_id.append(flavor_format)
- if tbr:
- format_id.append(compat_str(tbr))
ext = determine_ext(flavor_url)
if flavor_format == 'applehttp' or ext == 'm3u8':
ext = 'mp4'
width = int_or_none(flavor.get('width'))
height = int_or_none(flavor.get('height'))
formats.append({
- 'format_id': '-'.join(format_id),
+ 'format_id': join_nonempty(flavor_format, tbr),
'url': flavor_url,
'width': width,
'height': height,
'vcodec': 'none' if (width == 0 and height == 0) else None,
})
if not formats and video_data.get('expired'):
- raise ExtractorError(
+ self.raise_no_formats(
'%s said: %s' % (self.IE_NAME, page_data['translations']['video_expired']),
expected=True)
- self._sort_formats(formats)
subtitles = {}
for caption in video_data.get('captions', []):