aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Spankbang.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/Spankbang.hpp b/plugins/Spankbang.hpp
new file mode 100644
index 0000000..95b8820
--- /dev/null
+++ b/plugins/Spankbang.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "Page.hpp"
+
+namespace QuickMedia {
+ class SpankbangSearchPage : public Page {
+ public:
+ SpankbangSearchPage(Program *program) : Page(program) {}
+ const char* get_title() const override { return "All"; }
+ 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;
+ };
+
+ class SpankbangRelatedVideosPage : public RelatedVideosPage {
+ public:
+ SpankbangRelatedVideosPage(Program *program) : RelatedVideosPage(program) {}
+ PluginResult submit(const std::string&, const std::string&, std::vector<Tab> &result_tabs) override;
+ };
+
+ class SpankbangVideoPage : public VideoPage {
+ public:
+ SpankbangVideoPage(Program *program, const std::string &url) : VideoPage(program), url(url) {}
+ const char* get_title() const override { return ""; }
+ BodyItems get_related_media(const std::string &url, std::string &channel_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, const std::string &video_url, const std::string &video_title) override;
+ std::unique_ptr<LazyFetchPage> create_channels_page(Program*, const std::string&) override {
+ return nullptr;
+ }
+ std::string get_url() override { return url; }
+ private:
+ std::string url;
+ };
+} \ No newline at end of file