mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Allow cookies from anti-captcha to be optional (#1371)
This commit is contained in:
parent
b88872d54b
commit
9995a8d53f
1 changed files with 2 additions and 2 deletions
|
@ -246,7 +246,7 @@ 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
|
||||||
headers["Cookies"] = response["solution"]["cookies"].as_h.map { |k, v| "#{k}=#{v}" }.join("; ")
|
headers["Cookies"] = response["solution"]["cookies"].as_h?.try &.map { |k, v| "#{k}=#{v}" }.join("; ") || ""
|
||||||
response = YT_POOL.client &.post("/das_captcha", headers, form: inputs)
|
response = YT_POOL.client &.post("/das_captcha", headers, form: inputs)
|
||||||
|
|
||||||
yield response.cookies.select { |cookie| cookie.name != "PREF" }
|
yield response.cookies.select { |cookie| cookie.name != "PREF" }
|
||||||
|
@ -296,7 +296,7 @@ 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
|
||||||
headers["Cookies"] = response["solution"]["cookies"].as_h.map { |k, v| "#{k}=#{v}" }.join("; ")
|
headers["Cookies"] = response["solution"]["cookies"].as_h?.try &.map { |k, v| "#{k}=#{v}" }.join("; ") || ""
|
||||||
response = YT_POOL.client &.post("/sorry/index", headers: headers, form: inputs)
|
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],
|
||||||
|
|
Loading…
Reference in a new issue