diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-09 14:49:13 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-13 03:43:19 +0200 |
commit | 060db5c6cbd02e684a0c98c0f045da242b6ab218 (patch) | |
tree | f380f5eb398a3aa83f5c2c413c041137503c9589 /plugins/Lbry.hpp | |
parent | e2a510e8c94aae88aab6293659b1a0786c799bc2 (diff) |
Add lbry, attempt to fix 4chan posting when captcha is no-op
Diffstat (limited to 'plugins/Lbry.hpp')
-rw-r--r-- | plugins/Lbry.hpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/Lbry.hpp b/plugins/Lbry.hpp new file mode 100644 index 0000000..ac7c4b4 --- /dev/null +++ b/plugins/Lbry.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include "Page.hpp" + +namespace QuickMedia { + class LbrySearchPage : public Page { + public: + LbrySearchPage(Program *program, std::string channel_id = "") : Page(program), channel_id(std::move(channel_id)) {} + const char* get_title() const override { return "Search"; } + bool search_is_filter() override { return false; } + SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; + PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + bool submit_is_async() const override { return false; } + private: + std::string channel_id; + }; + + class LbryChannelPage : public LazyFetchPage { + public: + LbryChannelPage(Program *program, std::string title, std::string channel_id) : + LazyFetchPage(program), search_page(program, channel_id), title(std::move(title)), channel_id(std::move(channel_id)) {} + const char* get_title() const override { return title.c_str(); } + bool submit_is_async() const override { return false; } + bool search_is_filter() override { return false; } + SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; + PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + PluginResult lazy_fetch(BodyItems &result_items) override; + private: + LbrySearchPage search_page; + std::string title; + std::string channel_id; + }; + + class LbryVideoPage : public VideoPage { + public: + LbryVideoPage(Program *program, std::string title, std::string url) : VideoPage(program, std::move(url)), title(std::move(title)) {} + const char* get_title() const override { return ""; } + //BodyItems get_related_media(const std::string &url) override; + //bool create_search_page(Program *program, Tab &tab) 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_download_url(int max_height) override; + std::string get_video_url(int max_height, bool &has_embedded_audio, std::string &ext) override; + std::string get_audio_url(std::string &ext) override; + PluginResult load(std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters, std::string &err_str) override; + private: + std::string title; + std::string streaming_url; + }; +}
\ No newline at end of file |