mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-05-25 14:56:27 +02:00
[extractor] Add _perform_login
function (#2943)
* Adds new functions `_initialize_pre_login` and `_perform_login` as part of the extractor API * Adds `ie.supports_login` to the public API
This commit is contained in:
parent
028f6437f1
commit
52efa4b312
68 changed files with 253 additions and 569 deletions
|
@ -51,17 +51,14 @@ class TeamTreeHouseIE(InfoExtractor):
|
|||
}]
|
||||
_NETRC_MACHINE = 'teamtreehouse'
|
||||
|
||||
def _real_initialize(self):
|
||||
email, password = self._get_login_info()
|
||||
if email is None:
|
||||
return
|
||||
def _perform_login(self, username, password):
|
||||
|
||||
signin_page = self._download_webpage(
|
||||
'https://teamtreehouse.com/signin',
|
||||
None, 'Downloading signin page')
|
||||
data = self._form_hidden_inputs('new_user_session', signin_page)
|
||||
data.update({
|
||||
'user_session[email]': email,
|
||||
'user_session[email]': username,
|
||||
'user_session[password]': password,
|
||||
})
|
||||
error_message = get_element_by_class('error-message', self._download_webpage(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue