KeyHunter parser v10 + 18 scanners + tests (synthetic fixtures only, no keys/db/tokens)
This commit is contained in:
27
export_working.py
Normal file
27
export_working.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Export all live keys (WORKING/FREE/LIMITED) → data/working_keys.txt
|
||||
in eternal_v10 format: ts | PROV | val | plan | price | remaining."""
|
||||
import sqlite3
|
||||
import time
|
||||
|
||||
DB = "data/keys.db"
|
||||
OUT = "data/working_keys.txt"
|
||||
|
||||
db = sqlite3.connect(DB, timeout=120)
|
||||
c = db.cursor()
|
||||
c.execute("SELECT val, prov, plan, price, remaining FROM keys "
|
||||
"WHERE status IN ('WORKING','FREE','LIMITED') "
|
||||
"ORDER BY prov, val")
|
||||
rows = c.fetchall()
|
||||
db.close()
|
||||
|
||||
ts = time.strftime("%Y-%m-%dT%H:%M:%S")
|
||||
lines = []
|
||||
for val, prov, plan, price, remaining in rows:
|
||||
lines.append(f"{ts} | {prov} | {val} | {plan or ''} | {price or ''} | remaining={remaining or ''}")
|
||||
|
||||
tmp = OUT + ".tmp"
|
||||
with open(tmp, "w", encoding="utf-8") as f:
|
||||
f.write("\n".join(lines) + "\n")
|
||||
import os
|
||||
os.replace(tmp, OUT)
|
||||
print(f"exported {len(lines)} live keys -> {OUT}")
|
||||
Reference in New Issue
Block a user