theos farm: 5 grants per egress IP (1834 theos/6 IP), rotate_farm, farm_grant, bd_probe, checkin/ip probes, tool-use+roundtrip proof

This commit is contained in:
ENI
2026-11-14 16:16:18 +02:00
parent f28fa6c9c2
commit 2bc5214557
19 changed files with 1134 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
"""Проверка IP-гипотезы: чекаем нулевые аккаунты через ДРУГОЙ egress (прокси).
python ip_probe.py <proxy_url> [n]
"""
import json
import sys
import dpcode as D
def rows(n):
recs = {}
for line in open(D.BANK, encoding="utf-8"):
line = line.strip()
if not line:
continue
r = json.loads(line)
if r.get("cookies"):
recs[r["email"]] = r
zero = [r for r in recs.values()
if float(((r.get("theos") or {}).get("granted")) or 0) == 0]
return zero[:n]
def main():
px = sys.argv[1] if len(sys.argv) > 1 else "http://127.0.0.1:8899"
n = int(sys.argv[2]) if len(sys.argv) > 2 else 4
proxies = {"http": px, "https": px}
for rec in rows(n):
email = rec["email"]
machine = rec.get("machine") or D.machine_header(salt=email)
s = D.session_from(rec)
s.proxies.update(proxies)
try:
st, d = D.theos(s, machine)
except Exception as e:
print("%-42s ERR %s" % (email, str(e)[:60]), flush=True)
continue
if isinstance(d, dict):
print("%-42s http=%s bal=%s granted=%s refresh=%s"
% (email, st, d.get("balance"), d.get("granted"), d.get("refresh_at")), flush=True)
if float(d.get("balance") or 0) > 0 or float(d.get("granted") or 0) > 0:
rec["theos"] = d
D.append_bank(rec)
else:
print("%-42s http=%s %s" % (email, st, str(d)[:80]), flush=True)
if __name__ == "__main__":
main()