aboutsummaryrefslogtreecommitdiff
path: root/plugins/ImageBoard.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-27 20:24:36 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-27 20:24:36 +0200
commite5fc00e506806f06bde32e9334fdec57dd8cb86d (patch)
tree8791be0727f5f7ef38443def9526c25accf51963 /plugins/ImageBoard.hpp
parent87b3100773f20ab87198329c2a2284ca76235ca6 (diff)
Implement new 4chan captcha
Diffstat (limited to 'plugins/ImageBoard.hpp')
-rw-r--r--plugins/ImageBoard.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/ImageBoard.hpp b/plugins/ImageBoard.hpp
index 651eabf..835d92a 100644
--- a/plugins/ImageBoard.hpp
+++ b/plugins/ImageBoard.hpp
@@ -14,6 +14,13 @@ namespace QuickMedia {
ERR
};
+ struct ImageBoardCaptchaChallenge {
+ std::string challenge_id;
+ std::string img_data;
+ std::string bg_data; // optional
+ int ttl = 0; // optional
+ };
+
class ImageBoardThreadPage : public VideoPage {
public:
ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id) : VideoPage(program, ""), board_id(std::move(board_id)), thread_id(std::move(thread_id)) {}
@@ -27,9 +34,12 @@ namespace QuickMedia {
}
virtual PluginResult login(const std::string &token, const std::string &pin, std::string &response_msg);
// If |filepath| is empty then no file is uploaded
- virtual PostResult post_comment(const std::string &captcha_id, const std::string &comment, const std::string &filepath = "") = 0;
+ virtual PostResult post_comment(const std::string &captcha_id, const std::string &captcha_solution, const std::string &comment, const std::string &filepath = "") = 0;
virtual const std::string& get_pass_id();
+ // |bg_data|, |bg_size| and |ttl| are optional
+ virtual PluginResult request_captcha_challenge(ImageBoardCaptchaChallenge &challenge_response) = 0;
+
const std::string board_id;
const std::string thread_id;
};