-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Category - poi_highlight #42
Comments
Did notice the new feature while using the browser extension and not sure how to implement this. |
I don't think that "chapter marker" is enough for this one. |
There will always only be atmost one |
Dirty workaround for anyone interested: diff --git a/sponsorblock.lua b/sponsorblock.lua
index 96bfb24..efe86df 100644
--- a/sponsorblock.lua
+++ b/sponsorblock.lua
@@ -108,7 +108,7 @@ local fade_timer = nil
local fade_dir = nil
local volume_before = mp.get_property_number("volume")
local categories = {}
-local all_categories = {"sponsor", "intro", "outro", "interaction", "selfpromo", "preview", "music_offtopic", "filler"}
+local all_categories = {"sponsor", "intro", "outro", "interaction", "selfpromo", "preview", "music_offtopic", "filler", "poi_highlight"}
local chapter_cache = {}
for category in string.gmatch(options.skip_categories, "([^,]+)") do
@@ -182,7 +182,7 @@ function process(uuid, t, new_ranges)
end
end
category = string.match(t, "[^,]+$")
- if categories[category] and end_time - start_time >= options.min_duration then
+ if categories[category] and (end_time - start_time >= options.min_duration or category == 'poi_highlight') then
new_ranges[uuid] = {
start_time = start_time,
end_time = end_time,
@@ -282,6 +282,10 @@ function skip_ads(name, pos)
if pos == nil then return end
local sponsor_ahead = false
for uuid, t in pairs(ranges) do
+ if t.category == "poi_highlight" and not t.skipped then
+ t.skipped = true
+ mp.set_property("time-pos", t.end_time)
+ end
if (options.fast_forward == uuid or not options.skip_once or not t.skipped) and t.start_time <= pos and t.end_time > pos then
if options.fast_forward == uuid then return end
if options.fast_forward == false then # ~/.config/mpv/script-opts/sponsorblock.conf
skip_categories=sponsor,intro,outro,interaction,selfpromo,preview,music_offtopic,filler,poi_highlight
categories=sponsor,intro,outro,interaction,selfpromo,filler,preview,music_offtopic,poi_highlight |
It doesn't seem like a "workaround", it looks like a solution, will you be able to send a PR for this? |
https://github.com/ajayyy/SponsorBlock/wiki/Types#category
poi_highlight
Video with the new category:
https://www.youtube.com/watch?v=zF2KF-SVIXc
How can I use it on MPV?
I tried to add "poi_highlight" to "skip categories", it does fetch that, but it doesn't skip TO IT, since the script only skips FROM IT.
This one is tricky to use since the start and end times are equal, so somehow the script will need to skip to that point (highlight) from the start of the video.
The text was updated successfully, but these errors were encountered: