From 203add15e57bea17cf283ddd55314cf28dac9b24 Mon Sep 17 00:00:00 2001 From: butterflyx <5388631+butterflyx@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:55:45 +0100 Subject: [PATCH] [add] VideoID for YT shorts --- plugins/tools/youtube/youtube.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tools/youtube/youtube.go b/plugins/tools/youtube/youtube.go index a852ce0e9..ea0f6609a 100644 --- a/plugins/tools/youtube/youtube.go +++ b/plugins/tools/youtube/youtube.go @@ -60,7 +60,7 @@ func (o *YouTube) GetVideoOrPlaylistId(url string) (videoId string, playlistId s // Video ID pattern //https:((youtu.be/7qZl_5xHoBw - videoPattern := `(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})` + videoPattern := `(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|(?:s(?:horts)\/)|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})` videoRe := regexp.MustCompile(videoPattern) videoMatch := videoRe.FindStringSubmatch(url) if len(videoMatch) > 1 {