-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
when youtube-dl sends too many dns request to find video quality, dns server blocks the host running youtube-dl temporarily #13734
Comments
Which URL are you trying to download? Please paste a verbose log. |
its not the URL i'm trying to download that is blocking me, it is my DNS server that blocks me when there are too many DNS requests happening when youtube-dl is running and trying to guess a quality for the video its downloading. |
Fix your DNS server obviously. youtube-dl is not any different from any other software in making DNS requests. |
is it possible to make youtube-dl retain the answers for the DNS queries it makes for a short period of time 4 to 10 seconds? |
That's a system-level work, where upper applications like youtube-dl or even Python can't do much. By the way, you may want to check out my proof-of-concept patch yan12125@0cdc798 that adds an option |
a better solution would be to add support for HTTP persistent connection(HTTP keep-alive), it would help to improve performance in general and mostly for http/https fragment downloading. |
Persistent HTTP sounds better, but seems it's not going to be implemented in CPython in near future (http://bugs.python.org/issue9740) |
|
That's a great suggestion. However, the culture in youtube-dl is reducing external dependencies unless there's a BIG problem. I vote for changing it if there's going to be a discussion. |
it doesn't have to be a hard dependency, it can be used as an optional dependecy by creating a wrapper that will use urllib3 if it's available and fallback to urllib/urllib2(like what's been done with pycrypto). |
I'm afraid that co-existing of two backends would make codes extremely complicated and unreadable. If it turns out that switching between urllib/urllib2 and urllib3 is easy (ex: without numerous function wrappers), that would be a good choice. |
there is actually an old approche compatible with urllib/urllib2 by using a diffrent handler, but as the code is old, so it might require to be updated, it was used by urlgrabber before switching to pycurl(https://stackoverflow.com/questions/1037406/python-urllib2-with-keep-alive). |
IMO it's better to use mature libraries like requests/urllib3 instead of importing rarely tested codes from random places. Also, using only urllib3 is better than supporting two backends. I hope the culture here can change one day. About the license issue:
|
Adds support for HTTPS proxies and persistent connections (keep-alive) Closes #1890 Resolves #4070 Resolves ytdl-org/youtube-dl#32549 Resolves ytdl-org/youtube-dl#14523 Resolves ytdl-org/youtube-dl#13734 Authored by: coletdjnz, Grub4K, bashonly
Adds support for HTTPS proxies and persistent connections (keep-alive) Closes yt-dlp#1890 Resolves yt-dlp#4070 Resolves ytdl-org/youtube-dl#32549 Resolves ytdl-org/youtube-dl#14523 Resolves ytdl-org/youtube-dl#13734 Authored by: coletdjnz, Grub4K, bashonly
The issue at hand is that when youtube-dl is trying more than one quality paramter on its own, it keeps making DNS-requests, because those requests became too many in a short span of time, the host running youtube-dl gets any DNS requests from it blocked.
please look into it.
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2017.07.23. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
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 ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
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.
The text was updated successfully, but these errors were encountered: