]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[curiositystream] don't cache auth token
authorRemita Amine <remitamine@gmail.com>
Thu, 1 Sep 2016 18:46:58 +0000 (19:46 +0100)
committerRemita Amine <remitamine@gmail.com>
Thu, 1 Sep 2016 18:46:58 +0000 (19:46 +0100)
youtube_dl/extractor/curiositystream.py

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