import re, requests, uuid
GATE = "gate.aeonproxy.com:7000"
# Country key only. This key is Equatorial Guinea alone: Guinea and Guinea-Bissau have their own.
# A small pool repeats addresses, so try a few sessions and keep the job short.
NET = {"AS37173": "GETESA", "AS37337": "Muni", "AS37529": "GITGE", "AS328311": "Conexxia",
"AS328207": "Office Tech", "AS329219": "Fenix", "AS37487": "Guineanet"}
def gq_exit(tries=6):
for _ in range(tries):
login = f"ap_a1b2c3-cc-gq-sid-{uuid.uuid4().hex[:8]}-time-900"
proxy = f"http://{login}:PASS@{GATE}"
try:
geo = requests.get("https://ipinfo.io/json", proxies={"http": proxy, "https": proxy}, timeout=20).json()
except requests.RequestException:
continue # no reply: open another session
if geo.get("country") != "GQ":
continue
geo["network"] = NET.get(geo.get("org", "").split(" ")[0], geo.get("org"))
return proxy, geo # the same exit for 15 minutes
return None, None
def cfa(text):
# GETESA prints "4.500 XAF" on its home page and "4500CFA" on its product page
found = re.search(r"(\d[\d.]*)\s*(?:XAF|CFA)", text)
return int(found.group(1).replace(".", "")) if found else None
proxy, geo = gq_exit()
if proxy:
page = requests.get("https://www.getesa.gq/productos", headers={"Accept-Language": "es-GQ,es;q=0.9"},
proxies={"http": proxy, "https": proxy}, timeout=30)
print(geo["ip"], geo.get("region"), geo["network"], page.status_code, cfa(page.text))
A new session can land on an address you have just used, so pace your requests. The function can also return nothing. Set -time- anywhere from 60 to 21600 seconds; with no -sid-, every request rotates.