aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-08-14 21:24:33 +0100
committerRemita Amine <remitamine@gmail.com>2016-08-14 21:24:33 +0100
commit7e60ce9cf7b104c15fcc4c495166dc57b950b987 (patch)
treeb1629da1f98773064e1ef6a5e489c25d23438378 /youtube_dl
parente811bcf8f820d92b6629920b7c3c5a902815e6d1 (diff)
[adobepass] clear cache in case of pendingLogout errors
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/adobepass.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py
index 4e59302ab..d315bfbc1 100644
--- a/youtube_dl/extractor/adobepass.py
+++ b/youtube_dl/extractor/adobepass.py
@@ -90,6 +90,9 @@ class AdobePass(InfoExtractor):
'_method': 'GET',
'requestor_id': requestor_id,
}), headers=mvpd_headers)
+ if '<pendingLogout' in short_authorize:
+ self._downloader.cache.store('mvpd', requestor_id, {})
+ return self._extract_mvpd_auth(url, video_id, requestor_id, resource)
authn_token = unescapeHTML(xml_text(session, 'authnToken'))
requestor_info['authn_token'] = authn_token
self._downloader.cache.store('mvpd', requestor_id, requestor_info)
@@ -105,6 +108,9 @@ class AdobePass(InfoExtractor):
'mso_id': xml_text(authn_token, 'simpleTokenMsoID'),
'userMeta': '1',
}), headers=mvpd_headers)
+ if '<pendingLogout' in authorize:
+ self._downloader.cache.store('mvpd', requestor_id, {})
+ return self._extract_mvpd_auth(url, video_id, requestor_id, resource)
authz_token = unescapeHTML(xml_text(authorize, 'authzToken'))
requestor_info[guid] = authz_token
self._downloader.cache.store('mvpd', requestor_id, requestor_info)
@@ -114,7 +120,7 @@ class AdobePass(InfoExtractor):
'ap_23': xml_text(authn_token, 'simpleSamlSessionIndex'),
})
- return self._download_webpage(
+ short_authorize = self._download_webpage(
self._SERVICE_PROVIDER_TEMPLATE % 'shortAuthorize',
video_id, 'Retrieving Media Token', data=urlencode_postdata({
'authz_token': authz_token,
@@ -122,3 +128,7 @@ class AdobePass(InfoExtractor):
'session_guid': xml_text(authn_token, 'simpleTokenAuthenticationGuid'),
'hashed_guid': 'false',
}), headers=mvpd_headers)
+ if '<pendingLogout' in short_authorize:
+ self._downloader.cache.store('mvpd', requestor_id, {})
+ return self._extract_mvpd_auth(url, video_id, requestor_id, resource)
+ return short_authorize \ No newline at end of file