def _perform_login_step(self, form_html, fallback_action_url, extra_form_data, note, referrer_url):
action_url = self._search_regex(
def _perform_login_step(self, form_html, fallback_action_url, extra_form_data, note, referrer_url):
action_url = self._search_regex(
'post url', default=fallback_action_url, group='url')
if not action_url.startswith('http'):
'post url', default=fallback_action_url, group='url')
if not action_url.startswith('http'):
self._check_error(response, ('email', 'password', 'ErrorMessage'))
self._check_error(response, ('email', 'password', 'ErrorMessage'))
def _raise_unavailable(self, video_id):
self.raise_login_required(
def _raise_unavailable(self, video_id):
self.raise_login_required(
def _real_extract(self, url):
mobj = self._match_valid_url(url)
def _real_extract(self, url):
mobj = self._match_valid_url(url)
- 'https://www.lynda.com/ajax/course/%s/%s/play'
- % (course_id, video_id), video_id, 'Downloading play JSON')
+ f'https://www.lynda.com/ajax/course/{course_id}/{video_id}/play', video_id, 'Downloading play JSON')
'width': int_or_none(f.get('Width')),
'height': int_or_none(f.get('Height')),
'filesize': int_or_none(f.get('FileSize')),
'width': int_or_none(f.get('Width')),
'height': int_or_none(f.get('Height')),
'filesize': int_or_none(f.get('FileSize')),
} for format_id, video_url in prioritized_stream.items()])
self._check_formats(formats, video_id)
} for format_id, video_url in prioritized_stream.items()])
self._check_formats(formats, video_id)
- for pos in range(0, len(subs) - 1):
- seq_current = subs[pos]
+ for seq_current, seq_next in zip(subs, subs[1:]):
subs = self._download_webpage(
url, video_id, 'Downloading subtitles JSON', fatal=False)
if not subs or 'Status="NotFound"' in subs:
subs = self._download_webpage(
url, video_id, 'Downloading subtitles JSON', fatal=False)
if not subs or 'Status="NotFound"' in subs:
'ie_key': LyndaIE.ie_key(),
'chapter': chapter.get('Title'),
'chapter_number': int_or_none(chapter.get('ChapterIndex')),
'ie_key': LyndaIE.ie_key(),
'chapter': chapter.get('Title'),
'chapter_number': int_or_none(chapter.get('ChapterIndex')),
- '%s videos are only available for members (or paid members) and will not be downloaded. '
- % unaccessible_videos + self._ACCOUNT_CREDENTIALS_HINT)
+ f'{unaccessible_videos} videos are only available for members (or paid members) '
+ f'and will not be downloaded. {self._ACCOUNT_CREDENTIALS_HINT}')