Created
December 8, 2022 10:09
-
-
Save Rendevior/05dca7a6bee932d33b79e6b84aba6452 to your computer and use it in GitHub Desktop.
get an proxy and out it to proxy.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Outpul file (Default: proxy.txt) | |
out="proxy.txt" | |
# Sources | |
source=("https://api.proxyscrape.com/?request=displayproxies&proxytype=http" "https://www.proxy-list.download/api/v1/get?type=http" "https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt" "https://api.openproxylist.xyz/http.txt") | |
getprox(){ | |
for i in "${source[@]}"; do | |
curl -sLk "${i}" >> proxy.txt | |
done | |
# Check for Dupes And Redirect it to same file in Legal Method without using Variables | |
printf '%s' "$(awk '!seen[$0]++' proxy.txt)" > proxy.txt | |
# Check if Succeed and Proxy has Content | |
if grep -q '[^[:space:]]' proxy.txt; then | |
echo "success!!" | |
exit 0 | |
else | |
echo "Failed, for some reason." | |
exit 1 | |
fi | |
} | |
while getopts ":o:" opt; do | |
case "${opt}" in | |
o) output="${OPTARG}" ;; | |
esac | |
done | |
getprox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment