aboutsummaryrefslogtreecommitdiff
path: root/include/GoogleCaptcha.hpp
blob: f8063f306f3dfeb6544f2315a63ab3a6e0cc7790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include "AsyncTask.hpp"
#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>)>;
    AsyncTask<bool> google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback);
    using PostSolutionResponse = std::function<void(std::optional<std::string>, std::optional<GoogleCaptchaChallengeInfo>)>;
    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);
}