Extract Bilibili Audio
Use the bundled CLI. Extract audio from Bilibili videos the user has the right to access and save (permitted audio, music, and similar). Do not bypass access controls.
Run
python scripts/extract_audio.py <BV-or-URL>
Resolve scripts/extract_audio.py relative to this skill directory. Output defaults to ~/Music/Bilibili (override with --output-dir, or BILIBILI_AUDIO_OUTPUT_DIR). Default to the best original audio stream without transcoding. For an M4A source, rewrite only the container as a standard fast-start M4A; preserve the encoded audio bit-for-bit.
Useful options:
--format mp3|m4a|opus|wav|originalonly when the user requests a specific format--keep-containerto retain Bilibili's original DASH container--bitrate 192for converted formats--cookies-from-browser chrome|edge|firefoxonly when the user explicitly asks to use an existing logged-in session--all-partsto process every part of a multipart video
If dependencies are missing:
python -m pip install --user -U yt-dlp imageio-ffmpeg
Report
Return the generated filename(s). Preserve errors from Bilibili or yt-dlp. Explain authentication, region, membership, or removed-video errors without attempting to circumvent them.