|
|
@ -295,7 +295,9 @@ def bypass_captcha(captcha_key, logger)
|
|
|
|
inputs[node["name"]] = node["value"]
|
|
|
|
inputs[node["name"]] = node["value"]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
response = JSON.parse(HTTP::Client.post("https://api.anti-captcha.com/createTask", body: {
|
|
|
|
captcha_client = HTTPClient.new(URI.parse("https://api.anti-captcha.com"))
|
|
|
|
|
|
|
|
captcha_client.family = CONFIG.force_resolve || Socket::Family::INET
|
|
|
|
|
|
|
|
response = JSON.parse(captcha_client.post("/createTask", body: {
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"task" => {
|
|
|
|
"task" => {
|
|
|
|
"type" => "NoCaptchaTaskProxyless",
|
|
|
|
"type" => "NoCaptchaTaskProxyless",
|
|
|
@ -310,7 +312,7 @@ def bypass_captcha(captcha_key, logger)
|
|
|
|
loop do
|
|
|
|
loop do
|
|
|
|
sleep 10.seconds
|
|
|
|
sleep 10.seconds
|
|
|
|
|
|
|
|
|
|
|
|
response = JSON.parse(HTTP::Client.post("https://api.anti-captcha.com/getTaskResult", body: {
|
|
|
|
response = JSON.parse(captcha_client.post("/getTaskResult", body: {
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"taskId" => task_id,
|
|
|
|
"taskId" => task_id,
|
|
|
|
}.to_json).body)
|
|
|
|
}.to_json).body)
|
|
|
@ -323,9 +325,11 @@ def bypass_captcha(captcha_key, logger)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
inputs["g-recaptcha-response"] = response["solution"]["gRecaptchaResponse"].as_s
|
|
|
|
inputs["g-recaptcha-response"] = response["solution"]["gRecaptchaResponse"].as_s
|
|
|
|
client = HTTPClient.new(location)
|
|
|
|
headers["content-type"] = "application/x-www-form-urlencoded"
|
|
|
|
client.family = CONFIG.force_resolve || Socket::Family::INET
|
|
|
|
headers["origin"] = "https://www.google.com"
|
|
|
|
response = client.post(location.full_path, form: inputs)
|
|
|
|
headers["user-agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response = YT_POOL.client &.post("/sorry/index", headers: headers, form: inputs)
|
|
|
|
headers = HTTP::Headers{
|
|
|
|
headers = HTTP::Headers{
|
|
|
|
"Cookie" => URI.parse(response.headers["location"]).query_params["google_abuse"].split(";")[0],
|
|
|
|
"Cookie" => URI.parse(response.headers["location"]).query_params["google_abuse"].split(";")[0],
|
|
|
|
}
|
|
|
|
}
|
|
|
|