import requests, uuid
GATE = "gate.aeonproxy.com:7000"
# Country key only. Lookups and Tajik sites print one town in several forms,
# so fold them into one name before you group results by town.
TOWN = {"Kurgan-Tyube": "Bokhtar", "Курган-Тюбе": "Bokhtar", "Chkalov": "Buston", "Куляб": "Kulob",
"Гиссар": "Hisor", "Турсунзаде": "Tursunzoda", "Пенджикент": "Panjakent", "Канибадам": "Konibodom"}
CARRIER = {"AS43197": "MegaFon", "AS47139": "Tcell", "AS48887": "Tcell", "AS204106": "Babilon Mobile",
"AS34557": "ZET-Mobile", "AS24722": "Babilon-T", "AS51346": "Tojiktelecom", "AS8847": "TTL"}
def tajik_exit(tries=10):
for _ in range(tries):
proxy = f"http://ap_a1b2c3-cc-tj-sid-{uuid.uuid4().hex[:8]}-time-1800:PASS@{GATE}"
try:
seen = requests.get("https://ipinfo.io/json", proxies={"http": proxy, "https": proxy}, timeout=25).json()
except requests.RequestException:
continue # no answer: try a new session
if seen.get("country") != "TJ":
continue # wrong country: try a new session
seen["town"] = TOWN.get(seen.get("city"), seen.get("city"))
seen["carrier"] = CARRIER.get(seen.get("org", "").split(" ")[0], seen.get("org"))
return proxy, seen # this exit stays for 30 minutes
return None, None
proxy, seen = tajik_exit()
if proxy:
print(seen["ip"], seen["town"], seen["carrier"])
Extend TOWN with the forms your target sites print. -time- takes 60 to 21600 seconds, and removing -sid- rotates the exit on each request. The carrier comes from the ASN because ISP and carrier keys are limited to US, UK and German logins.