{"_id":"@deluxebear/bilibilicli","name":"@deluxebear/bilibilicli","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@deluxebear/bilibilicli","version":"0.1.0","description":"Local CLI for browser-assisted Bilibili video uploads.","type":"module","keywords":["bilibili","cli","upload","video","automation"],"bin":{"bilibilicli":"bin/bilibilicli.mjs"},"scripts":{"check":"node --check bin/bilibilicli.mjs && node --check lib/*.mjs","prepack":"npm run check","pack:dry":"npm pack --dry-run","build:binary":"node scripts/build-binary.mjs"},"dependencies":{"playwright":"^1.59.1"},"engines":{"node":">=20"},"license":"MIT","_id":"@deluxebear/bilibilicli@0.1.0","gitHead":"0d5c4ecfdcf689def894b00a06ef9b2763c21d96","_nodeVersion":"22.16.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-dK9bt3eW1rLx/OpUSFchC8NrI1v45DbNwsF+suZlH1TUmMRqjg6eULQQzaIcVAHMdWTSWGytFzNVxfYLTGwzrQ==","shasum":"35bb27e84c2c5d489e6dd9b70dadfec4fd65eca3","tarball":"https://registry.npmjs.org/@deluxebear/bilibilicli/-/bilibilicli-0.1.0.tgz","fileCount":13,"unpackedSize":53235,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHUnW7bRiytL1N/8AiEf6iZCwXtMxtOQ83406UnSWieeAiBH+cLBbNFVHO+s7LXbbNrgKeGB5q78Yroh6o7F7N9ToA=="}]},"_npmUser":{"name":"deluxebear","email":"deluxebear@gmail.com"},"directories":{},"maintainers":[{"name":"deluxebear","email":"deluxebear@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bilibilicli_0.1.0_1777277578265_0.08565648025054129"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T08:12:58.188Z","0.1.0":"2026-04-27T08:12:58.409Z","modified":"2026-04-27T08:12:58.573Z"},"maintainers":[{"name":"deluxebear","email":"deluxebear@gmail.com"}],"description":"Local CLI for browser-assisted Bilibili video uploads.","keywords":["bilibili","cli","upload","video","automation"],"license":"MIT","readme":"# bilibilicli\n\nBrowser-assisted local CLI for Bilibili video submission.\n\nThis project keeps login in a real browser, stores cookies under `~/.bilibilicli`, and replays the upload/submission API from the CLI. Do not commit files from `~/.bilibilicli`; they contain private account material.\n\n## Install\n\nPublished package:\n\n```bash\nnpx @deluxebear/bilibilicli --help\nnpm install -g @deluxebear/bilibilicli\nbilibilicli --help\n```\n\nLocal package before publishing:\n\n```bash\nnpm install\nnpm link\n```\n\nOr install the packed tarball globally:\n\n```bash\nnpm pack\nnpm install -g ./deluxebear-bilibilicli-0.1.0.tgz\nbilibilicli --help\n```\n\nTo publish to npm:\n\n```bash\nnpm login\nnpm publish --access public\n```\n\n`npx @deluxebear/bilibilicli ...` works after the package is published. `npm install -g @deluxebear/bilibilicli` installs the global `bilibilicli` command permanently.\n\n## Login\n\n```bash\nbilibilicli auth login --profile default\nbilibilicli auth status --profile default\nbilibilicli doctor --profile default\n```\n\n`auth login` opens Bilibili's member upload page with a persistent browser profile at:\n\n```text\n~/.bilibilicli/browser-profiles/default/\n```\n\nAfter logging in, press Enter in the terminal. Cookies are saved to:\n\n```text\n~/.bilibilicli/profiles/default/auth.json\n```\n\n## Capture Requests\n\nUse this when Bilibili changes fields or when you need to compare the CLI with the website:\n\n```bash\nbilibilicli auth capture --profile default --url https://member.bilibili.com/platform/upload/video/frame\n```\n\nPerform the website workflow in the opened browser, then press Enter. A redacted request summary is saved to:\n\n```text\n~/.bilibilicli/profiles/default/capture-summary.json\n```\n\n## Commands\n\nRead-only:\n\n```bash\nbilibilicli commands list\nbilibilicli config list\nbilibilicli auth status --profile default\nbilibilicli doctor --profile default\n```\n\nUpload a file but do not submit an archive:\n\n```bash\nbilibilicli upload file --profile default --file ./video.mp4\n```\n\nUpload a cover image:\n\n```bash\nbilibilicli cover upload --profile default --file ./cover.jpg\n```\n\nUpload and attach a subtitle draft to an uploaded video `cid`:\n\n```bash\nbilibilicli subtitle save \\\n  --profile default \\\n  --cid \"<cid returned by upload file>\" \\\n  --file ./subtitle.en.srt \\\n  --lan en\n```\n\nSave an uploaded file as a draft:\n\n```bash\nbilibilicli draft save \\\n  --profile default \\\n  --filename \"<filename returned by upload file>\" \\\n  --cid \"<cid returned by upload file>\" \\\n  --title \"投稿标题\" \\\n  --tid 27 \\\n  --tags \"学习\" \\\n  --subtitle-lan en \\\n  --description \"简介\"\n```\n\nDelete a draft by draft id:\n\n```bash\nbilibilicli draft delete --profile default --id 3399934\n```\n\nMark an existing draft as having subtitles:\n\n```bash\nbilibilicli draft subtitle --profile default --id 3399965 --lan en\n```\n\nSubmit an uploaded file:\n\n```bash\nbilibilicli archive submit \\\n  --profile default \\\n  --filename \"<filename returned by upload file>\" \\\n  --title \"投稿标题\" \\\n  --tid 17 \\\n  --tags \"标签1,标签2\" \\\n  --description \"简介\"\n```\n\nUpload and submit in one command:\n\n```bash\nbilibilicli video draft \\\n  --profile default \\\n  --file ./video.mp4 \\\n  --cover-file ./cover.jpg \\\n  --subtitle-file ./subtitle.en.srt \\\n  --subtitle-lan en \\\n  --title \"投稿标题\" \\\n  --tid 27 \\\n  --tags \"学习\" \\\n  --description \"简介\"\n```\n\nThe currently verified website path is \"upload and save draft\". Direct archive submission is kept as a low-level command and may need another capture of the final submit button before use.\n\nUpload and submit in one command:\n\n```bash\nbilibilicli video run \\\n  --profile default \\\n  --file ./video.mp4 \\\n  --title \"投稿标题\" \\\n  --tid 17 \\\n  --tags \"标签1,标签2\" \\\n  --description \"简介\"\n```\n\n`upload file`, `draft save`, `video draft`, `archive submit`, and `video run` are state-changing commands. They upload media, save drafts, and/or create a Bilibili submission.\n\n## Known Protocol\n\nThe first implementation uses these web endpoints:\n\n- `GET https://api.bilibili.com/x/web-interface/nav` for read-only account diagnostics.\n- `POST https://member.bilibili.com/upload/multipart/new` for current video upload initialization.\n- `POST https://member.bilibili.com/upload/multipart/part`, signed `PUT`, and `POST https://member.bilibili.com/upload/multipart/complete` for current video bytes.\n- `POST https://member.bilibili.com/x/vu/web/cover/up` for optional cover upload.\n- `POST https://api.bilibili.com/x/upload/web/image` with `bucket=subtitle` for subtitle file upload.\n- `POST https://api.bilibili.com/x/v2/dm/subtitle/draft/preSave` for attaching subtitle drafts.\n- `POST https://member.bilibili.com/x/vupre/web/draft/add` for saving an upload as a draft.\n- `POST https://member.bilibili.com/x/vupre/web/draft/update` for marking a saved draft subtitle language.\n- `POST https://member.bilibili.com/x/vupre/web/draft/delete` for deleting a draft by id.\n- Legacy `GET https://member.bilibili.com/preupload` and Upos multipart helpers are retained in code for older upload paths.\n- `POST https://member.bilibili.com/x/vu/web/add/v3` for archive submission.\n\nBilibili can change required fields, CDN choices, or anti-abuse checks. If a command fails, run `auth capture`, perform the same action on the website, and compare the redacted capture with the CLI request shape.\n","readmeFilename":"README.md","_rev":"1-94d84e11e15731514ff4ec718a2f4263"}