aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-03-13 02:08:36 +0600
committerSergey M․ <dstftw@gmail.com>2016-03-13 02:08:36 +0600
commite9c8999ede2e07c64f2b592b12158d763dc933c8 (patch)
tree0d6c5c51f5282c994917b7c49e30dfc682d37ab1
parent73cbd709f9fae8e27bd019bce4f5764db05634a1 (diff)
downloadyoutube-dl-e9c8999ede2e07c64f2b592b12158d763dc933c8.zip
youtube-dl-e9c8999ede2e07c64f2b592b12158d763dc933c8.tar.gz
youtube-dl-e9c8999ede2e07c64f2b592b12158d763dc933c8.tar.bz2
[safari] Fix authentication
-rw-r--r--youtube_dl/extractor/safari.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/youtube_dl/extractor/safari.py b/youtube_dl/extractor/safari.py
index 56a7dfb..10c7f39 100644
--- a/youtube_dl/extractor/safari.py
+++ b/youtube_dl/extractor/safari.py
@@ -27,12 +27,13 @@ class SafariBaseIE(InfoExtractor):
LOGGED_IN = False
def _real_initialize(self):
- # We only need to log in once for courses or individual videos
- if not self.LOGGED_IN:
- self._login()
- SafariBaseIE.LOGGED_IN = True
+ self._login()
def _login(self):
+ # We only need to log in once for courses or individual videos
+ if self.LOGGED_IN:
+ return
+
(username, password) = self._get_login_info()
if username is None:
return
@@ -68,6 +69,8 @@ class SafariBaseIE(InfoExtractor):
'Login failed; make sure your credentials are correct and try again.',
expected=True)
+ SafariBaseIE.LOGGED_IN = True
+
self.to_screen('Login successful')