Skip to content
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

Solidus in chapter title cannot be escaped #11

Open
0n-s opened this issue Dec 5, 2024 · 2 comments
Open

Solidus in chapter title cannot be escaped #11

0n-s opened this issue Dec 5, 2024 · 2 comments

Comments

@0n-s
Copy link

0n-s commented Dec 5, 2024

I am trying to add this category: categories=sb>^%[SponsorBlock%]: Sponsor/^%[SponsorBlock%]: Intermission%/Intro Animation

Just to be very explicit, this is supposed to match precisely [SponsorBlock]: Sponsor & [SponsorBlock]: Intermission/Intro Animation. However, playing a video with a chapter with the latter title, makes chapterskip spit out this error:

[chapterskip] 
[chapterskip] stack traceback:
[chapterskip] 	[C]: in function 'match'
[chapterskip] 	...-0-unstable-2022-09-08/share/mpv/scripts/chapterskip.lua:29: in function 'matches'
[chapterskip] 	...-0-unstable-2022-09-08/share/mpv/scripts/chapterskip.lua:63: in function 'prop'
[chapterskip] 	mp.defaults:412: in function 'handler'
[chapterskip] 	mp.defaults:515: in function 'call_event_handlers'
[chapterskip] 	mp.defaults:557: in function 'dispatch_events'
[chapterskip] 	mp.defaults:508: in function <mp.defaults:507>
[chapterskip] 	[C]: in ?
[chapterskip] 	[C]: in ?
[chapterskip] Lua error: ...-0-unstable-2022-09-08/share/mpv/scripts/chapterskip.lua:29: malformed pattern (ends with '%')

I believe this is because the solidus there cannot be escaped & is interpreted as a separator. How would I go about escaping it?

@po5
Copy link
Owner

po5 commented Dec 6, 2024

Hi, indeed it can't be escaped currently. Just match any character with . e.g. ^%[SponsorBlock%]: Intermission.Intro Animation

@0n-s
Copy link
Author

0n-s commented Dec 6, 2024

Sure, that's what I'm doing right now. But I'd like to do it in a non-hacky fashion, so I suppose I'll keep this issue open until that's possible.

@0n-s 0n-s changed the title How to match a chapter title with a solidus in it? Solidus in chapter title cannot be escaped Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants