[需要一些想法,我使用了外部API(流放路径),但意外达到了最大值。请求限制,因此我的vServer现在被(Cloudflare)阻止了。当我现在想访问api时,我得到以下信息
“还有一步,请完成安全检查才能访问www.pathofexile.com“
ecetera ecetera然后从理论上讲Google Captcha出现了。
问题是我需要一个图形浏览器来解决验证码/安全检查,对吗?什么是现在解决验证码的最佳解决方案?我正在考虑通过某种方式隧穿我自己的浏览器并假装成为服务器的方式,这可能吗?如果是的话,谷歌的关键词会有所帮助。
或者有人会建议仅在控制台上使用的更简单的解决方案吗?或使用简单的php脚本(例如,在临时文件中添加file_put_contents,然后将其放入iframe中,但事先替换一些url /路径?)
我想问题不在代码中,但在这里
$realm = "pc";
$league = "Standard";
$uiagent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36';
$poeurl = 'https://www.pathofexile.com/character-window/get-stash-items?league=' . $league . '&realm=' . $realm . '&accountName=' . $_COOKIE["accountname"] . '&tabs=0&tabIndex=' . $_GET['no'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $poeurl);
curl_setopt($ch, CURLOPT_USERAGENT, $uiagent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'POESESSID');
curl_setopt($ch, CURLOPT_COOKIEFILE,'/var/www/vhosts/XXXXXXXXX.de/www/html/poe/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIE, "POESESSID=b34637XXXXXXXXXXXXXXX");
curl_setopt($ch, CURLOPT_COOKIEFILE, '/var/www/vhosts/XXXXXXXXX.de/www/html/poe/cookie.txt');
$answer = curl_exec($ch);
if (curl_error($ch)) {
echo curl_error($ch);
} else {
echo $answer;
file_put_contents(getcwd() . "/cache/" . $_COOKIE["accountname"] . "/stash-" . $_GET['no'] . ".json", $answer);
}
最终解决了
好吧,希望有一天能对某人有所帮助。这是我解决问题的方法。
由于我可以通过腻子进行SSH访问,因此我更改了Firefox中的连接设置,以通过服务器使用腻子隧道,这样,当我在FireFox中访问服务器时,目标API从服务器获取了IP,我可以解决验证码,出奇的简单。这里有一篇博客文章如何做到这一点:https://www.adamfowlerit.com/2013/01/using-firefox-with-a-putty-ssh-tunnel-as-a-socks-proxy/