فهرست منبع

refactor: replace fixed sleep duration with dynamic wait time in sign_up_account function for improved user experience

chengchongzhen 1 سال پیش
والد
کامیت
c404d0de31
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      cursor_pro_keep_alive.py

+ 4 - 1
cursor_pro_keep_alive.py

@@ -291,7 +291,10 @@ def sign_up_account(browser, tab):
             print(e)
 
     handle_turnstile(tab)
-    time.sleep(8)
+    wait_time = random.randint(3, 6)
+    for i in range(wait_time):
+        print(f"等待中... {wait_time-i}秒")
+        time.sleep(1)
     tab.get(settings_url)
     try:
         usage_selector = (