po5 / mpv_sponsorblock

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

Write data to a standard writable directory for cache data #16

Open pacien opened 4 years ago

pacien commented 4 years ago

Currently, the script attempts to write the user ID and the sponsorblock DB within the "sponsorblock_shared" directory. However, the directory in which the script is located isn't always writable (for example when the script is installed through a system package manager and used with mpv --scripts=[path to script]).

A more standard location would perhaps be $XDG_CACHE_HOME/mpv/scripts/sponsorblock/sponsorblock.{txt,db} on Linux. I'm not sure whether similar standard paths are defined on other platforms though.


https://github.com/NixOS/nixpkgs/pull/92507#discussion_r450492245

po5 commented 4 years ago

PRs welcome, requirement is that the location should available on all systems mpv runs on.