Add initial implementation of Cursor Pro Keep Alive tool
- Created .gitignore to exclude unnecessary files. - Added config.ini for account configuration. - Implemented cursor_auth_manager.py for managing authentication. - Developed cursor_pro_keep_alive.py for automated account management. - Included CursorKeepAlive.spec for packaging. - Added gpt-accesstoken.py for obtaining ChatGPT access tokens. - Created README.md with usage instructions. - Updated requirements.txt with necessary dependencies. - Added run_cursor.bat for script execution. - Implemented update_cursor_auth.py for updating authentication details. - Included turnstilePatch for handling CAPTCHA challenges. - Added logging functionality in log.txt for tracking script execution. - Created dist folder with packaged executable and necessary files.
This commit is contained in:
46
update_cursor_auth.py
Normal file
46
update_cursor_auth.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from cursor_auth_manager import CursorAuthManager
|
||||
|
||||
def update_cursor_auth(email=None, access_token=None, refresh_token=None):
|
||||
"""
|
||||
更新Cursor的认证信息的便捷函数
|
||||
"""
|
||||
auth_manager = CursorAuthManager()
|
||||
return auth_manager.update_auth(email, access_token, refresh_token)
|
||||
|
||||
def main():
|
||||
# 示例用法
|
||||
print("请选择要更新的项目:")
|
||||
print("1. 更新邮箱")
|
||||
print("2. 更新访问令牌")
|
||||
print("3. 更新刷新令牌")
|
||||
print("4. 更新多个值")
|
||||
print("0. 退出")
|
||||
|
||||
choice = input("\n请输入选项数字: ")
|
||||
|
||||
if choice == "1":
|
||||
email = input("请输入新的邮箱: ")
|
||||
update_cursor_auth(email=email)
|
||||
elif choice == "2":
|
||||
token = input("请输入新的访问令牌: ")
|
||||
update_cursor_auth(access_token=token)
|
||||
elif choice == "3":
|
||||
token = input("请输入新的刷新令牌: ")
|
||||
update_cursor_auth(refresh_token=token)
|
||||
elif choice == "4":
|
||||
email = input("请输入新的邮箱 (直接回车跳过): ")
|
||||
access_token = input("请输入新的访问令牌 (直接回车跳过): ")
|
||||
refresh_token = input("请输入新的刷新令牌 (直接回车跳过): ")
|
||||
|
||||
update_cursor_auth(
|
||||
email=email if email else None,
|
||||
access_token=access_token if access_token else None,
|
||||
refresh_token=refresh_token if refresh_token else None
|
||||
)
|
||||
elif choice == "0":
|
||||
print("退出程序")
|
||||
else:
|
||||
print("无效的选项")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user