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

Using a vpn, youtube-dl become pretty long to get the video url #4413

Open
mac1202 opened this issue Dec 8, 2014 · 14 comments
Open

Using a vpn, youtube-dl become pretty long to get the video url #4413

mac1202 opened this issue Dec 8, 2014 · 14 comments

Comments

@mac1202
Copy link

@mac1202 mac1202 commented Dec 8, 2014

Hi i noticed when using a vpn youtube-dl need a lot more time to find a video url. For example this url https://www.facebook.com/video.php?v=1013279448695114 3 sec to get url without vpn more than 15 s with it. Even worse on youtube for example http://youtu.be/NLD-lqpPtEU take 38 s with vpn against 2 s without it.
When i enable verbose output i notice that youtube stay stuck after the [debug] Proxy map: {} message.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 10, 2014

I guess that's normal, for example when using a proxy or tor it takes more time, because you depend on the other computer internet connection (it may have other users connected and/or a slower connection) and the data also needs to travel from the proxy to your computer.

Probably, using a browser will also be slower, isn't it?

@mac1202
Copy link
Author

@mac1202 mac1202 commented Dec 10, 2014

Actually i use a vpn because my ISP slowdown youtube on purpose so with my isp i can't even watch a 360P video bacause constant buffering, with a vpn i can watch 720P video without buffering.

@incorpusyehtee
Copy link

@incorpusyehtee incorpusyehtee commented Dec 11, 2014

Speed and latency aren't always related. Trying pining youtube.com, running a traceroute with and without a VPN and see if there's some kind of network delay purely in establishing the connection, but otherwise it's fast.

Alternatively, it may be some weird peering/CDN issue with your VPN provider's upstream and Facebook.

@Overand
Copy link

@Overand Overand commented Dec 19, 2014

Don't forget DNS - see how quickly you resolve the DNS name of www.youtube.com (and also, potentially, the youtube CDNs)

do dig www.youytube.com (if you have dig installed) and see what the domain resolution time is like. Also, try alternate DNS servers! (8.8.8.8 and 8.8.4.44 are google's, and they're pretty reliable. Though if your ISP intercepts DNS requests, you might need to tunnel them, and if you want to keep your URLs 'private' then you definitely need to tunnel your DNS traffic)

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 19, 2014

I'm closing this issue, since I think this is not a problem in youtube-dl.

You may also want to check how much time curl (or wget) takes to download the webpage: curl "https://www.facebook.com/video.php?v=1013279448695114". If it's much faster than youtube-dl, then we should investigate it.

@jaimeMF jaimeMF closed this Dec 19, 2014
@mac1202
Copy link
Author

@mac1202 mac1202 commented Dec 19, 2014

I do some more testing comparing youtube-dl and cclive
without vpn :
time cclive "https://www.youtube.com/watch?v=DXCsiSfg-ms"
Checking ... .. .. ..done.
My cat is crazy.mp4 2.18M [video/mp4]
[#################################################################################################] 100% 2.2Mi 742.5Ki/s 00:00:03
cclive "https://www.youtube.com/watch?v=DXCsiSfg-ms" 0,12s user 0,09s system 4% cpu 4,590 total

time youtube-dl "https://www.youtube.com/watch?v=DXCsiSfg-ms"
[youtube] DXCsiSfg-ms: Downloading webpage
[youtube] DXCsiSfg-ms: Extracting video information
[youtube] DXCsiSfg-ms: Downloading DASH manifest
[download] Destination: My cat is crazy-DXCsiSfg-ms.mp4
[download] 100% of 2.18MiB in 00:03
youtube-dl "https://www.youtube.com/watch?v=DXCsiSfg-ms" 0,64s user 0,09s system 13% cpu 5,462 total

with vpn :
time cclive "https://www.youtube.com/watch?v=DXCsiSfg-ms"
Checking ... .. .. ..done.
My cat is crazy.mp4 2.18M [video/mp4]
[#################################################################################################] 100% 2.2Mi 556.9Ki/s 00:00:04
cclive "https://www.youtube.com/watch?v=DXCsiSfg-ms" 0,12s user 0,10s system 4% cpu 5,346 total

time youtube-dl "https://www.youtube.com/watch?v=DXCsiSfg-ms"
[youtube] DXCsiSfg-ms: Downloading webpage
[youtube] DXCsiSfg-ms: Extracting video information
[youtube] DXCsiSfg-ms: Downloading DASH manifest
[download] Destination: My cat is crazy-DXCsiSfg-ms.mp4
[download] 100% of 2.18MiB in 00:03
youtube-dl "https://www.youtube.com/watch?v=DXCsiSfg-ms" 0,88s user 0,06s system 1% cpu 50,699 total

As you can see with cclive vpn doesnt change anything : 4,590 second vs 5,346 second
but with youtube-dl the difference is huge : 5,462 second vs 50,699 second

@incorpusyehtee
Copy link

@incorpusyehtee incorpusyehtee commented Dec 19, 2014

Does clive/cclive support multi-threaded downloading? I could reasonably see your VPN having an effect on the speed of download threads.

Perhaps your ISP has its own YouTube caching servers (as mine does) which hijack your DNS resolution to youtube's content. When someone on my ISP downloads from YouTube, they go to the ISPs' YouTube servers rather than Google's YouTube servers. If clive has hard coded information about Google's servers, and youtube-dl goes off the DNS cache (built pre-VPN) this could cause these results.

@mac1202
Copy link
Author

@mac1202 mac1202 commented Dec 19, 2014

I dont know about cclive i just use it for the purpose of this test.
About my dns i use dsnmasq with the openNIC dns server.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 21, 2014

As far as I know cclive (which uses libquvi) only does one request for getting the video info, but I don't know if that causes the big difference. Are you sure that cclive is using the VPN in the second run?

@jaimeMF jaimeMF reopened this Dec 21, 2014
@mac1202
Copy link
Author

@mac1202 mac1202 commented Dec 21, 2014

yeah i was connected to my vpn thought networkmanager openvpn plugin when i did the test.

@qzio
Copy link

@qzio qzio commented Feb 2, 2015

I have the same issue I think.
When I do a ping or mtr, I see nothing wrong or packet loss etc.
I have no problem using the youtube.com website, no delays, no bufferings it's "snappy" etc.

But when using youtube-dl, it just.. nothing happens for like 5 minutes after the

[youtube] Setting language

output is displayed (using -v)
and a couple of minutes for the next few lines with output, and then the download starts at 2MiB/s

I would be glad to debug this further to track down what's causing the slowness; Any pointers on where to start?

@phihag
Copy link
Contributor

@phihag phihag commented Feb 2, 2015

@qzio But that's a completely different issue! @mac1202 is seeing some slowdown, you are seeing a really large timeout. Please open a new issue entry. In that new issue, please include the full output you get with -v in the following cases:

  • just add -v
  • add -v -4
  • add -v -C
  • add -v --socket-timeout 2

In all cases, feel free to cancel with Ctrl+C after, say, 15 seconds. Thanks!

@mac1202
Copy link
Author

@mac1202 mac1202 commented Feb 2, 2015

It's look like exactely the problem i had. My speed was good with or without vpn, it just youtube-dl get stuck to find the video url with the vpn so it's pretty long. I think the 2 bug report can be merged. By the way i stop using a vpn so i can't help anymore.

@zeyangl
Copy link

@zeyangl zeyangl commented Oct 14, 2015

encountering the same issue here.
My VPN server to youtube is about 1M/s, tested using youtube-dl on my VPN server.
My client to VPN server is about 500-800kb/s, tested by scp a big file from VPN server to my client.
Only when I use youtube-dl, speed is about 50kb/s
This is really weird. I get 10x speed by youtube-dl on my VPN server then scp to my client.
I use PPTP.

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