Overhaul geo-bypass

This commit is contained in:
Omar Roth
2018-09-25 17:56:59 -05:00
parent 5b5d69a33b
commit 3e3de1890a
4 changed files with 70 additions and 19 deletions

View File

@@ -108,7 +108,15 @@ def get_proxies(country_code = "US")
"xf4" => "0",
"xf5" => "1",
}
response = client.post("/free-proxy-list/#{country_code}/", headers, form: body)
20.times do
if response.status_code == 200
break
end
response = client.post("/free-proxy-list/#{country_code}/", headers, form: body)
end
response = XML.parse_html(response.body)
mapping = response.xpath_node(%q(.//body/script)).not_nil!.content