<?php

function getProxies($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($ch);
    curl_close($ch);
    return explode("\n", $result);
}

$httpsProxies = getProxies('https://api.proxyscrape.com/?request=displayproxies&proxytype=https&timeout=7000&country=ALL&anonymity=elite&ssl=no');
$httpProxies = getProxies('https://api.proxyscrape.com/?request=displayproxies&proxytype=http&timeout=7000&country=ALL&anonymity=elite&ssl=no');
$socks4Proxies = getProxies('https://www.proxy-list.download/api/v1/get?type=socks4');
$socks5Proxies = getProxies('https://www.proxy-list.download/api/v1/get?type=socks5');

file_put_contents('https.txt', implode("\n", $httpsProxies));
file_put_contents('http.txt', implode("\n", $httpProxies));
file_put_contents('socks4.txt', implode("\n", $socks4Proxies));
file_put_contents('socks5.txt', implode("\n", $socks5Proxies));

echo "All proxies successfully grabbed & saved\n";
?>

此代码执行以下功能:从指定的 URL 下载代理,将其拆分为字符串并将其写入适当的文件。

评论 (0)

这里还没有评论,你可以成为第一个评论者!

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注


选择和购买代理

数据中心代理

轮流代理

UDP代理机构

受到全球 10000 多家客户的信赖

代理客户
代理客户
代理客户 flowch.ai
代理客户
代理客户
代理客户