mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[twitter] Fix for private videos (#2772)
Closes #2762, https://github.com/ytdl-org/youtube-dl/issues/27643 Authored by: iphoting
This commit is contained in:
parent
81c5f44c0f
commit
2d41e2eceb
1 changed files with 3 additions and 0 deletions
|
@ -90,6 +90,9 @@ def _call_api(self, path, video_id, query={}):
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw',
|
'Authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw',
|
||||||
}
|
}
|
||||||
|
token = self._get_cookies(self._API_BASE).get('ct0')
|
||||||
|
if token:
|
||||||
|
headers['x-csrf-token'] = token.value
|
||||||
if not self._GUEST_TOKEN:
|
if not self._GUEST_TOKEN:
|
||||||
self._GUEST_TOKEN = self._download_json(
|
self._GUEST_TOKEN = self._download_json(
|
||||||
self._API_BASE + 'guest/activate.json', video_id,
|
self._API_BASE + 'guest/activate.json', video_id,
|
||||||
|
|
Loading…
Reference in a new issue