Skip to content

Commit

Permalink
enable loading from global scripts dir
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Günzler <r@gnzler.io>
  • Loading branch information
robertgzr committed May 5, 2023
1 parent 7785c14 commit d344205
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ A fully-featured port of [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
- Python 3

## Installation
Move `sponsorblock.lua` and `sponsorblock_shared` into your mpv `scripts` folder.
Move `sponsorblock.lua` and `sponsorblock_shared` into your mpv `scripts` folder under a `sponsorblock` directory:
```
mpv/scripts/
├── sponsorblock.lua
└── sponsorblock_shared
├── sponsorblock/
├── main.lua
└── sponsorblock.py
├── sponsorblock.lua
└── sponsorblock_shared
├── main.lua
└── sponsorblock.py
```

The easiest way is to download the [ZIP file](https://github.com/po5/mpv_sponsorblock/archive/refs/heads/master.zip) and unpack it into the correct location.

## Usage
Play a YouTube video, sponsors will be skipped automatically.

Expand Down
1 change: 1 addition & 0 deletions main.lua
2 changes: 1 addition & 1 deletion sponsorblock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ end
options.local_database = false

local utils = require "mp.utils"
scripts_dir = mp.find_config_file("scripts")
scripts_dir = mp.get_script_directory()

local sponsorblock = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.py")
local uid_path = utils.join_path(scripts_dir, "sponsorblock_shared/sponsorblock.txt")
Expand Down

0 comments on commit d344205

Please # to comment.