🎵 Bilibili Audio Downloader

A small command-line tool that saves Bilibili videos as MP3 audio or HD MP4 video.

MP3 audio MP4 video, up to 4K Whole uploader / collection Resume + parallel download

What it does

Audio or video

Each time you paste a link it asks: audio only (MP3), or the full video merged to MP4 with ffmpeg.

Quality follows your account

Guest gets 480p video, logged in gets 1080p, premium gets 1080p60/4K. Audio is full quality with no login needed.

One video, a collection, or a whole channel

Paste a single link, a season/collection, or an uploader's page to pull every video they've posted.

Resume and don't stall

Re-running skips files you already have. Long videos download in parallel segments so they don't hang.

How to use

1

Install and run

Install it globally from npm, then type bad:

npm i -g bili-audio-downloader
bad

ffmpeg comes bundled, so there's nothing else to install.

Running the tool
2

Audio or video?

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.

3

Cookie — only if you want 1080p video

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.cookieSESSDATA is HttpOnly and never shows up there. That trips a lot of people up.

Copying the Cookie header
4

Paste a link

A single video:

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.

Collection list Downloading a collection

Get it

npm works everywhere; there's also a prebuilt Windows exe.