mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-02-02 14:16:50 +00:00
Move cookie log in message to _real_initialize
This commit is contained in:
parent
bb8ebc8767
commit
5090388b73
|
@ -567,9 +567,15 @@ def _initialize_pref(self):
|
|||
pref.update({'hl': self._preferred_lang or 'en', 'tz': 'UTC'})
|
||||
self._set_cookie('.youtube.com', name='PREF', value=urllib.parse.urlencode(pref))
|
||||
|
||||
def _initialize_cookie_auth(self):
|
||||
self._load_sid_cookies()
|
||||
if self._SAPISID or self._1PSAPISID or self._3PSAPISID:
|
||||
self.write_debug('Logged in using cookies')
|
||||
|
||||
def _real_initialize(self):
|
||||
self._initialize_pref()
|
||||
self._initialize_consent()
|
||||
self._initialize_cookie_auth()
|
||||
self._check_login_required()
|
||||
|
||||
def _perform_login(self, username, password):
|
||||
|
@ -800,10 +806,7 @@ def _extract_visitor_data(self, *args):
|
|||
|
||||
@functools.cached_property
|
||||
def is_authenticated(self):
|
||||
if bool(self._generate_sid_authorization()):
|
||||
self.write_debug('Logged in using cookies')
|
||||
return True
|
||||
return False
|
||||
return bool(self._generate_sid_authorization())
|
||||
|
||||
def extract_ytcfg(self, video_id, webpage):
|
||||
if not webpage:
|
||||
|
|
Loading…
Reference in a new issue