diff options
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | src/plugins/Youtube.cpp | 10 |
2 files changed, 13 insertions, 1 deletions
@@ -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; } |