]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/instagram.py
[extractor] Add `_perform_login` function (#2943)
[yt-dlp.git] / yt_dlp / extractor / instagram.py
index 3bb786d6a3c7a21aff65b7c7a86ccca8579286f6..970f2c8abf96452672d9c838c44e1276ce949dba 100644 (file)
@@ -29,9 +29,8 @@ class InstagramBaseIE(InfoExtractor):
     _NETRC_MACHINE = 'instagram'
     _IS_LOGGED_IN = False
 
-    def _login(self):
-        username, password = self._get_login_info()
-        if username is None or self._IS_LOGGED_IN:
+    def _perform_login(self, username, password):
+        if self._IS_LOGGED_IN:
             return
 
         login_webpage = self._download_webpage(
@@ -72,9 +71,6 @@ def _login(self):
             raise ExtractorError('Unable to login')
         InstagramBaseIE._IS_LOGGED_IN = True
 
-    def _real_initialize(self):
-        self._login()
-
     def _get_count(self, media, kind, *keys):
         return traverse_obj(
             media, (kind, 'count'), *((f'edge_media_{key}', 'count') for key in keys),