-# coding: utf-8
import re
from .common import InfoExtractor
'skip': 'Requires Authentication',
}]
- def _real_initialize(self):
- email, password = self._get_login_info()
- if email is None:
- return
-
+ def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form')
data = self._hidden_inputs(form)
data.update({
- 'Email': email,
+ 'Email': username,
'Password': password,
})
self._download_webpage(
parsed_urls.add(cc_url)
subtitles.setdefault(cc_lang, []).append({'url': cc_url})
- def _get_subtitles(self, url, video_id, title, key, subtitles, parsed_urls):
+ def _get_subtitles(self, url, video_id, title, key, parsed_urls):
webpage = self._download_webpage(url, video_id, fatal=False) or ''
+ subtitles = {}
for caption in set(re.findall(r'data-captions=\"([^\"]+)\"', webpage)):
renditions = self._call_api(
video_id, title, key, {'Captions': caption}, fatal=False,
raise ExtractorError(
'%s said: %s' % (self.IE_NAME, restriction), expected=True)
- formats, subtitles, parsed_urls = [], {}, {None}
+ formats, parsed_urls = [], {None}
for rendition_id, rendition in settings['renditions'].items():
audio, version, extra = rendition_id.split('_')
m3u8_url = url_or_none(try_get(rendition, lambda x: x['bitrates']['hls']))
f['language'] = audio
f['format_note'] = f'{version}, {extra}'
formats.extend(frmt)
-
- self._extract_subtitles_from_rendition(rendition, subtitles, parsed_urls)
self._sort_formats(formats)
return {
'id': video_id,
'title': video_id,
- 'subtitles': self.extract_subtitles(url, video_id, title, key, subtitles, parsed_urls),
+ 'subtitles': self.extract_subtitles(url, video_id, title, key, parsed_urls),
'formats': formats,
'series': title,
'season_number': int_or_none(