Created
March 9, 2024 01:14
-
-
Save ricardomaia/b3aa2f844d6aa8d4b33154bfcc4dd113 to your computer and use it in GitHub Desktop.
Creating a file with a list of proxies
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
#!/usr/bin/env bash | |
# Download proxies list | |
curl -k https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt -o proxy_list.txt | |
sed -i -e 's/^/http:\/\//' proxy_list.t |
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
#!/usr/bin/env bash | |
proxy_list="proxy_list.txt" | |
proxy_list_BR="proxy_list_brazil.txt" | |
if ! [ -f "$proxy_list" ]; then | |
echo "File $proxy_list not found. Please, execute the 'update_proxies.sh' script." | |
exit 1 | |
fi | |
if ! command geoiplookup -h &> /dev/null | |
then | |
echo "geoiplookup could not be found. Install it with the command:" | |
echo "sudo apt install geoip-bin" | |
exit 1 | |
fi | |
while IFS= read -r line; do | |
protocol=$(echo "$line" | awk -F '://' '{print $1}') | |
ip_port=$(echo "$line" | awk -F '://' '{print $2}') | |
ip=$(echo "$ip_port" | cut -d ':' -f 1) | |
port=$(echo "$ip_port" | cut -d ':' -f 2) | |
location=$(geoiplookup "$ip" | awk -F ', ' '{print $2}') | |
if [ "$location" == "Brazil" ]; then | |
echo "$protocol://$ip:$port" >> "$proxy_list_BR" | |
echo "Brazilian proxy found: $protocol://$ip:$port" | |
fi | |
done < "$proxy_list" | |
echo "All proxies saved into $proxy_list_BR file." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment