mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-28 07:54:49 +00: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:
@@ -247,11 +247,7 @@ class TumblrIE(InfoExtractor):
|
||||
|
||||
_ACCESS_TOKEN = None
|
||||
|
||||
def _real_initialize(self):
|
||||
self.get_access_token()
|
||||
self._login()
|
||||
|
||||
def get_access_token(self):
|
||||
def _initialize_pre_login(self):
|
||||
login_page = self._download_webpage(
|
||||
self._LOGIN_URL, None, 'Downloading login page', fatal=False)
|
||||
if login_page:
|
||||
@@ -260,11 +256,7 @@ class TumblrIE(InfoExtractor):
|
||||
if not self._ACCESS_TOKEN:
|
||||
self.report_warning('Failed to get access token; metadata will be missing and some videos may not work')
|
||||
|
||||
def _login(self):
|
||||
username, password = self._get_login_info()
|
||||
if not username:
|
||||
return
|
||||
|
||||
def _perform_login(self, username, password):
|
||||
if not self._ACCESS_TOKEN:
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user