Plugin cleanup and tweaks

This commit is contained in:
2023-02-20 19:18:45 -06:00
parent 372e4ff3dc
commit 3ad9e1c7bb
1138 changed files with 48878 additions and 40445 deletions

View File

@@ -1,5 +1,3 @@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
@@ -21,9 +19,6 @@ class LyndaBaseIE(InfoExtractor):
_ACCOUNT_CREDENTIALS_HINT = 'Use --username and --password options to provide lynda.com account credentials.'
_NETRC_MACHINE = 'lynda'
def _real_initialize(self):
self._login()
@staticmethod
def _check_error(json_string, key_or_keys):
keys = [key_or_keys] if isinstance(key_or_keys, compat_str) else key_or_keys
@@ -32,7 +27,7 @@ class LyndaBaseIE(InfoExtractor):
if error:
raise ExtractorError('Unable to login: %s' % error, expected=True)
def _login_step(self, form_html, fallback_action_url, extra_form_data, note, referrer_url):
def _perform_login_step(self, form_html, fallback_action_url, extra_form_data, note, referrer_url):
action_url = self._search_regex(
r'<form[^>]+action=(["\'])(?P<url>.+?)\1', form_html,
'post url', default=fallback_action_url, group='url')
@@ -55,11 +50,7 @@ class LyndaBaseIE(InfoExtractor):
return response, action_url
def _login(self):
username, password = self._get_login_info()
if username is None:
return
def _perform_login(self, username, password):
# Step 1: download signin page
signin_page = self._download_webpage(
self._SIGNIN_URL, None, 'Downloading signin page')
@@ -166,7 +157,6 @@ class LyndaIE(LyndaBaseIE):
'format_id': '%s-%s' % (cdn, format_id) if cdn else format_id,
'height': int_or_none(format_id),
})
self._sort_formats(formats)
conviva = self._download_json(
'https://www.lynda.com/ajax/player/conviva', video_id,
@@ -216,7 +206,6 @@ class LyndaIE(LyndaBaseIE):
} for format_id, video_url in prioritized_stream.items()])
self._check_formats(formats, video_id)
self._sort_formats(formats)
subtitles = self.extract_subtitles(video_id)