import json import os from pathlib import Path def _local_secrets(): path = Path(__file__).resolve().parent / "config" / "secrets.json" if not path.exists(): return {} with path.open(encoding="utf-8") as stream: return json.load(stream) _SECRETS = _local_secrets() def _setting(name, default=""): return os.environ.get(name, _SECRETS.get(name, default)) CLOUD_API_BASE_URL = _setting("CLOUD_API_BASE_URL", "https://api.text.skin") CLOUD_API_TOKEN = _setting("CLOUD_API_TOKEN") # LLM General Captcha recognition config (supports OpenAI, Qwen, DeepSeek compatible endpoints) CAPTCHA_LLM_CONFIG = None CAPTCHA_LLM_CONFIG = { "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1", "api_key": _setting("CAPTCHA_LLM_API_KEY"), "model": "qwen3-vl-plus", "timeout": 30.0, } REDIS_CFG = { "host": _setting("REDIS_HOST", "text.skin"), "port": int(_setting("REDIS_PORT", "6379")), "db": int(_setting("REDIS_DB", "0")), "password": _setting("REDIS_PASSWORD") or None } # Test task: when configured, task rotation directly uses this task TEST_TASK = None # TEST_TASK = { # "status": "running", # "priority": 10, # "config": { # "select": "random", # "alias_email": "mariaandrews2240@gmail-app.com", # "time_filter": ["AM","PM"], # "exclude_dates": [], # "include_today": True, # "allowed_weekdays": [1,2,3,4,5], # "include_tomorrow": True # }, # "user_inputs": { # "email": "mariaandrews2240@gmail-app.com", # "password": "Visafly@111", # "username": "mariaandrews2240@gmail-app.com", # "support_pta": False, # "expected_end_date": "2026-06-30", # "expected_start_date": "2026-05-01" # }, # "grabbed_history": {}, # "meta": None, # "id": 0, # "order_id": "ORD-20260415100806-0fdee58d", # "routing_key": "auto.slot.lon.fr.tourist", # "script_version": "latest", # "attempt_count": 0, # "notify_count": 0, # "created_at": "2000-01-01T01:00:00", # "updated_at": "2000-01-01T01:00:00", # "expire_at": "2000-01-01T01:00:00" # } # Test account: when configured, account rotation directly uses this account TEST_ACCOUNT = None # TEST_ACCOUNT = { # "pool_name": "tls.gb.fr.sentinel", # "username": "robertolord2257@gmail-app.com", # "password": "Visafly@111", # "extra_data": {}, # "status": "active", # "next_use_time": "2000-01-01T01:00:00", # "id": 0, # "created_at": "2000-01-01T01:00:00", # "updated_at": "2000-01-01T01:00:00" # } # Test proxy: when configured, proxy rotation directly uses this proxy TEST_PROXY = None # TEST_PROXY = { # "pool_name": "local", # "proto": "http", # "ip": "127.0.0.1", # "port": 7890, # "username": "", # "password": "", # "id": 0 # } # Node ID config: highest priority, then NODE_ID env var, then default "node01" NODE_ID = None # NODE_ID = "node" # Chrome binary path: highest priority, then CHROME_BIN env var, then default CHROME_PATH = None # CHROME_PATH = "E:/ungoogled-chromium_148.0.7778.215-1.1_windows_x64/chrome.exe" # Mihomo binary path: highest priority, then MIHOMO_BIN env var, then default MIHOMO_BIN_PATH = None # MIHOMO_BIN_PATH = 'downloads/mihomo' # Proxy tunnel relay nodes, randomly chosen from list MIHOMO_RELAY_NODES = None # MIHOMO_RELAY_NODES = [ # { # "name": "RelayNode jp 01 | 1x", # "type": "ss", # "server": "odko6qmr.mobilfunk.top", # "port": 12012, # "cipher": "aes-128-gcm", # "password": "haMLMXirByn6rGVh", # "plugin": "obfs", # "plugin-opts": { # "mode": "http", # "host": "c0f69828a7c1.microsoft.com" # }, # "udp": True # }, # { # "name": "RelayNode hk 01 | 1x", # "type": "ss", # "server": "e0405950-3002-4dc8-860b-8fac3ffdd76c.drive-glicloudccp.com", # "port": 12022, # "cipher": "aes-128-gcm", # "password": "haMLMXirByn6rGVh", # "plugin": "obfs", # "plugin-opts": { # "mode": "http", # "host": "c0f69828a7c1.microsoft.com" # }, # "udp": True # }, # { # "name": "RelayNode hk 02 | 1x", # "type": "ss", # "server": "e0405950-3002-4dc8-860b-8fac3ffdd76c.drive-glicloudccp.com", # "port": 12023, # "cipher": "aes-128-gcm", # "password": "haMLMXirByn6rGVh", # "plugin": "obfs", # "plugin-opts": { # "mode": "http", # "host": "c0f69828a7c1.microsoft.com" # }, # "udp": True # }, # { # "name": "RelayNode hk 03 | 1x", # "type": "ss", # "server": "e0405950-3002-4dc8-860b-8fac3ffdd76c.drive-glicloudccp.com", # "port": 12024, # "cipher": "aes-128-gcm", # "password": "haMLMXirByn6rGVh", # "plugin": "obfs", # "plugin-opts": { # "mode": "http", # "host": "c0f69828a7c1.microsoft.com" # }, # "udp": True # } # ] # Temporary test for booking submission TLS_TEST_BOOK_AFTER_QUERY = False