YYRMM的软件库 YYRMM's Software Library
🍪

CookieLuncher · Cookie 启动器 v1.0.0

CookieLuncher v1.0.0

登录状态加密存在本机,要用的时候一键注入浏览器(2026-09-30 发布)

Login state encrypted on your own machine, injected into the browser on demand (released 2026-09-30)

Windows Python 3.10+ v1.0.0 命令行 CLI Cookie 管理 Cookie Manager

软件介绍

About

CookieLuncher(Cookie 启动器)是一个本地运行的中文命令行小工具:把各网站的登录 Cookie 加密保存在本机,需要时一键注入浏览器打开网站;也可以直接打开可见浏览器让你手动登录(含验证码),回来按回车就把全部有效 Cookie 采集下来。仓库目录名是 CookiesLuncher,程序内统一叫 CookieLuncher。

它解决的问题很具体:不想在每台设备、每个浏览器里重复登录,也不想把 Cookie 明文贴在脚本里。所有网站的 Cookie 加密写进单个 cookies.enc,明文永不落盘,密码错了就解不开;主菜单的导出还额外加了一道二重导出密码(只存哈希),避免别人拿到文件就能导。

启动流程是:先建一个临时用户数据目录 → Playwright 启动浏览器并把 Cookie 注入(Chromium 原生加密写盘,登录态可靠)→ 页面加载完成后退出 Playwright,由程序直接拉起同一个浏览器的独立进程 → 你正常用浏览器,关闭窗口后程序监控到全部进程退出,自动删除临时目录,不留登录态。内置的 Thorium 后端自带 H.264 / AAC 专有编解码,普通 B 站视频可直接播放;会员 / DRM 视频则切到本机 Edge / Chrome 后端。

另一个用途是配合 GitHub Action 的保活项目:一键导出只含密文的 action_config_output.json 与控制台打印的 Fernet 密钥(存进仓库 Secret,例如 COOKIE_FERNET_KEY),定时任务就能用同一份登录态去保活,不需要把 Cookie 明文放进仓库。

说明:需要 Python 3.10+ 与 pip install -r requirements.txt(首次安装依赖要联网);Thorium 后端需自行从其 Releases 下载并放到 external_browsers\thorium-win64\。仓库暂未声明开源许可证。

CookieLuncher is a small local Chinese-language CLI: it encrypts and stores per-site login cookies on your own machine and injects them into a browser on demand; it can also open a visible browser so you log in yourself (captcha included) and collect every valid cookie when you press Enter. The repository folder is still called CookiesLuncher, while the program calls itself CookieLuncher.

The problem it solves is concrete: you don't want to log in again on every device and browser, and you certainly don't want cookies sitting in plain text inside a script. All sites go into a single encrypted cookies.enc — plaintext never touches disk, and a wrong password simply can't decrypt it. Exporting from the menu adds a second, hash-only export password so that holding the file isn't enough.

Launching works like this: create a temporary profile, have Playwright start the browser and inject the cookies (Chromium's own encryption writes them to disk, so the session holds), then quit Playwright and relaunch the same browser as a standalone process. You browse normally, and once every process exits the tool deletes the temporary profile, leaving no session behind. The bundled Thorium backend carries the proprietary H.264 / AAC codecs so ordinary Bilibili videos play; member or DRM content switches to your local Edge / Chrome.

Its other job is feeding a GitHub Action keep-alive project: one click exports a ciphertext-only action_config_output.json plus a Fernet key printed to the console (store it as a repository secret such as COOKIE_FERNET_KEY), so the scheduled job can reuse the same login state without any plain-text cookies in the repository.

Note: requires Python 3.10+ and pip install -r requirements.txt (the first install needs a network connection); the Thorium backend must be downloaded from its own releases into external_browsers\thorium-win64\. No open-source licence is declared for this repository yet.

功能特性

Features

加密保存所有网站 Cookie 加密写进单个 cookies.enc,明文永不落盘,密码错误无法解密;忘记密码则 Cookie 不可找回
Encrypted storageEvery site's cookies go into one encrypted cookies.enc; plaintext never hits disk, a wrong password can't decrypt, and a forgotten password means the cookies are unrecoverable
一键启动浏览器创建临时用户目录注入 Cookie 后拉起浏览器,关闭窗口自动删除临时数据,不在本机留下登录态
One-click browser launchA temporary profile receives the cookies, the browser starts, and everything is deleted once the window closes — no session left behind
手动登录采集打开可见浏览器登录账号 / 过验证码,回车确认后自动采集全部有效 Cookie;空结果或失败时拒绝保存
Manual login captureLog in (and pass any captcha) in a visible browser, press Enter and every valid cookie is collected; empty or failed captures are refused rather than saved
Cookie 管理粘贴导入(分号 / JSON / Cookie-Editor 三种格式自动识别)、查看、删除(二次确认)、修改密码(用新密钥整体重新加密)
Cookie managementPaste-import (auto-detecting semicolon, JSON and Cookie-Editor formats), view, delete with confirmation, and change password by re-encrypting everything with a new key
导出保活配置生成只含密文的 action_config_output.json + Fernet 密钥,直接对接 GitHub Action 保活项目;主菜单导出带二重密码,命令行导出适合脚本
Keep-alive exportProduces a ciphertext-only action_config_output.json plus the Fernet key, ready for a GitHub Action keep-alive project; the menu export asks for the second password while the CLI export suits scripts
双浏览器后端内置 Thorium(离线自包含,自带 H.264 / AAC,可放 B 站视频)或本机 Edge / Chrome(会员 / DRM 视频),改 config.json 一行即可切换
Two browser backendsBundled Thorium (offline, with H.264 / AAC so Bilibili plays) or your local Edge / Chrome for member and DRM video — one line in config.json switches them

项目档案

Project Details

Environment
Windows + Python 3.10 及以上;pip install -r requirements.txt 后 python main.py 启动
Windows with Python 3.10+; run pip install -r requirements.txt, then python main.py
Storage
Cookie 密文存 cookies.enc;访问密码首次启动时设定(至少 6 位),同时用于登录程序与加密
Ciphertext lives in cookies.enc; the access password is set on first run (6+ characters) and serves both as login and as the encryption key
Capture
Playwright 驱动浏览器注入 / 采集;采集与启动都用独立临时目录,结束自动查杀残留进程并删除
Playwright drives injection and capture, each in its own temporary profile that is cleaned up (stray processes included) when finished
Export
导出 Fernet 对称加密的 Cookie 清单;密钥只在控制台打印一次,需自行存进 GitHub Secret
Exports a Fernet-encrypted cookie list; the key is printed to the console once and must be stored as a GitHub secret
Third-party
Thorium 为独立社区项目,与本程序作者无关;分发包中的 Thorium 二进制遵循其自身许可
Thorium is an independent community project unrelated to this tool's author; the bundled Thorium binaries follow Thorium's own licence
License
仓库暂无 LICENSE 文件(未声明开源协议),使用前请先看仓库说明
No LICENSE file yet — no open-source licence is declared, so check the repository before use

更新记录

Changelog

← 返回软件列表 ← Back to software list