aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 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;