{"id":27401193,"url":"https://github.com/lilittlecat/leetcode-tools","last_synced_at":"2025-09-10T19:42:49.213Z","repository":{"id":281818602,"uuid":"946518914","full_name":"LiLittleCat/leetcode-tools","owner":"LiLittleCat","description":"一个用于管理 LeetCode（力扣）题单的命令行工具。","archived":false,"fork":false,"pushed_at":"2025-03-11T10:23:02.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T10:32:27.966Z","etag":null,"topics":["leetcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiLittleCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T09:12:43.000Z","updated_at":"2025-03-11T10:23:05.000Z","dependencies_parsed_at":"2025-03-11T10:42:54.011Z","dependency_job_id":null,"html_url":"https://github.com/LiLittleCat/leetcode-tools","commit_stats":null,"previous_names":["lilittlecat/leetcode-tools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiLittleCat%2Fleetcode-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiLittleCat%2Fleetcode-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiLittleCat%2Fleetcode-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiLittleCat%2Fleetcode-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiLittleCat","download_url":"https://codeload.github.com/LiLittleCat/leetcode-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819370,"owners_count":21166474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["leetcode"],"created_at":"2025-04-14T03:54:20.294Z","updated_at":"2025-04-14T03:54:20.695Z","avatar_url":"https://github.com/LiLittleCat.png","language":"Python","readme":"# LeetCode 题单管理工具\n\n这是一个用于管理 LeetCode（力扣）题单的命令行工具。通过这个工具，你可以方便地创建、查看、编辑和删除你的 LeetCode 题单。\n\n## 功能特点\n\n- 📝 创建新的题单（支持公开/私有设置）\n- 👀 查看所有题单列表（包括自己创建的和收藏的）\n- ➕ 向题单添加题目（支持单个/批量添加）\n- ➖ 从题单移除题目（支持单个/批量删除）\n- 🗑️ 删除题单（支持批量操作，带成功/失败统计）\n- ⭐ 收藏他人题单（支持查看内容和二次确认）\n- 📋 复制他人题单（支持查看内容和二次确认）\n- ⚡ 快速创建题单（简化流程，一次性输入标题和题目）\n- 📊 以表格形式展示题目信息（包括难度、状态、题号等）\n\n## 安装步骤\n\n1. 克隆仓库：\n\n```bash\ngit clone https://github.com/LiLittleCat/leetcode-tools.git\ncd leetcode-tools\n```\n\n2. (可选) 创建并激活虚拟环境：\n\n```bash\n# 创建虚拟环境\npython -m venv .venv\n\n# 在 Linux/macOS 上激活虚拟环境\nsource .venv/bin/activate\n\n# 在 Windows 上激活虚拟环境\n# .venv\\Scripts\\activate\n```\n\n3. 安装依赖：\n\n```bash\npip install -r requirements.txt\n```\n\n4. 配置环境变量：\n\n   - 复制 `.env.example` 文件并重命名为 `.env`\n\n   ```bash\n   cp .env.example .env\n   ```\n\n   - 从浏览器中获取 LeetCode 的 Cookie 信息\n   - 在 `.env` 文件中填入你的 `csrftoken` 和 `LEETCODE_SESSION`\n\n## 使用说明\n\n1. 运行程序：\n\n```bash\npython leetcode_favorite.py\n```\n\n2. 主菜单选项：\n\n   - 1️⃣ 📝 创建题单\n   - 2️⃣ 🗑️ 删除题单\n   - 3️⃣ 👀 查看题单\n   - 4️⃣ ➕ 新增题目\n   - 5️⃣ ➖ 删除题目\n   - 6️⃣ ⭐ 收藏他人题单\n   - 7️⃣ 📋 复制他人题单\n   - 8️⃣ ⚡ 快速创建题单\n\n## 获取 Cookie 信息\n\n1. 登录 [LeetCode 中文站](https://leetcode.cn)\n2. 打开浏览器开发者工具（F12）\n3. 切换到 Application 标签页\n4. 在左侧边栏找到 Storage -\u003e Cookies -\u003e https://leetcode.cn\n5. 在右侧列表中找到并复制以下值：\n   - `csrftoken`\n   - `LEETCODE_SESSION`\n\n## 注意事项\n\n- ❗⚠️ 页面上的题号和题目的 id 可能不一致，建议使用 titleSlug 来添加题目。\n\n  如果是从讨论里获取的题单，如 [分享丨【题单】滑动窗口与双指针（定长/不定长/单序列/双序列/三指针/分组循环）- 讨论 - 力扣（LeetCode）](https://leetcode.cn/discuss/post/3578981/ti-dan-hua-dong-chuang-kou-ding-chang-bu-rzz7)，推荐使用浏览器脚本 [leetcode_title_slug_extractor.user.js](https://github.com/LiLittleCat/leetcode-tools/blob/main/leetcode_title_slug_extractor.user.js) 来快速获取题目的 titleSlug：\n\n  1. 安装 Tampermonkey 浏览器扩展\n  2. 将 `leetcode_title_slug_extractor.user.js` 导入到 Tampermonkey\n  3. 访问 LeetCode 中文站的题单讨论页面\n  4. 页面右上角会出现一个浮动面板，显示当前页面所有题目的 titleSlug\n  5. 可以通过面板快速复制单个或整组题目的 titleSlug\n  6. 支持定位功能，点击\"定位\"按钮可以快速找到对应的题目位置\n\n- 请妥善保管你的 Cookie 信息，不要分享给他人\n- Cookie 可能会定期失效，需要重新获取\n- 建议定期备份重要的题单信息\n\n## 贡献\n\n欢迎提交 Issue 和 Pull Request！\n\n## 许可证\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilittlecat%2Fleetcode-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilittlecat%2Fleetcode-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilittlecat%2Fleetcode-tools/lists"}