Comments (12)
If you’re using peerlix I suggest switching to the fork webtorrent-cli. No idea how, but it’s many times faster than any other torrent client for me. mpv-peerlix-hook should use it too, IMO.
Anyway, with webtorrent-cli --mpv
the filename
is set to the actual filename of the file being streamed, while directory
appears to be unset. Therefore, for autosub.lua
to work you have to set the relevant subliminal argument to a directory on your filesystem and pass that to the mpv option sub-file-paths
. The script works perfectly with torrent streams that way.
from mpv-autosub.
If you’re using peerlix I suggest switching to the fork webtorrent-cli. No idea how, but it’s many times faster than any other torrent client for me. mpv-peerlix-hook should use it too, IMO.
Thanks for saving me from peerflix. I've created an initial script for using it: webtorrent-peerflix-hook. It was a lot easier to write than the peerflix version (still needs work though).
from mpv-autosub.
to test:
mpv --force-media-title="the lighthouse 2019" 'magnet:?xt=urn:btih:B764661DE937E0463C9B7CD39EE10F949E507F8D&tr=http%3A%2F%2Fbt4.t-ru.org%2Fann%3Fmagnet&dn=%D0%9C%D0%B0%D1%8F%D0%BA%20%2F%20The%20Lighthouse%20(%D0%A0%D0%BE%D0%B1%D0%B5%D1%80%D1%82%20%D0%AD%D0%B3%D0%B3%D0%B5%D1%80%D1%81%20%2F%20Robert%20Eggers)%20%5B2019%2C%20%D0%A1%D0%A8%D0%90%2C%20%D1%83%D0%B6%D0%B0%D1%81%D1%8B%2C%20%D1%84%D1%8D%D0%BD%D1%82%D0%B5%D0%B7%D0%B8%2C%20%D0%B4%D1%80%D0%B0%D0%BC%D0%B0%2C%20%D0%B4%D0%B5%D1%82%D0%B5%D0%BA%D1%82%D0%B8%D0%B2%2C%20WEB-DLRip%5D%20MVO%20(HDRezka%20Studio)'
set local settings = {... remove_files = false ...}
in mpv-peerflix-hook
to not have to wait everytime while testing 😊.
from mpv-autosub.
Yeah, I can't change path
for a video, so either mpv would have to allow that or this plugin would need to also look at the media title.
from mpv-autosub.
The problem is that autosub is not intended to be used with the command line. Most users will simply start playback from a file explorer, so requiring them to set the media-title from the command line is a no-go.
I'm not familiar with peerflix or the torrenting use case, so let me know if there's anything I can do to help.
from mpv-autosub.
so requiring them to set the media-title from the command line is a no-go.
That would not be a requirement in the least, but rather a plus. You may stream a normal URL (by drag and drop) and the file name would be in Russian or complete gibberish, and subliminal
would not be able to retrieve correct subs. so, you're forced to change the name (this happens to me all the time).
so let me know if there's anything I can do to help.
The idea is to fall back to the file title (or prioritize it, if it exists, through configuration), as opposed to the file name (as it is defined in its path). namely this https://mpv.io/manual/master/#options-force-media-title.
I'm sure @noctuid would know the right Lua API to retrieve --force-media-title
.
$ mpv 'http://domain.stream/film/Маяк.2019.mkv'
# subliminal searches for english subtitles for Маяк.2019.mkv; fails.
$ mpv --force-media-title='the lighthouse (2019)' 'http://domain.stream/film/Маяк.2019.mkv'
# subliminal searches for english subtitles for the lighthouse (2019); successes.
from mpv-autosub.
Yeah, retrieving it is trivial: the media-title
property.
I remember using it at some point, but then reverting it because it didn't work in all cases ...
from mpv-autosub.
Yes, it does not always exist using some protocols.
can its existence be checked and thus loaded conditionally?
from mpv-autosub.
If it does not exist it uses the filename instead: see https://mpv.io/manual/master/#command-interface-media-title.
I just checked the reverting commit, and it seems the reason was because the subtitle filename is then saved as the media-title, which prevents the subtitles from being picked up by MPV. Subliminal unfortunately does not have an option to set a custom subtitle filename.
from mpv-autosub.
Can Lua's OS package or something intervene? or since it's a bit of an edge case, force load subtitles to mpv
each time until a more ideal solution is found? I'll happily open an issue about this in subliminal
, but development seems a bit slow.
from mpv-autosub.
I guess it might be possible to do a check if media-title == filename, and if not to force load the media-title subtitles.
from mpv-autosub.
Checking if there are subs with the same name as the media-title
and load that to not have to download each time is a last resort.
from mpv-autosub.
Related Issues (20)
- Wrong subtitles downloaded
- Portuguese Brazil subtitles HOT 2
- disabling my subtitle HOT 1
- Unable to download brazilian portuguese subtitles. HOT 1
- Adding subscene.com as a sub provider HOT 2
- Issue with Ubuntu 21.10 HOT 2
- Feature request: Allow downloading multiple languages HOT 1
- flatpak installation notes
- Add it mplug script directory
- No subtitles were found HOT 4
- can't override subtitle track with local mpv.conf
- not work at all HOT 1
- No subtitles were found for arabic subtitle HOT 1
- need foreign only translated to english HOT 1
- Help with Installation HOT 1
- Question: how to add more languages and keys to favorites? HOT 1
- change directory HOT 1
- Autosub fails to find subtitles when playing videos from URL in MPV, but succeeds when playing downloaded files
- Allow ~ or $HOME for file paths
- No longer seems to work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpv-autosub.