Skip to content

Commit

Permalink
feat: custom proxyType
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamyplayer committed Sep 28, 2022
1 parent b93935c commit df746ae
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,16 @@ async function grabProxies() {

if (autoGrabProxies) {
lastGrab = Date.now();
await fetch(`https://api.proxyscrape.com/?request=displayproxies&status=alive&proxytype=socks5`).then(async res => {
const body = await res.text();
const lines = body.split('\n').filter(line => !proxies.find(p => p.proxy === line));
log(`${bgBlue('[AUTO]')} grabbed ${yellow(lines.length)} proxies.`);
for (let line of lines) {
proxies.push(new Proxy(line, (proxies[proxies.length - 1]?.id || 0) + 1));
}
});
await fetch(`https://api.proxyscrape.com/?request=displayproxies&status=alive&proxytype=${proxiesType}`).then(
async res => {
const body = await res.text();
const lines = body.split('\n').filter(line => !proxies.find(p => p.proxy === line));
log(`${bgBlue('[AUTO]')} grabbed ${yellow(lines.length)} proxies.`);
for (let line of lines) {
proxies.push(new Proxy(line, (proxies[proxies.length - 1]?.id || 0) + 1));
}
},
);
}
}

Expand Down

0 comments on commit df746ae

Please sign in to comment.