Forráskód Böngészése

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

chengchongzhen 1 éve
szülő
commit
c404d0de31
1 módosított fájl, 4 hozzáadás és 1 törlés
  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 = (