davidde / mpv-autosub

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

Keybindings don't work #7

Closed wedens closed 4 years ago

wedens commented 4 years ago

In "manual" mode keybindings don't work because directory and filename variables in download_subs are undefined.

I suppose this part of control_downloads should be done for manual invocations too:

    -- Make MPV accept external subtitle files with language specifier:
    mp.set_property('sub-auto', 'fuzzy')
    -- Set subtitle language preference:
    mp.set_property('slang', languages[1][2])
    mp.msg.warn('Reactivate external subtitle files:')
    mp.commandv('rescan_external_files')
    directory, filename = utils.split_path(mp.get_property('path'))

Also, changing bindings to use control_downloads is not a good option as if you trigger it manually, you most likely want to download subtitles regardless of video length, name, etc.

davidde commented 4 years ago

I'm sorry but I can't reproduce this. My keybindings work fine. What exactly do you mean by "manual" mode?

Note that the directory and filename variables in control_downloads are global, so it is not necessary to repeat their declaration in download_subs.

davidde commented 4 years ago

I'm guessing you modified the script and commented out the bottom line that invoked control_downloads.

If that is the case you should undo that comment, and simply change the auto bool in the settings to false. That is the proper way to disable the automatic downloading.