home / skills / xiangyu-cas / vision-skills / bbdown-cli

bbdown-cli skill

/skills/bbdown-cli

This skill guides using the BBDown CLI to download Bilibili videos to data/ with 720p preference and authenticated access.

npx playbooks add skill xiangyu-cas/vision-skills --skill bbdown-cli

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.8 KB
---
name: bbdown-cli
description: Install and use the BBDown CLI on Linux/macOS for Bilibili downloads, including login/cookies/access_token, downloading by URL, preferring 720p when available, and writing output under a local data/ directory.
---

# BBDown CLI

## Quick start (data/ output, prefer 720p)

- Prefer running from the repo root so `data/` exists.
- List available streams and the exact 720p label:
  - `BBDown --only-show-info <url>`
- Download to `data/` with 720p preference (use the label you saw above):
  - `BBDown --work-dir data -q "<720p label>" <url>`
- If you are unsure about labels, use interactive selection:
  - `BBDown --work-dir data -ia <url>`

## Install or update (Linux/macOS)

- Install via .NET global tool:
  - `dotnet tool install --global BBDown`
- Update:
  - `dotnet tool update --global BBDown`
- Alternative: download a release binary and add it to PATH.

## Dependencies

- Install `ffmpeg` or `mp4box` for muxing.
- For Dolby Vision muxing, use `ffmpeg` 5.0+ or a recent `mp4box`.
- Optional: install `aria2c` if you plan to use `-aria2`.

## Auth and cookies

- Web QR login:
  - `BBDown login`
- TV QR login:
  - `BBDown logintv`
- Use a web cookie string when needed:
  - `BBDown -c "SESSDATA=..." <url>`
- Use TV/APP access token:
  - `BBDown -tv -token "..." <url>`

## Common download workflow

- Basic download:
  - `BBDown --work-dir data <url>`
- Prefer 720p and hide extra streams for cleaner output:
  - `BBDown --work-dir data -q "<720p label>" -hs <url>`
- For multi-part videos, select pages:
  - `BBDown --work-dir data -p 1,3,5 <url>`

## Troubleshooting

- If muxing fails, verify `ffmpeg`/`mp4box` availability or pass explicit paths:
  - `BBDown --ffmpeg-path <path> --work-dir data <url>`
- If member-only content fails, retry with `-c` cookie (web) or `-token` (TV/APP).

Overview

This skill installs and runs the BBDown CLI on Linux and macOS to download videos from Bilibili into a local data/ directory. It supports login via web or TV QR, cookie and access token options, prefers 720p when available, and handles muxing with ffmpeg or mp4box. The goal is reliable, repeatable downloads organized under data/ for downstream processing.

How this skill works

The skill wraps the BBDown command-line interface to discover available streams, select a 720p stream label when present, and save all output under a local data/ work directory. It uses .NET global tool installation or downloadable binaries, calls external muxers (ffmpeg or mp4box) for packaging, and accepts authentication via web/TV QR, cookie strings, or TV/APP tokens. Interactive and explicit stream selection modes are supported.

When to use it

  • Download Bilibili videos for offline archiving or processing on Linux/macOS.
  • Prefer consistent 720p outputs when higher or lower quality streams exist.
  • Automate multi-part or playlist downloads with page selection.
  • Fetch member-only content using cookie or TV/APP token authentication.
  • Integrate into media pipelines that expect files under a data/ folder.

Best practices

  • Run commands from the repository root or ensure a data/ directory exists to keep outputs organized.
  • Use BBDown --only-show-info <url> first to find the exact 720p label before passing -q.
  • Install ffmpeg (5.0+ for Dolby Vision) or mp4box and verify they are on PATH for reliable muxing.
  • Prefer BBDown -ia <url> for interactive label selection when labels are unclear.
  • Store authentication securely: use SESSDATA cookies or TV tokens only in protected environments.

Example use cases

  • One-off download: BBDown --work-dir data https://www.bilibili.com/video/xxx
  • Prefer 720p: BBDown --work-dir data -q "HD 720P" -hs https://www.bilibili.com/video/xxx
  • Interactive selection when unsure: BBDown --work-dir data -ia https://www.bilibili.com/video/xxx
  • Selective pages from multi-part videos: BBDown --work-dir data -p 1,3,5 https://www.bilibili.com/video/xxx
  • Member-only content: BBDown -c "SESSDATA=..." --work-dir data https://www.bilibili.com/video/xxx

FAQ

How do I install or update BBDown?

Install with dotnet tool install --global BBDown and update with dotnet tool update --global BBDown, or download a release binary and add it to PATH.

Muxing fails with errors — what should I check?

Ensure ffmpeg or mp4box is installed and available on PATH. For Dolby Vision use ffmpeg 5.0+ or a recent mp4box. You can pass --ffmpeg-path or explicit muxer paths if needed.