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

[Feature Request] Allow use of an external downloader for getting video info/subtitles/thumbnails/etc. #20398

Closed
jcjordyn130 opened this issue Mar 18, 2019 · 4 comments

Comments

@jcjordyn130
Copy link

@jcjordyn130 jcjordyn130 commented Mar 18, 2019

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 this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.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 2019.03.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

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.

Downloading all of the subtitles opens a connection, downloads the info, closes the connection, and repeats. On certain networks (mostly just high latency ones) this causes it to go slower than it otherwise would because it's opening all those connections. I propose that youtube-dl uses the --external-downloader command line argument if given to download videos instead of the internal downloader. This would allow the use of an external downloader that caches the connections to bypass a lot of the latency.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 18, 2019

Does any of the supported external downloaders even supports connection caching between executions? I doubt that. Also such TCP connection reuse may bring observable benefit only when there are lots sequential connections to the same host that is not usually the case for downloading non-media data. Times taking external downloader process to start also should be counted and may easily outperform any speedup of connection reuse. Needless to say this will unnecessarily complicate code.
So the bottom line is: this will barely have any positive effect.

@dstftw dstftw closed this Mar 18, 2019
@jcjordyn130
Copy link
Author

@jcjordyn130 jcjordyn130 commented Mar 18, 2019

The only case where this would be (really) useful is for getting all subtitle languages, on a platform like YouTube this can easily reach the hundreds (YouTube supports around 107 languages). On the network I'm on it takes 2 seconds per subtitle to download (high latency high bandwidth). it only takes 0.219s to start python3 and import urllib3. So if I download all subtitle languages it's 214 seconds of total download time vs 23.433 seconds of starting overhead. If you are just downloading a video or two this is barely anything, but on a big playlist or a whole channel it adds up. The two ways this can be implemented are modifying --external-downloader to accept arbitrary commands or modify the internal downloader to use urllib3.HTTPConnectionPool.

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Mar 18, 2019

Does any of the supported external downloaders even supports connection caching between executions? [...]

Not between executions, but during the same execution I know wget does.

@jcjordyn130
Copy link
Author

@jcjordyn130 jcjordyn130 commented Sep 15, 2019

Update: I found out that it was the DNS server being slow that caused the slowness in downloading.

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.