aboutsummaryrefslogtreecommitdiff
path: root/src/GoogleCaptcha.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GoogleCaptcha.cpp')
-rw-r--r--src/GoogleCaptcha.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/GoogleCaptcha.cpp b/src/GoogleCaptcha.cpp
index b5c3e3c..3bd91eb 100644
--- a/src/GoogleCaptcha.cpp
+++ b/src/GoogleCaptcha.cpp
@@ -99,14 +99,14 @@ namespace QuickMedia {
return strip_html_tags(html_source.substr(start_index, end_index - start_index));
}
- std::future<bool> google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback, bool use_tor) {
- return std::async(std::launch::async, [challenge_response_callback, api_key, referer, use_tor]() {
+ std::future<bool> google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback) {
+ return std::async(std::launch::async, [challenge_response_callback, api_key, referer]() {
std::string captcha_url = "https://www.google.com/recaptcha/api/fallback?k=" + api_key;
std::string response;
std::vector<CommandArg> additional_args = {
CommandArg{"-H", "Referer: " + referer}
};
- DownloadResult download_result = download_to_string(captcha_url, response, additional_args, use_tor);
+ DownloadResult download_result = download_to_string(captcha_url, response, additional_args);
if(download_result == DownloadResult::OK) {
//fprintf(stderr, "Failed to get captcha, response: %s\n", response.c_str());
challenge_response_callback(google_captcha_parse_request_challenge_response(api_key, response));
@@ -131,15 +131,15 @@ namespace QuickMedia {
return result;
}
- 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) {
- return std::async(std::launch::async, [solution_response_callback, api_key, captcha_id, selected_images, use_tor]() {
+ 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) {
+ return std::async(std::launch::async, [solution_response_callback, api_key, captcha_id, selected_images]() {
std::string captcha_url = "https://www.google.com/recaptcha/api/fallback?k=" + api_key;
std::string response;
std::vector<CommandArg> additional_args = {
CommandArg{"-H", "Referer: " + captcha_url},
CommandArg{"--data", "c=" + captcha_id + "&" + build_post_solution_response(selected_images)}
};
- DownloadResult post_result = download_to_string(captcha_url, response, additional_args, use_tor);
+ DownloadResult post_result = download_to_string(captcha_url, response, additional_args);
if(post_result == DownloadResult::OK) {
//fprintf(stderr, "Failed to post captcha solution, response: %s\n", response.c_str());
std::optional<std::string> captcha_post_id = google_captcha_parse_submit_solution_response(response);