From b5dd15aedfbd619e7780b9357c35c429fe5c377c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 7 Aug 2022 22:30:21 +0200 Subject: Youtube: support youtube shorts urls --- src/plugins/Youtube.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 7552967..a0c15de 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -78,6 +78,16 @@ namespace QuickMedia { return true; } + index = youtube_url.find("youtube.com/shorts/"); + if(index != std::string::npos) { + index += 19; + size_t end_index = youtube_url.find("?", index); + if(end_index == std::string::npos) + end_index = youtube_url.size(); + youtube_video_id = youtube_url.substr(index, end_index - index); + return true; + } + return false; } -- cgit v1.2.3