]> jfr.im git - yt-dlp.git/commitdiff
[curiositystream] Get `auth_token` from cookie (#3836)
authormonnef <redacted>
Thu, 26 May 2022 23:02:20 +0000 (01:02 +0200)
committerGitHub <redacted>
Thu, 26 May 2022 23:02:20 +0000 (16:02 -0700)
Closes #3753
Authored by: mnn

yt_dlp/extractor/curiositystream.py

index 5b76b29ff4fa3b968398b23c6cbfec8abe534c4f..e71b0528978b095008c23200c2ea1a57860d35cb 100644 (file)
@@ -23,6 +23,11 @@ def _handle_errors(self, result):
 
     def _call_api(self, path, video_id, query=None):
         headers = {}
+        if not self._auth_token:
+            auth_cookie = self._get_cookies('https://curiositystream.com').get('auth_token')
+            if auth_cookie:
+                self.write_debug('Obtained auth_token cookie')
+                self._auth_token = cookie.value
         if self._auth_token:
             headers['X-Auth-Token'] = self._auth_token
         result = self._download_json(