From 60f22a9cba69a8443ed1442c5294a0102ed6f1a3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 28 Jul 2021 15:50:26 +0200 Subject: 4chan: add timeout for posting without pass, handle noop captcha challenge --- plugins/ImageBoard.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/ImageBoard.hpp b/plugins/ImageBoard.hpp index 835d92a..5b299b3 100644 --- a/plugins/ImageBoard.hpp +++ b/plugins/ImageBoard.hpp @@ -6,6 +6,7 @@ namespace QuickMedia { enum class PostResult { OK, TRY_AGAIN, + INVALID_CAPTCHA, BANNED, //FILE_TOO_LARGE, NO_SUCH_FILE, @@ -14,11 +15,12 @@ namespace QuickMedia { ERR }; + // All fields are optional struct ImageBoardCaptchaChallenge { std::string challenge_id; std::string img_data; - std::string bg_data; // optional - int ttl = 0; // optional + std::string bg_data; + int ttl = 0; }; class ImageBoardThreadPage : public VideoPage { @@ -37,7 +39,6 @@ namespace QuickMedia { 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; -- cgit v1.2.3