From 62f918559616138de1cc0ab8f5759f5d714e9287 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 24 Aug 2021 18:32:26 +0200 Subject: Youtube: load english subtitles when available --- plugins/Page.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/Page.hpp') diff --git a/plugins/Page.hpp b/plugins/Page.hpp index f793c65..e60c752 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -111,6 +111,11 @@ namespace QuickMedia { const char* get_title() const override { return "Related videos"; } }; + struct SubtitleData { + std::string url; + std::string title; + }; + class VideoPage : public Page { public: VideoPage(Program *program, std::string url) : Page(program), url(std::move(url)) {} @@ -140,8 +145,11 @@ namespace QuickMedia { virtual std::string get_audio_url(std::string &ext) { (void)ext; return ""; } virtual std::string url_get_playable_url(const std::string &url) { return url; } virtual bool video_should_be_skipped(const std::string &url) { (void)url; return false; } + // This needs to be called before the other functions are called virtual PluginResult load(std::string &title, std::string &channel_url, std::vector &chapters) { (void)title; (void)channel_url; (void)chapters; return PluginResult::OK; } virtual void mark_watched() {}; + // Should not do any network request to not slow down video loading + virtual void get_subtitles(SubtitleData &subtitle_data) { (void)subtitle_data; } protected: std::string url; }; -- cgit v1.2.3