From f1cf9f475295bfc480188e0fad8e9b0bb27fd3f7 Mon Sep 17 00:00:00 2001 From: JanBecker Date: Wed, 14 Apr 2021 16:38:47 +0200 Subject: [PATCH] Fixed Error with hypens in Youtube-IDs Changed regex to find the youtube-IDs in filenames like "This\ Epic\ Studio\ Tour\ Almost\ Killed\ Me\!\!-zk97ywS-fGc.mkv", where previously only "fGc" was matched. --- sponsorblock_minimal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sponsorblock_minimal.lua b/sponsorblock_minimal.lua index 9920d23..78dbb03 100644 --- a/sponsorblock_minimal.lua +++ b/sponsorblock_minimal.lua @@ -55,7 +55,7 @@ function file_loaded() local youtube_id2 = string.match(video_path, "https?://w?w?w?%.?youtube%.com/v/([%w-_]+).*") local youtube_id3 = string.match(video_path, "/watch.*[?&]v=([%w-_]+).*") local youtube_id4 = string.match(video_path, "/embed/([%w-_]+).*") - local youtube_id5 = string.match(video_path, ".*-([%w-_]+).*") + local youtube_id5 = string.match(video_path, "-([%w-_]+)%.") youtube_id = youtube_id1 or youtube_id2 or youtube_id3 or youtube_id4 or youtube_id5 if not youtube_id or string.len(youtube_id) < 11 then return end youtube_id = string.sub(youtube_id, 1, 11)