mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-12 14:26:49 +01:00
[lynda:course] Force log out (Closes #7361)
This commit is contained in:
parent
deb85c32bb
commit
179ffab69c
@ -82,6 +82,11 @@ def _login(self):
|
|||||||
expected=True)
|
expected=True)
|
||||||
raise ExtractorError('Unable to log in')
|
raise ExtractorError('Unable to log in')
|
||||||
|
|
||||||
|
def _logout(self):
|
||||||
|
self._download_webpage(
|
||||||
|
'http://www.lynda.com/ajax/logout.aspx', None,
|
||||||
|
'Logging out', 'Unable to log out', fatal=False)
|
||||||
|
|
||||||
|
|
||||||
class LyndaIE(LyndaBaseIE):
|
class LyndaIE(LyndaBaseIE):
|
||||||
IE_NAME = 'lynda'
|
IE_NAME = 'lynda'
|
||||||
@ -210,6 +215,8 @@ def _real_extract(self, url):
|
|||||||
course_id, 'Downloading course JSON')
|
course_id, 'Downloading course JSON')
|
||||||
course_json = json.loads(page)
|
course_json = json.loads(page)
|
||||||
|
|
||||||
|
self._logout()
|
||||||
|
|
||||||
if 'Status' in course_json and course_json['Status'] == 'NotFound':
|
if 'Status' in course_json and course_json['Status'] == 'NotFound':
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Course %s does not exist' % course_id, expected=True)
|
'Course %s does not exist' % course_id, expected=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user