浏览代码

[lynda] Logout only when login info present (Closes #7500)

Sergey M․ 9 年之前
父节点
当前提交
903d136942
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/extractor/lynda.py

+ 4 - 0
youtube_dl/extractor/lynda.py

@@ -83,6 +83,10 @@ class LyndaBaseIE(InfoExtractor):
             raise ExtractorError('Unable to log in')
 
     def _logout(self):
+        username, _ = self._get_login_info()
+        if username is None:
+            return
+
         self._download_webpage(
             'http://www.lynda.com/ajax/logout.aspx', None,
             'Logging out', 'Unable to log out', fatal=False)