diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-04-03 19:37:55 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-04-03 19:37:55 +0200 |
commit | e8cf95fd56bb6cc16f937d06c3554260fd789a92 (patch) | |
tree | da92b53f153a4377b6aed960f6a14379035e00d5 /include | |
parent | 714ed0e235a600502c489d08d78b3781e18fc327 (diff) |
Youtube: fallback to yt-dlp, add support for sponsorblock (as chapters)
Diffstat (limited to 'include')
-rw-r--r-- | include/Config.hpp | 6 | ||||
-rw-r--r-- | include/QuickMedia.hpp | 3 |
2 files changed, 9 insertions, 0 deletions
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<Tab> &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; }; } |