mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 00:25:06 +00:00
[curiositystream] Get auth_token
from cookie (#3836)
Closes #3753 Authored by: mnn
This commit is contained in:
parent
7879e79d11
commit
d2ff2c91bb
1 changed files with 5 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue