-
-
Notifications
You must be signed in to change notification settings - Fork 991
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
Error downloading user videos from Twitter while providing profile link #452
Comments
See #352. Downloading Twitter videos with youtube-dl while being logged in doesn't work at the moment, but you can disable forwading cookies to youtube-dl and it will work again, although I'm not sure if you can download private videos like that. edit: you should put console logs in triple backticks to make them more readable: ``` |
Thanks, your tip has fixed downloading public videos but not private videos, as you suspected. I did a bit of research and found that private videos don't need authentication to download, it just needs to get the url. The log below is an attempt to download a private video, apparently gallery-dl is unable to extract the url. And if it is not gallery-dl's job to extract direct video links to youtube-dl, could you consider an option to extract them and use ffmpeg instead?
|
Extracting and downloading video streams can be rather complicated, hence youtube-dl gets used for it here. Maybe I'll look into it, but I'd rather wait for youtube-dl to fix their code. ... And I just realized that gallery-dl suffers from the same problem as youtube-dl when it comes to individual Tweets: Requesting a Tweet page while being logged in would get it in the new layout, so gallery-dl clears its cookies (and authentication data) before accessing that Tweet, since it currently only supports the old Twitter interface. |
Changing your user agent to "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" forces the old layout, it's what I've been using ever since twitter changed it. Maybe you could make it use this user agent anytime you use authentication? |
... for individual tweets. To get a Tweet page with the old Twitter layout, an Internet Explorer User-Agent (e.g. Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko) as well as a Referer header pointing to the page itself is required. The "app_shell_visited" cookie appears to be optional at the moment, but that is what a regular web browser would send.
Thank you @alice945. Setting a user agent alone wasn't enough to convince Twitter to revert to its old layout, but it got me looking in the "right" direction. (See 2eb3881) The "only" problem now is getting youtube-dl to do the same when extracting a video stream from a Twitter page, but as far as I can tell that's impossible. The only way appears to be updating youtube-dl's code and opening a pull request there, but I'd rather do what @KaMyKaSii suggested and look into getting the video information without youtube-dl. |
This should allow video downloads when logged in without 'forward-cookies' disabled and from protected tweets. youtube-dl still gets used to download HLS playlists, but the data extraction part, which doesn't work with youtube-dl at the moment, now gets handled by gallery-dl itself.
OK, I've managed to implement video extraction (49a6b1b). It worked for me with and without being logged in, but I don't have access to any protected account so I couldn't test that. |
|
Mike your work with gallery-dl is just impressive! And very appreciated!
|
The download is successful with individual video links (but saved in an "i" folder rather than one with the correct username). Apparently it's a problem of youtube-dl itself, I'm not sure if it will be possible for you to find a solution
The text was updated successfully, but these errors were encountered: