cursor免费版用了50次会limit。
下面是python代码,直接运行即可。
工具已经打包成exe可以在win上运行。
具体操作可以参考 风车

import os
import json
import uuid  # 导入uuid库以生成唯一ID


def get_current_id(file_path):
    """获取当前的机器ID"""
    if os.path.exists(file_path):
        with open(file_path, "r", encoding="utf-8") as f:
            try:
                data = json.load(f)
                return data.get("telemetry.machineId", "未找到机器ID")
            except json.JSONDecodeError:
                return "文件格式错误"
    return "文件不存在"


def generate_new_id():
    """生成新的唯一机器ID"""
    return str(uuid.uuid4())  # 生成一个UUID作为新的机器ID


def backup_file(file_path):
    """备份文件"""
    if os.path.exists(file_path):
        os.rename(file_path, file_path + ".bak")


def update_machine_id(file_path, new_id):
    """更新机器ID"""
    os.makedirs(os.path.dirname(file_path), exist_ok=True)

    # 如果文件不存在,创建一个空文件
    if not os.path.exists(file_path):
        with open(file_path, "w", encoding="utf-8") as f:
            json.dump({}, f)

    # 读取当前数据并更新机器ID
    with open(file_path, "r", encoding="utf-8") as f:
        try:
            data = json.load(f)
        except json.JSONDecodeError:
            data = {}

    data["telemetry.machineId"] = new_id

    with open(file_path, "w", encoding="utf-8") as f:
        json.dump(data, f, indent=4, ensure_ascii=False)

    print(f"已成功修改 machineId 为: {new_id}")


if __name__ == "__main__":
    storage_file = "C:/path/to/storage.json"  # 修改为实际路径

    # 获取当前的机器ID
    current_id = get_current_id(storage_file)
    print(f"当前机器ID: {current_id}")

    # 生成新的机器ID
    new_id = generate_new_id()

    # 备份并更新机器ID
    backup_file(storage_file)
    update_machine_id(storage_file, new_id)

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐