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] Feature request, force download. #11357

Closed
zillionn opened this issue Dec 3, 2016 · 1 comment
Closed

[YouTube] Feature request, force download. #11357

zillionn opened this issue Dec 3, 2016 · 1 comment

Comments

@zillionn
Copy link

@zillionn zillionn commented Dec 3, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.12.01. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.12.01

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

First of all thank you for your hard work making this software so good!

So, let's get straight to the point. What I need is an URL to the YouTube video that will force the browser to download it with a custom name, not playing it, so the user will be able to download the video with one click. Let's say I have this URL:
https://www.youtube.com/watch?v=pSqeQlnOhJQ

Running the following command I get the URL to the best mp4 video:

youtube-dl --skip-download -g -f mp4 https://www.youtube.com/watch?v=pSqeQlnOhJQ

Which looks something like this:
https://r4---sn-ab5l6nzd.googlevideo.com/videoplayback?mt=1480783546&expire=1480805390&nh=IgpwcjA2LmxnYTA3KgkxMjcuMC4wLjE&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&clen=20832787&requiressl=yes&ratebypass=yes&ipbits=0&itag=18&upn=w2HNKIqTxpQ&lmt=1428137939371231&gcr=us&mv=u&ei=rvdCWMKLDoGD8wSil5aYCQ&id=o-AOzRUsXVe3m6sOS4bm6IJalJG2EBfGkD0YfmokiOa6UT&ms=au&source=youtube&pl=20&dur=392.556&key=yt6&ip=X.X.X.X&gir=yes&mm=31&mn=sn-ab5l6nzd&mime=video%2Fmp4&signature=76982B58B469AC887AECEDE95D11D38A43BDEFA8.7218B84E1E8F8DB00BEA6F29A03BD1F4795E0CD1

Opening that URL on a different machines is returning 403 Forbidden, but we could use "redirector.googlevideo.com" to fix this. So the new video URL will be:
https://redirector.googlevideo.com/videoplayback?mt=1480783546&expire=1480805390&nh=IgpwcjA2LmxnYTA3KgkxMjcuMC4wLjE&sparams=clen%2Cdur%2Cei%2Cgcr%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&clen=20832787&requiressl=yes&ratebypass=yes&ipbits=0&itag=18&upn=w2HNKIqTxpQ&lmt=1428137939371231&gcr=us&mv=u&ei=rvdCWMKLDoGD8wSil5aYCQ&id=o-AOzRUsXVe3m6sOS4bm6IJalJG2EBfGkD0YfmokiOa6UT&ms=au&source=youtube&pl=20&dur=392.556&key=yt6&ip=X.X.X.X&gir=yes&mm=31&mn=sn-ab5l6nzd&mime=video%2Fmp4&signature=76982B58B469AC887AECEDE95D11D38A43BDEFA8.7218B84E1E8F8DB00BEA6F29A03BD1F4795E0CD1

Which plays fine on different machines, but I need an URL that will force the browser to download the video. I found out that adding "&title=" at the end of the URL changes the filename but doesn't force download it. And I know it is possible because I'm using one site that generates exactly the URL I need. For instance, this URL will force the browser to download the video with filename "Test 123.mp4":
http://redirector.googlevideo.com/videoplayback?ratebypass=yes&mime=video%2Fmp4&ipbits=0&mm=31&mn=sn-5hne6nlr&itag=18&dur=392.556&mt=1480781984&mv=m&ms=au&ip=X.X.X.X&lmt=1428137939371231&gcr=it&id=o-AHYW4_sjmE7BnsIRkMtHQhxU_k9lVrPaozJhsLbFxjO5&expire=1480803893&upn=b-WaaAQcc34&nh=IgpwZjAxLmFtczE1Kg4xNDkuMTQuMTQyLjEwNQ&key=yt6&pl=24&sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Cratebypass%2Csource%2Cupn%2Cexpire&source=youtube&initcwndbps=2930000&signature=B02CBC1C64A130E7F00F4297F79137A4C4332B62.73E09C5AD4B31FD2B6AE291F99AE0A73F6CBFE0A&title=Test%20123

I see that some params are missing from this URL, but if I try to remove them from the URL that youtube-dl is generating, I'm again getting 403 Forbidden.

Thank you for your help.

@zillionn zillionn changed the title [YouTube] Feature request, direct download link. [YouTube] Feature request, force download. Dec 3, 2016
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 3, 2016

Out of scope of youtube-dl.

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
2 participants
You can’t perform that action at this time.