mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-02 20:47:35 +08:00
fix 1.0.5
This commit is contained in:
parent
3edef109d4
commit
0f4cf16d90
@ -18,11 +18,15 @@ a = Analysis(
|
|||||||
('uBlock0.chromium', 'uBlock0.chromium'),
|
('uBlock0.chromium', 'uBlock0.chromium'),
|
||||||
('cursor_auth.py', '.'),
|
('cursor_auth.py', '.'),
|
||||||
('reset_machine_manual.py', '.'),
|
('reset_machine_manual.py', '.'),
|
||||||
('cursor_register.py', '.')
|
('cursor_register.py', '.'),
|
||||||
|
('browser.py', '.'),
|
||||||
|
('control.py', '.')
|
||||||
],
|
],
|
||||||
hiddenimports=[
|
hiddenimports=[
|
||||||
'cursor_auth',
|
'cursor_auth',
|
||||||
'reset_machine_manual'
|
'reset_machine_manual',
|
||||||
|
'browser',
|
||||||
|
'control'
|
||||||
],
|
],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
|
31
control.py
31
control.py
@ -215,27 +215,28 @@ class BrowserControl:
|
|||||||
def get_verification_code(self):
|
def get_verification_code(self):
|
||||||
"""从邮件中获取验证码"""
|
"""从邮件中获取验证码"""
|
||||||
try:
|
try:
|
||||||
# 使用新的 XPath 定位验证码
|
# 尝试所有可能的样式组合
|
||||||
code_div = self.browser.ele('xpath://div[contains(@style, "font-family:-apple-system") and contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px") and contains(@style, "color:#202020")]')
|
selectors = [
|
||||||
|
# 新样式
|
||||||
# 如果找不到,尝试备用选择器
|
'xpath://div[contains(@style, "font-family:-apple-system") and contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px") and contains(@style, "color:#202020")]',
|
||||||
if not code_div:
|
# 带行高的样式
|
||||||
code_div = self.browser.ele('xpath://div[contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px") and contains(@style, "line-height:30px")]')
|
'xpath://div[contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px") and contains(@style, "line-height:30px")]',
|
||||||
|
# rgba 颜色样式
|
||||||
# 如果还找不到,尝试更宽松的选择器
|
'xpath://div[contains(@style, "font-size: 28px") and contains(@style, "letter-spacing: 2px") and contains(@style, "color: rgba(32, 32, 32, 1)")]',
|
||||||
if not code_div:
|
# 宽松样式
|
||||||
code_div = self.browser.ele('xpath://div[contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px")]')
|
'xpath://div[contains(@style, "font-size:28px") and contains(@style, "letter-spacing:2px")]'
|
||||||
|
]
|
||||||
|
|
||||||
|
# 依次尝试每个选择器
|
||||||
|
for selector in selectors:
|
||||||
|
code_div = self.browser.ele(selector)
|
||||||
if code_div:
|
if code_div:
|
||||||
verification_code = code_div.text.strip()
|
verification_code = code_div.text.strip()
|
||||||
if verification_code.isdigit() and len(verification_code) == 6:
|
if verification_code.isdigit() and len(verification_code) == 6:
|
||||||
print(f"{Fore.GREEN}Found Verification Code | 找到验证码: {verification_code}{Style.RESET_ALL}")
|
print(f"{Fore.GREEN}Found Verification Code | 找到验证码: {verification_code}{Style.RESET_ALL}")
|
||||||
return verification_code
|
return verification_code
|
||||||
else:
|
|
||||||
print(f"{Fore.RED}Verification Code Format Error | 验证码格式不正确: {verification_code}{Style.RESET_ALL}")
|
print(f"{Fore.YELLOW}No Valid Verification Code Found | 未找到有效验证码{Style.RESET_ALL}")
|
||||||
return None
|
|
||||||
else:
|
|
||||||
print(f"{Fore.YELLOW}No Verification Code Found | 未找到验证码{Style.RESET_ALL}")
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
BIN
images/fix_2025-01-14_21-30-43.png
Normal file
BIN
images/fix_2025-01-14_21-30-43.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 252 KiB |
Loading…
x
Reference in New Issue
Block a user