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 in Ubuntu 14.04 return redirect link, not original video link #11777

Closed
acorn421 opened this issue Jan 19, 2017 · 3 comments
Closed

Youtube-dl in Ubuntu 14.04 return redirect link, not original video link #11777

acorn421 opened this issue Jan 19, 2017 · 3 comments

Comments

@acorn421
Copy link

@acorn421 acorn421 commented Jan 19, 2017

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 2017.01.18. 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 2017.01.18

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[Ubuntu 14.04]
$ youtube-dl -g https://www.youtube.com/watch?v=-Sl8zi1ISdw -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-g', u'https://www.youtube.com/watch?v=-Sl8zi1ISdw', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.18
[debug] Python version 2.7.6 - Linux-3.13.0-74-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {}
https://r5---sn-ogueln7k.googlevideo.com/videoplayback?id=f9297cce2d4849dc&itag=248&source=youtube&requiressl=yes&mv=u&mn=sn-ogueln7k&mm=31&pl=16&ms=au&nh=IgpwcjAzLm5ydDE5KgkxMjcuMC4wLjE&ratebypass=yes&mime=video/webm&gir=yes&clen=69865286&lmt=1476762069197443&dur=241.583&signature=46753D9BFEF1BD8B0233E30452A7EB352437DE06.0EBB7BF9F6643246B3783E175CC823069DD387D1&mt=1484812962&key=dg_yt0&upn=zWYblsaiNak&ip=52.78.47.81&ipbits=0&expire=1484834626&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,mn,mm,pl,ms,nh,ratebypass,mime,gir,clen,lmt,dur
https://r5---sn-ogueln7k.googlevideo.com/videoplayback?id=f9297cce2d4849dc&itag=251&source=youtube&requiressl=yes&mv=u&mn=sn-ogueln7k&mm=31&pl=16&ms=au&nh=IgpwcjAzLm5ydDE5KgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/webm&gir=yes&clen=3904190&lmt=1476761860096521&dur=241.641&signature=0D14BD2832CC9F43E9DCBD7C47677B1AB59B089E.6BA858B819E15C3BC42B82CC63BC0949DE08FF31&mt=1484812962&key=dg_yt0&upn=zWYblsaiNak&ip=52.78.47.81&ipbits=0&expire=1484834626&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,mn,mm,pl,ms,nh,ratebypass,mime,gir,clen,lmt,dur

[Mac OS]



Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

I'm using youtube-dl with -g option to play original youtube video in my website.
I made simple server that return original video url.
It's all okay when I test in my local Mac.
However, when I deploy my youtube-dl server to Ubuntu 14.04, It's little bit strange.
I'm using same version of youtube-dl(2017.01.18) and same version of python(2.7.12) in both Mac and Ubuntu, but they give me different url.

The main problem is the url from Ubuntu is not real original video url. It redirects to another video url.(In above case, https://r2---sn-3u-bh2r.googlevideo.com/videoplayback?pl=16&ei=NXSAWLe3KIqJ4gK3l6SIBw&upn=Wgx7FL9FhmU&ipbits=0&requiressl=yes&itag=22&ratebypass=yes&dur=241.696&lmt=1476952144664504&source=youtube&sparams=dur,ei,expire,id,ip,ipbits,ipbypass,itag,lmt,mime,mm,mn,ms,mv,nh,pcm2cms,pl,ratebypass,requiressl,source,upn&key=cms1&mime=video%2Fmp4&expire=1484834965&id=o-AEo6sQA7hwMJULAegASwEhfi2ZdV2gpJELqOXnDuNIzS&signature=5EC2ACF647F1BCA174DD3A9B470B81C91349E363.29E250BFE6C3A7B09E7ACAFBFC4E1C4509D6529F&ip=175.209.23.156&redirect_counter=1&req_id=9deccb23abc7a3ee&cms_redirect=yes&ipbypass=yes&mm=31&mn=sn-3u-bh2r&ms=au&mt=1484813143&mv=m&pcm2cms=yes)
I need real video link because i have to load same video a lot of time. When i load the videos with wrong link, It's became really slow...(I think it's because of browser cache or something..)

Why is it different and can you fix it?
Thanks.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 19, 2017

URLs starting with https://r2---sn-3u-bh2r.googlevideo.com are original links.

When i load the videos with wrong link, It's became really slow...

Most likely that's due to incorrect CDNs. #9001 (comment) may help.

@yan12125 yan12125 closed this Jan 19, 2017
@acorn421
Copy link
Author

@acorn421 acorn421 commented Jan 23, 2017

@yan12125 Thanks for your comment.
However, your suggestion doesn't work in my case.

There is no problem when i use one video tag.
But, with many video tag with same src, it has a problem.

I found that the problem is chrome doesn't cache redirected video, so when I add new video dynamically, chrome unnecessarily requests the same video every time.
It makes my website extremely slow.
In Firefox and Safari, everything is fine.

Also, I found that chrome cache all videos well with direct video link.
I can't get redirect location because of CORS and w3c specification in browser.
So, is there any way to get direct video link for every user in any location from youtube-dl server?
I think it's impossible due to security reasons, but if you have any suggestion please help me.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 23, 2017

I don't quite understand your problems, but I guess that's a Chrome problem rather than YouTube or youtube-dl. In my experience Firefox usually follows w3c standards while Chrome often invent their own standards.

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.