From 882e2341bdc2f8ca2a39ce25f4ed5f3aed98148a Mon Sep 17 00:00:00 2001 From: Leslie Lu Date: Thu, 4 Jun 2026 16:47:56 +0800 Subject: [PATCH] fix: pass token_proxy into register_one to avoid NameError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit register_one referenced token_proxy, which is only defined in main()'s scope and is neither a parameter nor a global. On any successful registration, the line `token_data["proxy"] = token_proxy` raised NameError, which the surrounding except swallowed as a retry — so every registration failed at the final step and the run ended with 0 registered. Add token_proxy as a parameter to register_one and pass it from main(). Co-Authored-By: Claude Opus 4.8 --- reg_distributed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reg_distributed.py b/reg_distributed.py index b233ffc..f259e3f 100644 --- a/reg_distributed.py +++ b/reg_distributed.py @@ -117,7 +117,7 @@ def push_to_all_instances(instances: List[str], token_data: dict, def register_one(email_provider: CFEmailProvider, proxies: dict | None, - proxy: str, retry: int = 3, retry_delay: float = 10.0) -> dict | None: + proxy: str, token_proxy: str = "", retry: int = 3, retry_delay: float = 10.0) -> dict | None: """Attempt to register a single account with retry.""" for attempt in range(1, retry + 1): if _shutdown: @@ -237,7 +237,7 @@ def main(): _log(f"{label} Registering account...") token_data = register_one( - email_provider, reg_proxies, reg_proxy, + email_provider, reg_proxies, reg_proxy, token_proxy, retry=args.retry, retry_delay=args.retry_delay, )