aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Youtube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Youtube.cpp')
-rw-r--r--src/plugins/Youtube.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 0c9580f..2959223 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -67,9 +67,9 @@ namespace QuickMedia {
return true;
}
- index = youtube_url.find("youtu.be/");
+ index = youtube_url.find("youtube.com/shorts/");
if(index != std::string::npos) {
- index += 9;
+ index += 19;
size_t end_index = youtube_url.find("?", index);
if(end_index == std::string::npos)
end_index = youtube_url.size();
@@ -77,9 +77,19 @@ namespace QuickMedia {
return true;
}
- index = youtube_url.find("youtube.com/shorts/");
+ index = youtube_url.find("youtube.com/live/");
if(index != std::string::npos) {
- index += 19;
+ 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;
size_t end_index = youtube_url.find("?", index);
if(end_index == std::string::npos)
end_index = youtube_url.size();