From 09d2e8bde4c71b75ac9df65586bd8b7ff0a7b16b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 27 Apr 2023 00:07:33 +0200 Subject: Temporary depend on yt-dlp for youtube since youtube broke (throttle sig) --- src/plugins/MediaGeneric.cpp | 2 +- src/plugins/Youtube.cpp | 38 +++++++++----------------------------- 2 files changed, 10 insertions(+), 30 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/MediaGeneric.cpp b/src/plugins/MediaGeneric.cpp index cc869ef..b2d2538 100644 --- a/src/plugins/MediaGeneric.cpp +++ b/src/plugins/MediaGeneric.cpp @@ -220,7 +220,7 @@ namespace QuickMedia { // TODO: Use max_height, if possible (void)max_height; has_embedded_audio = true; - ext = "m3u8"; + ext = ".m3u8"; return video_url; } diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 9b64054..33e4cea 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -1568,18 +1568,6 @@ namespace QuickMedia { return fetch_comments(this, video_url, continuation_token, result_items); } - static const char* youtube_channel_page_type_to_api_params(YoutubeChannelPage::Type type) { - switch(type) { - case YoutubeChannelPage::Type::VIDEOS: - return "EgZ2aWRlb3PyBgQKAjoA"; - case YoutubeChannelPage::Type::SHORTS: - return "EgZzaG9ydHPyBgUKA5oBAA%3D%3D"; - case YoutubeChannelPage::Type::LIVE: - return "EgdzdHJlYW1z8gYECgJ6AA%3D%3D"; - } - return ""; - } - static const char* youtube_channel_page_type_get_endpoint(YoutubeChannelPage::Type type) { switch(type) { case YoutubeChannelPage::Type::VIDEOS: @@ -2359,7 +2347,15 @@ namespace QuickMedia { return nullptr; } + std::string YoutubeVideoPage::get_download_url(int max_height) { + return url; + } + std::string YoutubeVideoPage::get_video_url(int max_height, bool &has_embedded_audio, std::string &ext) { + has_embedded_audio = true; + ext = ".mp4"; + return url; +#if 0 if(!livestream_url.empty()) { has_embedded_audio = true; return livestream_url; @@ -2392,23 +2388,7 @@ namespace QuickMedia { ext = ".webm"; return chosen_video_format->base.url; - } - - std::string YoutubeVideoPage::get_audio_url(std::string &ext) { - if(audio_formats.empty()) - return ""; - - const YoutubeAudioFormat *chosen_audio_format = &audio_formats.front(); - fprintf(stderr, "Choosing youtube audio format: bitrate: %d, mime type: %s\n", chosen_audio_format->base.bitrate, chosen_audio_format->base.mime_type.c_str()); - - if(chosen_audio_format->base.mime_type.find("mp4") != std::string::npos) - ext = ".m4a"; - else if(chosen_audio_format->base.mime_type.find("webm") != std::string::npos) - ext = ".opus"; // TODO: Detect if vorbis (.ogg) or opus (.opus) - else if(chosen_audio_format->base.mime_type.find("opus") != std::string::npos) - ext = ".opus"; - - return chosen_audio_format->base.url; +#endif } // Returns -1 if timestamp is in an invalid format -- cgit v1.2.3