Skip to content
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

youtube-dl get-url videoplayback.mp4 not videotitle.mp4 #13325

Closed
AdnanHussainTurki opened this issue Jun 9, 2017 · 7 comments
Closed

youtube-dl get-url videoplayback.mp4 not videotitle.mp4 #13325

AdnanHussainTurki opened this issue Jun 9, 2017 · 7 comments
Labels

Comments

@AdnanHussainTurki
Copy link

@AdnanHussainTurki AdnanHussainTurki commented Jun 9, 2017

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 9, 2017

YouTube servers do not specify a filename, so the last part in the path (videoplayback) will be used as the filename. If you want an alternative filename, you'll need to specify it manually.

@yan12125 yan12125 closed this Jun 9, 2017
@abou7mied
Copy link

@abou7mied abou7mied commented Jun 14, 2017

@AdnanHussainTurki did you find any workaround for this issue?

@AdnanHussainTurki
Copy link
Author

@AdnanHussainTurki AdnanHussainTurki commented Jun 14, 2017

Actually, I got the solution.

@abou7mied
Copy link

@abou7mied abou7mied commented Jun 14, 2017

@yan12125
After some testing using this tool and online tools.
The other tools adds query to the url &title=video_title
Then the response headers contains
content-disposition: attachment; filename="video_title.mp4"
Then the browser start download the file with the name video_title.mp4

But even If I added title query to links got by youtube-dl , server doesn't respond with content-disposition header
I noticed the links got by youtube-dl has two extra Query in url &gir=yes&clen=xxxxxx
When I removed these two queries, link didn't work because the it has a signature

@abou7mied
Copy link

@abou7mied abou7mied commented Jun 14, 2017

@AdnanHussainTurki how? 😀

@AdnanHussainTurki
Copy link
Author

@AdnanHussainTurki AdnanHussainTurki commented Jun 14, 2017

@abou7mied
Actually, the link provided by youtube-dl is of type
https://something.googlevideo.com/videoplayback?....

this kind of link does not support the explicit additional of parameters like your title one.

for adding and resolving this issue, you need to encourage google to add a legit title parameter for you in the url.

For doing so, you need to replace https://something.googlevideo.com/ of the url by https://redirector.googlevideo.com/ and then add title parameter.

For example:
youtube-dl URL:
https://r2---sn-a5mekner.googlevideo.com/videoplayback?initcwndbps=626250&key=yt6&id=o-AD2L6YrCgNPRWYyhZJ6vlHVPzf8zu1Iw-jffCUvlMaiu&source=youtube&dur=11402.274&ip=167.114.210.100&lmt=1470910187958312&itag=22&requiressl=yes&pl=25&mv=m&mt=1497420514&ms=au&ratebypass=yes&ei=SNNAWfnsI4We8wT9iaG4Bw&ipbits=0&signature=95D2D7F20D0B18422D5A43F5447C2CE28137FD79.1A5B37B79C2F6C9EFE259A6F4FF5A15BF258B778&expire=1497442216&mime=video%2Fmp4&mn=sn-5uh5o-f5fz&mm=31&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire

tweaked URL:
https://redirector.googlevideo.com/videoplayback?initcwndbps=626250&key=yt6&id=o-AD2L6YrCgNPRWYyhZJ6vlHVPzf8zu1Iw-jffCUvlMaiu&source=youtube&dur=11402.274&ip=167.114.210.100&lmt=1470910187958312&itag=22&requiressl=yes&pl=25&mv=m&mt=1497420514&ms=au&ratebypass=yes&ei=SNNAWfnsI4We8wT9iaG4Bw&ipbits=0&signature=95D2D7F20D0B18422D5A43F5447C2CE28137FD79.1A5B37B79C2F6C9EFE259A6F4FF5A15BF258B778&expire=1497442216&mime=video%2Fmp4&mn=sn-5uh5o-f5fz&mm=31&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&title=The%20Secret%20of%20the%20Seven%20Sisters-Rebaz%20Zedbagi%20[DLYouTube.tk]

This is how you can do it.

Moreover, I am going to add a complete series on youtube regarding this at my channel https://www.youtube.com/myPHPnotes, you may check out the whole there.

@AdnanHussainTurki
Copy link
Author

@AdnanHussainTurki AdnanHussainTurki commented Jun 14, 2017

Moreover, this thing works only on bestvideo format. For others, you need to use url_encode etc things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.