aboutsummaryrefslogtreecommitdiff
path: root/include/GoogleCaptcha.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/GoogleCaptcha.hpp')
-rw-r--r--include/GoogleCaptcha.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/GoogleCaptcha.hpp b/include/GoogleCaptcha.hpp
new file mode 100644
index 0000000..9c998da
--- /dev/null
+++ b/include/GoogleCaptcha.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <string>
+#include <optional>
+#include <functional>
+#include <future>
+#include <array>
+
+namespace QuickMedia {
+ struct GoogleCaptchaChallengeInfo
+ {
+ std::string id;
+ std::string payload_url;
+ std::string description;
+ };
+
+ using RequestChallengeResponse = std::function<void(std::optional<GoogleCaptchaChallengeInfo>)>;
+ std::future<bool> google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback, bool use_tor = false);
+ using PostSolutionResponse = std::function<void(std::optional<std::string>, std::optional<GoogleCaptchaChallengeInfo>)>;
+ std::future<bool> google_captcha_post_solution(const std::string &api_key, const std::string &captcha_id, std::array<bool, 9> selected_images, PostSolutionResponse solution_response_callback, bool use_tor);
+} \ No newline at end of file