aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-27 19:27:33 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-27 19:27:33 +0100
commit87ed9cb8c09aa61f6e3d4e8246195162ef176468 (patch)
treecbb3c405e622909709afdcbb51f8798b18f71f9e
parentfab3bb7f8af92b47ce2e7be7c5b58c4ea5aee48c (diff)
youtube: fix youtu.be/watch?v= urls
-rw-r--r--src/plugins/Youtube.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index e0d79c3..d80d86c 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -55,6 +55,16 @@ namespace QuickMedia {
return true;
}
+ index = youtube_url.find("youtu.be/watch?v=");
+ if(index != std::string::npos) {
+ index += 17;
+ 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;
+ }
+
index = youtube_url.find("youtu.be/");
if(index != std::string::npos) {
index += 9;