Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Why is youtube-dl so slow to get urls compared to alternatives? #13122
Comments
|
Here's what happened on my machine:
There are two factors that affect running time:
From your description most likely 1. is the key factor. There are some ways to make it faster - use the experimental lazy extractor feature (#8497), or create an API server like https://youtube-dl-api-server.readthedocs.io/en/latest/ |
|
@yan12125 Thanks for the response I do appreciate it! So I just tested out What are the benefits of creating this API server? They don't seem to have an about on their page explaining why anyone would want to use it. Will installing it help me get my ideal: under 1 second timespan? Also with the lazy extractor: will the usual |
|
From your descriptions I guess startup time is a primary factor. An API server needs to be started only once so the average running time can be reduced.
The lazy-extractor variant is still considered experimental and not included in official releases, so you'll need to repeat those steps for each new version. |
|
try the -4 option to force ipv4 |
|
<edited by @yan12125: SPAM> |
I'm using
--skip-downloadand still it takes an average of 5 seconds to get urls (youtube, soundcloud etc..)Here's the command I'm using:
time youtube-dl --ignore-config --ignore-errors --skip-download --geo-bypass --youtube-skip-dash-manifest --write-info-json --restrict-filenames --max-downloads 1 --format "worst" --output "%(autonumber)s" "https://www.youtube.com/watch?v=NF9aJoxqBxo"Output:
After this line shows up:
[youtube] NF9aJoxqBxo: Downloading webpagethe rest happens almost instantly. What's happening before this point (nothing is shown in the console)?I downloaded an alternative I found on github built specifically for PHP (https://github.com/Athlon1600/youtube-downloader) and it takes an average of 0.2 seconds to get the urls... (It doesn't get the info which is unfortunate but even manually doing that myself only adds an extra 0.2 seconds - could even do a multi curl and get it all done in the original 0.2 seconds).
5 seconds compared to 0.2 is a huge difference
Is there anything I can do to improve the speed or is this as good as it gets? :(