feat: Improve Cursor version-specific machine ID reset logic

This commit is contained in:
cheng zhen
2025-02-03 20:19:54 +08:00
parent 8d53ade612
commit 433f71cb36
2 changed files with 7 additions and 7 deletions

View File

@@ -34,9 +34,7 @@ https://linux.do/
## 请我喝杯茶 ## 请我喝杯茶
<img src="./screen/28613e3f3f23a935b66a7ba31ff4e3f.jpg" width="300"/> <img src="./screen/28613e3f3f23a935b66a7ba31ff4e3f.jpg" width="300"/> <img src="./screen/mm_facetoface_collect_qrcode_1738583247120.png" width="300"/>
<img src="./screen/mm_facetoface_collect_qrcode_1738583247120.png" width="300"/>
## 关注公众号,随时获取仓库更新动态 ## 关注公众号,随时获取仓库更新动态

View File

@@ -398,7 +398,10 @@ if __name__ == "__main__":
browser_manager = None browser_manager = None
try: try:
logging.info("\n=== 初始化程序 ===") logging.info("\n=== 初始化程序 ===")
ExitCursor() # 小于0.45的版本需要打补丁
less_than_0_45 = check_cursor_version()
if less_than_0_45:
ExitCursor()
logging.info("正在初始化浏览器...") logging.info("正在初始化浏览器...")
# 获取user_agent # 获取user_agent
@@ -453,9 +456,8 @@ if __name__ == "__main__":
) )
logging.info("重置机器码...") logging.info("重置机器码...")
# 判断cursor版本是否于0.44 # 判断cursor版本是否于0.45
is_cursor_version_greater_than_0_44 = check_cursor_version() if less_than_0_45:
if is_cursor_version_greater_than_0_44:
MachineIDResetter().reset_machine_ids() MachineIDResetter().reset_machine_ids()
else: else:
patch_cursor_get_machine_id.patch_cursor_get_machine_id() patch_cursor_get_machine_id.patch_cursor_get_machine_id()