diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MediaGeneric.hpp | 2 | ||||
-rw-r--r-- | plugins/Page.hpp | 5 | ||||
-rw-r--r-- | plugins/Youtube.hpp | 5 | ||||
-rw-r--r-- | plugins/youtube/Signature.hpp | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/plugins/MediaGeneric.hpp b/plugins/MediaGeneric.hpp index 102e315..a9d1e2a 100644 --- a/plugins/MediaGeneric.hpp +++ b/plugins/MediaGeneric.hpp @@ -82,7 +82,7 @@ namespace QuickMedia { public: MediaGenericVideoPage(Program *program, MediaGenericSearchPage *search_page, const std::string &url) : VideoPage(program, url), search_page(search_page) {} const char* get_title() const override { return ""; } - BodyItems get_related_media(const std::string &url, std::string &channel_url) override; + BodyItems get_related_media(const std::string &url) override; std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) override; std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program) override; std::unique_ptr<Page> create_channels_page(Program*, const std::string&) override { diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 0c5b093..0654fa7 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -105,7 +105,7 @@ namespace QuickMedia { VideoPage(Program *program, std::string url) : Page(program), url(std::move(url)) {} virtual PageTypez get_type() const override { return PageTypez::VIDEO; } virtual bool autoplay_next_item() { return false; } - virtual BodyItems get_related_media(const std::string &url, std::string &channel_url) { (void)url; (void)channel_url; return {}; } + virtual BodyItems get_related_media(const std::string &url) { (void)url; return {}; } virtual std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) { (void)program; (void)search_delay; return nullptr; } virtual std::unique_ptr<Page> create_comments_page(Program *program) { (void)program; return nullptr; } // Return nullptr if the service doesn't support related videos page @@ -124,7 +124,8 @@ namespace QuickMedia { virtual std::string get_audio_url() { 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; } - virtual PluginResult load() { return PluginResult::OK; } + virtual PluginResult load(std::string &channel_url) { (void)channel_url; return PluginResult::OK; } + virtual void mark_watched() {}; protected: std::string url; }; diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index dea6cc2..20c04fc 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -133,14 +133,15 @@ namespace QuickMedia { public: YoutubeVideoPage(Program *program, std::string url) : VideoPage(program, std::move(url)) {} const char* get_title() const override { return ""; } - BodyItems get_related_media(const std::string &url, std::string &channel_url) override; + BodyItems get_related_media(const std::string &url) override; std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) override; std::unique_ptr<Page> create_comments_page(Program *program) override; std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program) override; std::unique_ptr<Page> create_channels_page(Program *program, const std::string &channel_url) override; std::string get_video_url(int max_height, bool &has_embedded_audio) override; std::string get_audio_url() override; - PluginResult load() override; + PluginResult load(std::string &channel_url) override; + void mark_watched() override; private: void parse_format(const Json::Value &format_json, bool is_adaptive); void parse_formats(const Json::Value &streaming_data_json); diff --git a/plugins/youtube/Signature.hpp b/plugins/youtube/Signature.hpp index 7456615..8c782f9 100644 --- a/plugins/youtube/Signature.hpp +++ b/plugins/youtube/Signature.hpp @@ -33,6 +33,8 @@ namespace QuickMedia { bool js_code_to_operations(const std::string &function_body_str, const std::string &var_body_str, std::vector<DecryptFuncCall> &new_func_calls, std::map<std::string, DecryptFunction> &new_func_decls); int update_decrypt_function(); private: + // TODO: Remove this task and instead add the network download task to a queue and add a poll function to check if it has finished downloading + // or if it needs to be updated. AsyncTask<void> poll_task; std::mutex update_signature_mutex; std::string decryption_function; |