1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[curiositystream] don't cache auth token

This commit is contained in:
Remita Amine 2016-09-01 19:46:58 +01:00
parent 4191779dcd
commit b207d5ebd4

View file

@ -33,24 +33,16 @@ class CuriosityStreamBaseIE(InfoExtractor):
return result['data'] return result['data']
def _real_initialize(self): def _real_initialize(self):
if not self._auth_token: (email, password) = self._get_login_info()
user = self._downloader.cache.load('curiositystream', 'user') or {} if email is None:
self._auth_token = user.get('auth_token') return
if not self._auth_token: result = self._download_json(
(email, password) = self._get_login_info() self._API_BASE_URL + 'login', None, data=urlencode_postdata({
if email is None: 'email': email,
return 'password': password,
result = self._download_json( }))
self._API_BASE_URL + 'login', None, data=urlencode_postdata({ self._handle_errors(result)
'email': email, self._auth_token = result['message']['auth_token']
'password': password,
}))
self._handle_errors(result)
self._auth_token = result['message']['auth_token']
self._downloader.cache.store(
'curiositystream', 'user', {
'auth_token': self._auth_token,
})
def _extract_media_info(self, media): def _extract_media_info(self, media):
video_id = compat_str(media['id']) video_id = compat_str(media['id'])