Skip to content
bili

v0.2.0

A new discover command walks the bilibili graph from a video or creator breadth first, following related videos, uploaders, and a creator's uploads.

Every other read answers one question about one object: a video's metadata, a creator's uploads, a video's related list. This release adds discover, which chains them into a single breadth-first walk.

discover: walk the graph

bili discover BV17x411w7KC      # what is this video linked to?
bili discover 2267573           # what is this creator linked to?

A seed is anything bili already resolves: a BV or av id or video URL, or a creator mid or space URL. Pass several to start the walk from more than one place. The first row is the seed at depth 0; each later row is tagged with the edge it arrived by.

What gets followed

There are two node kinds, video and creator, and three edges between them: related (a video to its recommendations), uploader (a video to the creator who posted it), and uploads (a creator to the videos they posted).

--follow takes a preset or a comma-separated edge list:

bili discover BV17x411w7KC                       # content (the default)
bili discover BV17x411w7KC --follow creators     # uploader and their uploads
bili discover BV17x411w7KC --follow all --depth 2
bili discover BV17x411w7KC --follow related

The presets are content (related videos and a creator's uploads), creators (a video's uploader and that creator's uploads), and all.

Bounding the walk

Three independent limits keep a walk finite, so a bare discover always terminates: --depth (hops, default 1; 0 emits only the seeds), --fanout (neighbors per edge, default 25; 0 for unlimited), and -n (total nodes, default 500). A seed that cannot be fetched fails the walk; a failure deeper in the walk becomes a one-line note on stderr and the traversal carries on.

discover streams one row per node through the same formatter as every read, so it shapes and pipes the same way. See the Discovering guide for the full tour.

Install

go install github.com/tamnd/bilibili-cli/cmd/bili@latest

Prebuilt archives for Linux, macOS, and Windows, plus Linux packages (deb, rpm, apk) and checksums, are on the release page. The container image is on GHCR:

docker run --rm ghcr.io/tamnd/bili:0.2.0 discover BV17x411w7KC -n 10