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

Any ideas on how to preload youtube-dl into RAM to save on disk i/o? #15870

Closed
TheBoroer opened this issue Mar 14, 2018 · 2 comments
Closed

Any ideas on how to preload youtube-dl into RAM to save on disk i/o? #15870

TheBoroer opened this issue Mar 14, 2018 · 2 comments

Comments

@TheBoroer
Copy link

@TheBoroer TheBoroer commented Mar 14, 2018

Make sure you are using the latest version

  • I've verified and I assure that I'm running youtube-dl 2018.03.10

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

When running multiple youtube-dl instances with a long queue of video, I'm noticing a lot of disk I/O and high CPU usage when using the -J argument to get JSON for a youtube video.

I'm pretty sure it's because of all the modules that have to be loaded every time the script runs. I'm thinking of ways to wrap youtube-dl in another python script that initializes it only once (and stores it all in RAM so when it needs to run again everything is already preloaded and ready to go). I feel like this could also speed up youtube-dl execution time greatly.

Does anyone have any suggestions on linux tools/commands or other scripts that can help me do this? I would hate to be re-inventing the wheel if I didn't have to 😋

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 14, 2018

Just pass this long queue of videos as list of URLs to single youtube-dl instance so that modules will be loaded only once. Alternatively you can implement a simple daemon like https://github.com/jaimeMF/youtube-dl-api-server.

@dstftw dstftw closed this Mar 14, 2018
@TheBoroer
Copy link
Author

@TheBoroer TheBoroer commented Mar 14, 2018

@dstftw
Passing a long queue of videos as a list of urls isn't possible because the videos are getting added on the fly (not at the time I launch the first youtube-dl instance). Thanks for the daemon suggestion! I'll look into that 👍

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.