Files
douyin-captcha/try/rate_limit_probe.py
杨豪 cae37465d2 feat: 尺度精修上线,首次机器 PASS(live_160548 s=1.0375)
- method_l_shape: OK 候选尺度 ±0.0375 精修(步长 0.0125 + ±6px 窗口),
  GT live_165204 Δ 179→176(真人 177),离线 9/10 保持
- 插桩 JSON.stringify 捕获 SDK 日志明文;指针 probe 排除 coalesced/pressure
- 拖动不跟手指标作废:post_pos 晚于 SDK 重置滑块,鼠标事件流始终完整
- 剩余 VerifyErr = 候选整体选错(视觉确证),方向:多候选质量评估
- docs: experiments/solution/retrospective 同步收尾
2026-09-15 16:20:05 +08:00

39 lines
1.2 KiB
Python

"""低频位探测:每 WAIT 秒单次干净尝试(只选高质量题),直到通过或轮次用完。
用法: python try/rate_limit_probe.py [wait_sec] [rounds] [max_score]
"""
import asyncio
import sys
import cold_start_attempt as csa
async def main():
try:
wait_sec = int(sys.argv[1]) if len(sys.argv) > 1 else 600
rounds = int(sys.argv[2]) if len(sys.argv) > 2 else 6
max_score = float(sys.argv[3]) if len(sys.argv) > 3 else 5.0
except ValueError:
print("用法: python try/rate_limit_probe.py [wait_sec] [rounds] [max_score]",
file=sys.stderr)
return
for i in range(rounds):
print(f"===== round {i + 1}/{rounds} =====", flush=True)
try:
r = await csa.main_once(max_questions=4, max_score=max_score)
except RuntimeError as e:
print(f"attempt error: {e}", flush=True)
r = "error"
print(f"round {i + 1} -> {r}", flush=True)
if r == "PASS":
print("*** PASS ***", flush=True)
return
if i < rounds - 1:
print(f"冷却 {wait_sec}s...", flush=True)
await asyncio.sleep(wait_sec)
print("轮次用完", flush=True)
if __name__ == "__main__":
asyncio.run(main())