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

Toggle to allow youtube-dl to fully cache the entire video before playing with mpv #32

Open
illumilore opened this issue Jan 29, 2017 · 3 comments

Comments

@illumilore
Copy link

For those who have a sometimes slow/unreliable internet connection, streaming is not a good choice. An option to allow youtube-dl to download/cache the entire video before opening it with mpv would be nice.

@x0b
Copy link

x0b commented Feb 15, 2017

Suppporting this use case is difficult because the addon does not know the state of the video cache nor can control the process after the parameters have been passed to mpv (and then subsequently to youtube-dl).

However, mpv uses youtube-dl just to retrieve video/audio/subtitle urls and then retrieves and caches the video file before playing it.

Looking into the mpv player documentation, cache size and duration can be controlled.
For example, to cache up to 1GB of data, you can use --cache-default 1048576.

mpv will still start play, but when paused the cache is still filed up to the specified size or duration. It might be fixable using a script though.

@illumilore
Copy link
Author

Does there need to be a cache? If it just launches the command like "youtube-dl videourl -o /tmp/filename && mpv --pause filename" then mpv wouldn't even start until the video was downloaded, avoiding needing to know about any cache.

@x0b
Copy link

x0b commented Feb 16, 2017

Well, if someone primarily wants to watch a video the cache should be sufficient. For downloading youtube videos there are other addons with more/better functionality for that task.

However, you could always change the path to a shell and use a shell script if you actually need to download (and keep) the video file. This could introduce command injection issues and I'm not sure how well firefox's own nsIProcess protects against that.

Implementing this functionality directly into the addon is probably doable, but i'd suggest to use youtube-dl's --execa parameter. On Windows, && does not work with nsIProcess.

Someone would still have to implement that change and create a pr - provided that @antoniy accepts it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants