Giter VIP home page Giter VIP logo

Comments (12)

whtv avatar whtv commented on June 30, 2024 2

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.

noctuid avatar noctuid commented on June 30, 2024 1

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.

smhmd avatar smhmd commented on June 30, 2024

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.

noctuid avatar noctuid commented on June 30, 2024

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.

davidde avatar davidde commented on June 30, 2024

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.

smhmd avatar smhmd commented on June 30, 2024

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.

davidde avatar davidde commented on June 30, 2024

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.

smhmd avatar smhmd commented on June 30, 2024

Yes, it does not always exist using some protocols.
can its existence be checked and thus loaded conditionally?

from mpv-autosub.

davidde avatar davidde commented on June 30, 2024

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.

smhmd avatar smhmd commented on June 30, 2024

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.

davidde avatar davidde commented on June 30, 2024

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.

smhmd avatar smhmd commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.