aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-08-07 22:30:21 +0200
committerdec05eba <dec05eba@protonmail.com>2022-08-07 22:30:21 +0200
commitb5dd15aedfbd619e7780b9357c35c429fe5c377c (patch)
tree2ece8af72ecb3d09754d1654d85421040e913b98 /src
parent8a96eb3a74244f2580e57d12341c80b4748371c9 (diff)
Youtube: support youtube shorts urls
Diffstat (limited to 'src')
-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 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;
}