GoogleCaptcha.hpp 886 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include "AsyncTask.hpp"
  3. #include <string>
  4. #include <optional>
  5. #include <functional>
  6. #include <future>
  7. #include <array>
  8. namespace QuickMedia {
  9. struct GoogleCaptchaChallengeInfo
  10. {
  11. std::string id;
  12. std::string payload_url;
  13. std::string description;
  14. };
  15. using RequestChallengeResponse = std::function<void(std::optional<GoogleCaptchaChallengeInfo>)>;
  16. AsyncTask<bool> google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback);
  17. using PostSolutionResponse = std::function<void(std::optional<std::string>, std::optional<GoogleCaptchaChallengeInfo>)>;
  18. AsyncTask<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);
  19. }