From e8cf95fd56bb6cc16f937d06c3554260fd789a92 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 3 Apr 2024 19:37:55 +0200 Subject: Youtube: fallback to yt-dlp, add support for sponsorblock (as chapters) --- include/Config.hpp | 6 ++++++ include/QuickMedia.hpp | 3 +++ 2 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/Config.hpp b/include/Config.hpp index 0b0f021..11d7679 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -49,9 +49,15 @@ namespace QuickMedia { bool auto_group_episodes = true; }; + struct YoutubeSponsorblock { + bool enable = false; + int min_votes = 0; + }; + struct YoutubeConfig { bool load_progress = true; std::string invidious_instance; + YoutubeSponsorblock sponsorblock; }; struct MatrixConfig { diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 0f8837d..a6de75c 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -117,8 +117,10 @@ namespace QuickMedia { void save_recommendations_from_related_videos(const char *plugin_name, const std::string &video_url, const std::string &video_title, const BodyItems &related_media_body_items); void set_clipboard(const std::string &str); + bool youtube_dl_extract_url(const std::string &url, std::string &video_url, std::string &audio_url); private: void init(mgl::WindowHandle parent_window, std::string &program_path, bool no_dialog); + const char* get_youtube_dl_program_name(); void check_youtube_dl_installed(const std::string &plugin_name); void load_plugin_by_name(std::vector &tabs, int &start_tab_index, FileManagerMimeType fm_mime_type, FileSelectionHandler file_selection_handler, std::string instance); void common_event_handler(mgl::Event &event); @@ -242,5 +244,6 @@ namespace QuickMedia { int video_max_height = 0; std::mutex login_inputs_mutex; const char *yt_dl_name = nullptr; + bool yt_dl_name_checked = false; }; } -- cgit v1.2.3