diff --git a/yt_dlp/extractor/twitter.py b/yt_dlp/extractor/twitter.py index 8565a7c46b..8ccc38e242 100644 --- a/yt_dlp/extractor/twitter.py +++ b/yt_dlp/extractor/twitter.py @@ -90,6 +90,9 @@ class TwitterBaseIE(InfoExtractor): headers = { '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: self._GUEST_TOKEN = self._download_json( self._API_BASE + 'guest/activate.json', video_id,