aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Fourchan.hpp7
-rw-r--r--plugins/ImageBoard.hpp11
2 files changed, 15 insertions, 3 deletions
diff --git a/plugins/Fourchan.hpp b/plugins/Fourchan.hpp
index 51fe880..8622a69 100644
--- a/plugins/Fourchan.hpp
+++ b/plugins/Fourchan.hpp
@@ -3,6 +3,9 @@
#include "ImageBoard.hpp"
namespace QuickMedia {
+ // |post_id| is optional
+ bool fourchan_extract_url(const std::string &url, std::string &board_id, std::string &thread_id, std::string &post_id);
+
class FourchanBoardsPage : public Page {
public:
FourchanBoardsPage(Program *program, std::string resources_root) : Page(program), resources_root(std::move(resources_root)) {}
@@ -57,8 +60,8 @@ namespace QuickMedia {
class FourchanThreadPage : public ImageBoardThreadPage {
public:
- FourchanThreadPage(Program *program, std::string board_id, std::string thread_id, std::string pass_id) :
- ImageBoardThreadPage(program, std::move(board_id), std::move(thread_id)), pass_id(std::move(pass_id)) {}
+ FourchanThreadPage(Program *program, std::string board_id, std::string thread_id, std::string post_id, std::string pass_id) :
+ ImageBoardThreadPage(program, std::move(board_id), std::move(thread_id), std::move(post_id)), pass_id(std::move(pass_id)) {}
PluginResult lazy_fetch(BodyItems &result_items) override;
diff --git a/plugins/ImageBoard.hpp b/plugins/ImageBoard.hpp
index e135532..6341622 100644
--- a/plugins/ImageBoard.hpp
+++ b/plugins/ImageBoard.hpp
@@ -22,6 +22,13 @@ namespace QuickMedia {
std::string err_msg;
};
+ class ImageBoardBodyItemData : public BodyItemExtra {
+ public:
+ std::vector<size_t> replies_to;
+ std::vector<size_t> replies;
+ int64_t post_id = 0;
+ };
+
// All fields are optional
struct ImageBoardCaptchaChallenge {
std::string challenge_id;
@@ -32,7 +39,8 @@ namespace QuickMedia {
class ImageBoardThreadPage : public LazyFetchPage {
public:
- ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id) : LazyFetchPage(program), board_id(std::move(board_id)), thread_id(std::move(thread_id)) {}
+ ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id, std::string post_id) :
+ LazyFetchPage(program), board_id(std::move(board_id)), thread_id(std::move(thread_id)), post_id(std::move(post_id)) {}
const char* get_title() const override { return ""; }
PageTypez get_type() const override { return PageTypez::IMAGE_BOARD_THREAD; }
@@ -46,6 +54,7 @@ namespace QuickMedia {
const std::string board_id;
const std::string thread_id;
+ const std::string post_id;
};
class ImageBoardVideoPage : public VideoPage {