-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't download twitter videos from private accounts #27643
Comments
The line where it crashes is here: youtube-dl/youtube_dl/extractor/common.py Line 632 in 19ec468
|
Want to add that this isn't a problem directly related to downloading from a private account. Any attempt to pass --cookies alongside a twitter url (even public accounts) causes this error. I don't really have enough of a grasp of the youtube-dl implementation of cookies to understand why this is happening exactly but thought I'd mention what I'd discovered for anyone else to have a look at |
I'm going to look more into this over the weekend, but I can tell you the first 403 is because the tool is including cookies in the request to https://api.twitter.com/1.1/guest/activate.json; removing them makes the request for a guest token succeed, but the next request fails due to lack of a csrf token (that could be me though, will add more cookies to my jar and retry). EDIT: the root cause is the missing CSRF token - if you include the auth_token and ct0 cookies, and copy the ct0 cookie into an x-csrf-token header, you can download videos from private accounts. EDIT 2: As a workaround, you could call the tool like so: |
Closes #2762, ytdl-org/youtube-dl#27643 Authored by: iphoting
Checklist
I've read bugs section in FAQ
I'm reporting a broken site support issue
I've verified that I'm running youtube-dl version 2021.01.03
I've checked that all provided URLs are alive and playable in a browser
I've checked that all URLs and arguments with special characters are properly quoted or escaped
I've searched the bugtracker for similar bug reports including closed ones
Verbose log
Description
youtube-dl is unable to download videos from private twitter accounts. I can't provide a twitter account, but you can easily reproduce the same issue by trying to download any video from any private twitter account you follow. I put all twitter.com cookies in cookies.txt(which includes so-called the "guest token"), but that did not help.
The text was updated successfully, but these errors were encountered: