@@ -982,16 +982,19 @@ def _uc_gui_click_captcha(
982982 _uc_gui_click_x_y (driver , x , y , timeframe = 0.95 )
983983 except Exception :
984984 pass
985- reconnect_time = (float (constants .UC .RECONNECT_TIME ) / 2.0 ) + 0.5
985+ reconnect_time = (float (constants .UC .RECONNECT_TIME ) / 2.0 ) + 0.6
986986 if IS_LINUX :
987987 reconnect_time = constants .UC .RECONNECT_TIME + 0.2
988988 if not x or not y :
989989 reconnect_time = 1 # Make it quick (it already failed)
990990 driver .reconnect (reconnect_time )
991- if blind or ( IS_LINUX and "Just a moment" in driver . title ):
992- retry = True
991+ caught = False
992+ if driver . is_element_present ( ".footer .clearfix .ray-id" ):
993993 blind = True
994- if retry and x and y and _on_a_captcha_page (driver ):
994+ caught = True
995+ if blind :
996+ retry = True
997+ if retry and x and y and (caught or _on_a_captcha_page (driver )):
995998 with gui_lock : # Prevent issues with multiple processes
996999 # Make sure the window is on top
9971000 page_actions .switch_to_window (
@@ -1056,11 +1059,7 @@ def uc_gui_click_cf(driver, frame="iframe", retry=False, blind=False):
10561059 )
10571060
10581061
1059- def _uc_gui_handle_captcha (
1060- driver ,
1061- frame = "iframe" ,
1062- ctype = None ,
1063- ):
1062+ def _uc_gui_handle_captcha_ (driver , frame = "iframe" , ctype = None ):
10641063 if ctype == "cf_t" :
10651064 if not _on_a_cf_turnstile_page (driver ):
10661065 return
@@ -1202,12 +1201,19 @@ def _uc_gui_handle_captcha(
12021201 pyautogui .press (" " )
12031202 except Exception :
12041203 pass
1205- reconnect_time = (float (constants .UC .RECONNECT_TIME ) / 2.0 ) + 0.5
1204+ reconnect_time = (float (constants .UC .RECONNECT_TIME ) / 2.0 ) + 0.6
12061205 if IS_LINUX :
12071206 reconnect_time = constants .UC .RECONNECT_TIME + 0.2
12081207 driver .reconnect (reconnect_time )
12091208
12101209
1210+ def _uc_gui_handle_captcha (driver , frame = "iframe" , ctype = None ):
1211+ _uc_gui_handle_captcha_ (driver , frame = frame , ctype = ctype )
1212+ if driver .is_element_present (".footer .clearfix .ray-id" ):
1213+ driver .uc_open_with_reconnect (driver .current_url , 3.8 )
1214+ _uc_gui_handle_captcha_ (driver , frame = frame , ctype = ctype )
1215+
1216+
12111217def uc_gui_handle_captcha (driver , frame = "iframe" ):
12121218 _uc_gui_handle_captcha (driver , frame = frame , ctype = None )
12131219
0 commit comments