|
|
@ -236,7 +236,8 @@ end
|
|
|
|
def bypass_captcha(captcha_key, logger)
|
|
|
|
def bypass_captcha(captcha_key, logger)
|
|
|
|
loop do
|
|
|
|
loop do
|
|
|
|
begin
|
|
|
|
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.")
|
|
|
|
if response.body.includes?("To continue with your YouTube experience, please fill out the form below.")
|
|
|
|
html = XML.parse_html(response.body)
|
|
|
|
html = XML.parse_html(response.body)
|
|
|
|
form = html.xpath_node(%(//form[@action="/das_captcha"])).not_nil!
|
|
|
|
form = html.xpath_node(%(//form[@action="/das_captcha"])).not_nil!
|
|
|
@ -253,15 +254,8 @@ def bypass_captcha(captcha_key, logger)
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"clientKey" => CONFIG.captcha_key,
|
|
|
|
"task" => {
|
|
|
|
"task" => {
|
|
|
|
"type" => "NoCaptchaTaskProxyless",
|
|
|
|
"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",
|
|
|
|
"websiteURL" => "https://www.youtube.com/watch?v=CvFH_6DNRCY&gl=US&hl=en&disable_polymer=1&has_verified=1&bpctr=9999999999",
|
|
|
|
"websiteKey" => site_key,
|
|
|
|
"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)
|
|
|
|
}.to_json).body)
|
|
|
|
|
|
|
|
|
|
|
@ -345,6 +339,7 @@ def bypass_captcha(captcha_key, logger)
|
|
|
|
|
|
|
|
|
|
|
|
yield cookies
|
|
|
|
yield cookies
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
logger.puts("Exception: #{ex.message}")
|
|
|
|
logger.puts("Exception: #{ex.message}")
|
|
|
|
ensure
|
|
|
|
ensure
|
|
|
|