mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
Check /browse_ajax for channel blocks
This commit is contained in:
parent
b7a7abed48
commit
a2c5211b20
@ -236,7 +236,8 @@ end
|
||||
def bypass_captcha(captcha_key, logger)
|
||||
loop do
|
||||
begin
|
||||
response = YT_POOL.client &.get("/watch?v=CvFH_6DNRCY&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999")
|
||||
{"/watch?v=CvFH_6DNRCY&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999", produce_channel_videos_url(ucid: "UCXuqSBlHAE6Xw-yeJA0Tunw")}.each do |path|
|
||||
response = YT_POOL.client &.get(path)
|
||||
if response.body.includes?("To continue with your YouTube experience, please fill out the form below.")
|
||||
html = XML.parse_html(response.body)
|
||||
form = html.xpath_node(%(//form[@action="/das_captcha"])).not_nil!
|
||||
@ -253,15 +254,8 @@ def bypass_captcha(captcha_key, logger)
|
||||
"clientKey" => CONFIG.captcha_key,
|
||||
"task" => {
|
||||
"type" => "NoCaptchaTaskProxyless",
|
||||
# "type" => "NoCaptchaTask",
|
||||
"websiteURL" => "https://www.youtube.com/watch?v=CvFH_6DNRCY&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999",
|
||||
"websiteKey" => site_key,
|
||||
# "proxyType" => "http",
|
||||
# "proxyAddress" => CONFIG.proxy_address,
|
||||
# "proxyPort" => CONFIG.proxy_port,
|
||||
# "proxyLogin" => CONFIG.proxy_user,
|
||||
# "proxyPassword" => CONFIG.proxy_pass,
|
||||
# "userAgent" => "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36",
|
||||
},
|
||||
}.to_json).body)
|
||||
|
||||
@ -345,6 +339,7 @@ def bypass_captcha(captcha_key, logger)
|
||||
|
||||
yield cookies
|
||||
end
|
||||
end
|
||||
rescue ex
|
||||
logger.puts("Exception: #{ex.message}")
|
||||
ensure
|
||||
|
Loading…
Reference in New Issue
Block a user