A small command-line tool that saves Bilibili videos as MP3 audio or HD MP4 video.
Each time you paste a link it asks: audio only (MP3), or the full video merged to MP4 with ffmpeg.
Guest gets 480p video, logged in gets 1080p, premium gets 1080p60/4K. Audio is full quality with no login needed.
Paste a single link, a season/collection, or an uploader's page to pull every video they've posted.
Re-running skips files you already have. Long videos download in parallel segments so they don't hang.
Install it globally from npm, then type bad:
npm i -g bili-audio-downloaderbad
ffmpeg comes bundled, so there's nothing else to install.
It asks first. Press 1 for audio (saved as MP3) or 2 for video (merged to MP4). Audio needs no login — if that's all you want, skip the next step.
Audio and 480p video work with nothing. A cookie is only needed to unlock 1080p and up for video, because Bilibili keeps HD behind login (4K and 1080p60 also need premium).
Grab it from a logged-in browser: F12 → Network, click any request to bilibili.com, and copy the whole Cookie request header. It has to include SESSDATA.
Skip document.cookie — SESSDATA is HttpOnly and never shows up there. That trips a lot of people up.
A single video:
A whole collection:
Every video from one uploader:
Collections and uploader pages open a menu — preview the list first, or just download everything. Files go to downloads/ (video ends up in downloads/video/), and re-running only fills in what's missing.
npm works everywhere; there's also a prebuilt Windows exe.