aboutsummaryrefslogtreecommitdiff
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
parent8a96eb3a74244f2580e57d12341c80b4748371c9 (diff)
Youtube: support youtube shorts urls
-rw-r--r--TODO4
-rw-r--r--src/plugins/Youtube.cpp10
2 files changed, 13 insertions, 1 deletions
diff --git a/TODO b/TODO
index be98cd6..2b75c1c 100644
--- a/TODO
+++ b/TODO
@@ -224,4 +224,6 @@ Render watch progress in youtube.
Set _NET_WM_USER_TIME (see sfml).
Make saucenao work with encrypted images in matrix, or show an error as this is a "security" risk.
Body image cache (async image loader) should take requested size into consideration, because the same image can be requested at multiple sizes and we dont want to cache the smaller sized image for both.
-To make quickmedia more resilient against broken youtube videos, quickmedia should try other quality if video/audio fails to play. Also do that if the download is stuck/slow for the current quality. \ No newline at end of file
+To make quickmedia more resilient against broken youtube videos, quickmedia should try other quality if video/audio fails to play. Also do that if the download is stuck/slow for the current quality.
+Make youtube work with age restricted copy righted videos, such as https://www.youtube.com/watch?v=7n3dP_1KqBw. Age restricted videos also play slowly because they have url part that needs to be decoded.
+Upload media once in 4chan, on comment enter and then re-use that after solving captcha; instead of reuploading video after each captcha retry. If possible... \ No newline at end of file
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;
}