From 539d9b457c4f30ef0731a479772212e7ce8bfd7c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 30 Mar 2021 00:45:51 +0200 Subject: Remove tor option. Use torsocks instead (which is what quickmedia did anyways) --- src/GoogleCaptcha.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/GoogleCaptcha.cpp') 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 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 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 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 google_captcha_post_solution(const std::string &api_key, const std::string &captcha_id, std::array 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 google_captcha_post_solution(const std::string &api_key, const std::string &captcha_id, std::array 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 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 captcha_post_id = google_captcha_parse_submit_solution_response(response); -- cgit v1.2.3