po5 / mpv_sponsorblock

mpv script to skip sponsored segments of YouTube videos
GNU General Public License v3.0
531 stars 29 forks source link

enable loading from global scripts dir #66

Open robertgzr opened 1 year ago

robertgzr commented 1 year ago

the scripts_dir detection logic uses mp.find_config_file("scripts") which returns $XDG_CONFIG_HOME/mpv/scripts even if the plugin is installed globally under /etc/mpv/scripts.

fix this by using mp.get_script_directory(), which requires the install the plugin in a script directory, but that is recommended anyway for plugins like this one: https://mpv.io/manual/master/#script-location

robertgzr commented 1 year ago

i guess this kind of depends on #17

po5 commented 1 year ago

Wouldn't mp.find_config_file("scripts/sponsorblock_shared") work as well? I'd like to keep support for mpv <0.33.0 if it doesn't add complexity.

robertgzr commented 1 year ago

yeah that seems to work as well...

nbraud commented 2 months ago

I'd like to keep support for mpv <0.33.0 if it doesn't add complexity.

Out of curiosity, is there a particular reason? Glancing through Repology, mpv 0.33 (or later) seems to be in all currently-supported releases of all major software distributions.

I'm asking because it adds some complexity downstream instead, both for users who manually clone the repo and copy/symlink files into place, and for distro packagers; granted, IDK of anyone packaging mpv scripts outside of us in nixpkgs.