# Bilibili Audio

> Extract the complete audio track from a publicly accessible Bilibili video as MP3 or M4A/AAC. Use when the user provides a Bilibili video URL and asks to download, extract, convert, or save its audio for permitted personal use; do not use for vocal/background-music separation or to bypass login, payment, regional, or other access restrictions.

- Skill: `betty0314/bilibili-audio` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add betty0314/bilibili-audio`
- Raw SKILL.md: https://api.skillmd.com/api/skills/betty0314/bilibili-audio/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: betty0314 (https://skillmd.com/u/betty0314)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/betty0314/bilibili-audio

---


# Bilibili Audio

Extract the ordinary complete audio track from a public Bilibili video. Default to MP3; use M4A/AAC when the user prefers the source audio without a second lossy conversion.

## Workflow

1. Confirm the user supplied a Bilibili URL and requests the complete audio track. Do not infer permission for private, paid, login-required, region-locked, or otherwise restricted content.
2. Use `scripts/extract_bilibili_audio.py`. It queries only Bilibili's public playback information and does not use cookies or credentials.
3. Resolve `scripts/extract_bilibili_audio.py` relative to this `SKILL.md`. Default the output directory to `downloads/bilibili` within the active workspace. Run:

   ```bash
   python3 <skill-dir>/scripts/extract_bilibili_audio.py \
     '<URL>' --output-dir downloads/bilibili --format mp3
   ```

4. If FFmpeg is not installed, install a local, isolated FFmpeg provider only after approval, then re-run the command with its binary:

   ```bash
   python3 -m venv .codex-tools/bilibili-audio-venv
   .codex-tools/bilibili-audio-venv/bin/pip install imageio-ffmpeg
   ```

   Obtain the binary with `python3 -c 'import imageio_ffmpeg; print(imageio_ffmpeg.get_ffmpeg_exe())'` and pass it via `--ffmpeg`.

5. Report the generated local file as a clickable link. State the duration or source bitrate only if verified by the extraction output. Keep the downloaded MP3/M4A; the script removes its temporary `.m4s` stream after a successful conversion.

## Options

- Add `--format m4a` to remux the original AAC audio when available, avoiding re-encoding.
- Add `--bitrate 192k` only when the user specifically wants a larger MP3. Increasing MP3 bitrate cannot improve the source audio.
- Add `--ffmpeg /absolute/path/to/ffmpeg` when the executable is not on `PATH`.

## Boundaries

- Do not perform vocal, dialogue, or background-music separation; use a dedicated audio-separation workflow for that.
- Stop and explain if Bilibili does not expose an accessible public audio stream. Do not try cookies, account credentials, DRM workarounds, or restrictions bypasses.
- Handle the result as the user's local file; do not upload or redistribute it.

