From 903d1369428f72397dbc698654dbad445ecaf2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 14 Nov 2015 16:43:58 +0600 Subject: [PATCH] [lynda] Logout only when login info present (Closes #7500) --- youtube_dl/extractor/lynda.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/lynda.py b/youtube_dl/extractor/lynda.py index 9a207b2cd4..7d78a88059 100644 --- a/youtube_dl/extractor/lynda.py +++ b/youtube_dl/extractor/lynda.py @@ -83,6 +83,10 @@ def _login(self): 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)