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

Kode ini menjalankan fungsi berikut: mengunduh proxy dari URL yang ditentukan, membaginya menjadi string, dan menulisnya ke file yang sesuai.

Komentar (0)

Belum ada komentar di sini, Anda bisa menjadi yang pertama!

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *


Pilih dan Beli Proxy

Proksi Pusat Data

Memutar Proxy

Proksi UDP

Dipercaya Oleh 10.000+ Pelanggan di Seluruh Dunia

Pelanggan Proksi
Pelanggan Proksi
Pelanggan Proksi flowch.ai
Pelanggan Proksi
Pelanggan Proksi
Pelanggan Proksi