• We just launched and are currently in beta. Join us as we build and grow the community.

Proxy Shell script

gamerster_

Funny Bone Specialist
G Rep
0
0
0
Rep
0
G Vouches
0
0
0
Vouches
0
Posts
137
Likes
158
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
PROXY SCRAPER

Hello everyone ! I came back to cracking and to give back to the community I decided to make my own shell script for whoever has an API for proxies and wants to utilize it , you can view the source code over here and copy paste it , make sure to put the correct extension "file.sh" at the end .

This code sends an http request to the api , checks if theres any errors , prints data and saves each type of proxy into .txt files
Don't forget to type in your terminal : chmod +x script.sh

SOURCE CODE :
Code:
Code:
#!/bin/bash

while true; do
# Put proxy api Here [/size]
[size=large]    PROXY_DATA=$(curl -s "http://apiurl.com")

# Check if the curl command encountered an error
if [ $? -ne 0 ]; then
echo "Failed to fetch proxy data."
sleep 10
continue
fi

# Print the entire JSON response for debugging
echo "Received JSON response: $PROXY_DATA"

# Extract proxy type and value using jq
PROXY_TYPE=$(echo "$PROXY_DATA" | jq -r '.protocol')
PROXY_VALUE=$(echo "$PROXY_DATA" | jq -r '.proxy')

# Check if proxy type or value is null
if [ "$PROXY_TYPE" = "null" ] || [ "$PROXY_VALUE" = "null" ]; then
echo "Failed to parse proxy data."
sleep 10
continue
fi

# Determine the output file based on proxy type
case "$PROXY_TYPE" in
"http")
OUTPUT_FILE="http.txt"
;;
"socks4")
OUTPUT_FILE="socks4.txt"
;;
"socks5")
OUTPUT_FILE="socks5.txt"
;;
*)
echo "Unknown proxy type: $PROXY_TYPE"
sleep 10
continue
;;
esac

# Save the proxy value to the appropriate file
echo "$PROXY_VALUE" >> "$OUTPUT_FILE"

# Display proxy details
echo "Proxy Data:"
echo "Type: $PROXY_TYPE"
echo "Value: $PROXY_VALUE"

# Sleep for a while before fetching the next proxy (adjust the sleep duration as needed)
sleep 10
done[/size][/size]
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Make sure to Like subscribe and click on the notification bell ;)
 

442,401

317,942

317,951

Top