<?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";
?>

Mã này thực hiện các chức năng sau: tải xuống proxy từ các URL được chỉ định, chia chúng thành chuỗi và ghi chúng vào các tệp thích hợp.

Bình luận (0)

Chưa có bình luận nào ở đây, bạn có thể là người đầu tiên!

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *


Chọn và mua proxy

Proxy trung tâm dữ liệu

Proxy luân phiên

Proxy UDP

Được tin cậy bởi hơn 10000 khách hàng trên toàn thế giới

Khách hàng ủy quyền
Khách hàng ủy quyền
Khách hàng proxy flowch.ai
Khách hàng ủy quyền
Khách hàng ủy quyền
Khách hàng ủy quyền