Skip to content

Instantly share code, notes, and snippets.

@Rendevior
Created December 8, 2022 10:09
Show Gist options
  • Save Rendevior/05dca7a6bee932d33b79e6b84aba6452 to your computer and use it in GitHub Desktop.
Save Rendevior/05dca7a6bee932d33b79e6b84aba6452 to your computer and use it in GitHub Desktop.
get an proxy and out it to proxy.txt
#!/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