import re, requests, uuid
GATE = "gate.aeonproxy.com:7000"
# Country key only. Lookups print registered holders: AS15389 reads P/F Telefonverkid (Føroya Tele)
# and AS20963 reads NEMA P/F 20.11.19, so name the network from the ASN.
NET = {"AS15389": "Føroya Tele", "AS20963": "Nema", "AS206928": "Elektron"}
def faroese_exit(tries=8):
for _ in range(tries):
sid = uuid.uuid4().hex[:8]
proxy = f"http://ap_a1b2c3-cc-fo-sid-{sid}-time-1800:PASS@{GATE}"
try:
geo = requests.get("https://ipinfo.io/json", proxies={"http": proxy, "https": proxy}, timeout=15).json()
except requests.RequestException:
continue # no answer: open another session
if geo.get("country") != "FO":
continue # outside the islands: skip it
geo["network"] = NET.get(geo.get("org", "").split(" ")[0], geo.get("org"))
return proxy, geo # this exit holds for 30 minutes
return None, None
def kr(text):
# "1.795.000 kr.", "Kr. 2.150.000" and "1.325,00 kr." all appear on Faroese sites
m = re.search(r"(\d[\d.]*)(?:,\d\d)?", text)
return int(m.group(1).replace(".", "")) if m else None
proxy, geo = faroese_exit()
if proxy:
print(geo["ip"], geo.get("city"), geo["network"], kr("Kr. 2.150.000"))
Dots mark thousands on these sites and a comma marks decimals.