davidde / mpv-autosub

Fully automatic subtitle downloading for the MPV media player
https://mpv.io/
MIT License
295 stars 42 forks source link

Alternative Subtitle #9

Closed mortyobnoxious closed 4 years ago

mortyobnoxious commented 4 years ago

Hi, when it downloads wrong subtitle or unsynchronized subtitle, pressing "b" again to download alternative subtitle (of the same language) would be great, if you consider.

davidde commented 4 years ago

I agree this would be convenient. However, since this script relies entirely on subliminal for the actual downloading, there is not much I can change on my end. Subliminal only provides the option to download the "best" subtitles, according to their algorithm.

You should either change your filenames to something more descriptive (e.g. title/episode/release/year/etc.) to provide subliminal with the most accurate info, or file this issue in the subliminal repo itself: https://github.com/Diaoul/subliminal/issues/new.

mortyobnoxious commented 4 years ago

Oh okay, thanks.

Btw, this is unrelated to this issue, but script works with "streaming URLs", too.

For example when I paste a YouTube URL, it tries to find subtitles for it. Is this an expected behavior?

davidde commented 4 years ago

I personally only play local files in MPV, so I haven't set any exception for URLs. So indeed I would expect the script to try to find subtitles for everything you play in MPV.

It shouldn't be too hard to set a boolean that prevents subtitle downloading for URLs though.

mortyobnoxious commented 4 years ago

I searched for it and found this, put it in "download_subs" function:

local filepath = mp.get_property("path")
    if(filepath.find(filepath, "http")) then
      return
end

It worked, I guess. Since I don't know anything about lua, I'm not sure how this solution is okay. But it worked :)

mortyobnoxious commented 4 years ago

I made it a little bit different by changing auto to false for URLs, if i wanted to download subtitles manually for URLs by pressing "b".

local filepath = mp.get_property("path")
    if(filepath.find(filepath, "http")) then
      auto = false
end

but it didn't work.

davidde commented 4 years ago

Thank you for the suggestion! I have added the fix for everyone's convenience.

cipricus commented 1 year ago

I agree this would be convenient. However, since this script relies entirely on subliminal for the actual downloading, there is not much I can change on my end. Subliminal only provides the option to download the "best" subtitles, according to their algorithm.

Oddly, trueautosub (https://github.com/fullmetalsheep/mpv-iina-scripts, https://gist.github.com/fullmetalsheep/28c397b200a7348027d983f31a7eddfa), also based on subliminal has this description:

If you got a wrongly synced sub, press b or your customised shortcut to get another subtitle.Rinse and repeat until you find the proper sub tada

Note: only tested on OSX, this should technically work with linux as well

mpv-autosub is described as an improvement of trueautosub.

(mpv-autosub works fine, unlike the other)

cipricus commented 1 year ago

in order to correct wrong subtitles, this mpv script works pretty well: https://github.com/joaquintorres/autosubsync-mpv.