bilibili-note: via subtitles, turning Bilibili videos into structured Obsidian notes

Preface

A common approach for knowledge accumulation in DeepSeek Harness (DSH) is to distill information from videos into searchable Markdown files within Obsidian. Writing custom scripts to fetch Bilibili resources often leads to issues such as accidentally downloading videos, messy timelines in multi-part collections, or generating empty notes when subtitles are missing. On the other hand, leaving summaries, key points, and tags entirely to the model’s discretion lacks a verifiable intermediate format.

bilibili-note splits the workflow into two halves: fetching subtitles, parsing, formatting, and verification are handled by fixed CLI/skill scripts; while summaries, key points, and tags are delegated to the model or human editors via a contract defined in content.json. The following section describes its capabilities and usage from the perspective of a DSH plugin.

What is this

bilibili-note is published by maintainer 3588834014-del and is categorized as a Networking Tool in the SkillHub Plugin Directory (directory page lists version v1.2.0). The project provides both an independent CLI and an optional DSH Agent Skill, which share the same implementation (scripts/bili_note.py) but have independent installation paths.

One-sentence positioning: Input a Bilibili video link to fetch only the subtitle files via yt-dlp (without downloading the video), generating Obsidian notes with YAML front matter, clickable ?t= time-stamped key points, and a collapsible full transcript at the bottom.

Core Features

Subtitle-only Fetching with Media Verification

The fetch command enforces --skip-download and checks the working directory for media files like .mp4, .flv, .m4a, or .part to prevent accidental video downloads. The data channel relies solely on yt-dlp and does not depend on private APIs.

Multi-Part Collection Timeline Merging

For Bilibili multi-part collections, the tool fetches subtitles for each part and re-bases timestamps onto a single continuous timeline. If a specific part has no subtitles, the content is skipped, but a duration placeholder is retained to prevent the timestamps of subsequent parts from shifting forward. If subtitles for multiple parts are identical at the byte level, the tool exits with an error rather than duplicating the same content.

Skip if No Subtitles

When no usable subtitles are available, the tool does not fabricate content or generate empty notes.

Separation of Mechanical and Judgment Tasks

The overall data flow is as follows:

Bilibili URL ──▶ fetch ──▶ manifest.json ──▶ [You / Agent] ──▶ content.json ──▶ write ──▶ note.md
                  │         subtitles +                      summary, bullets,       │
                  │         timestamped segments             tags                    │
                  └── yt-dlp, subtitles only ────────────────────────────────────────┘
  • Script Side: fetch, write, verify, selftest, etc.
  • Model / Human Side: Fills in content.json according to the documentation (summary, body points, tags, bullets with time). If content.json is not provided, a draft note with placeholders and status: draft can be generated.

DSH Skill Triggering

After installing the skill to ~/.agents/skills/bilibili-note, it will appear in the DSH skill directory and can be triggered by phrases like “B站笔记” (Bilibili Note) (subject to your local DSH configuration).

Installation and Activation

Dependencies: Python 3.8+ (standard library only); yt-dlp as an external command (README suggests pip install -U yt-dlp). Licensed under MIT.

As a DSH Agent Skill

Execute in the directory containing the plugin source (SkillHub directory marks it as installable; generally, you will obtain this directory after installation):

python scripts/install.py            # Installs to ~/.agents/skills/bilibili-note
python scripts/install.py --dry-run  # Preview files to be copied

Note: Installing the skill does not automatically install the CLI, and vice versa.

As a Standalone CLI (Optional)

If you wish to use the same logic independently in the terminal:

pipx install git+https://github.com/3588834014-del/bilibili-note.git

After installation, verify with bili-note --version.

Typical Usage

Cookies (Usually required for AI Subtitles)

Bilibili’s AI subtitle interface requires a logged-in state. You can use the browser extension Get cookies.txt LOCALLY to log in to bilibili.com and export cookies.txt. Videos with uploader-provided subtitles may sometimes work without configuration.

Note: The Netscape format exported by this extension may not match the domain field requirements of http.cookiejar / yt-dlp. The symptom often manifests as “seemingly no subtitles.” The tool includes a built-in normalize_cookies() function to handle domain normalization and deduplication, so manual file editing is generally unnecessary.

Specifying the cookie path:

export BILI_COOKIES=/path/to/cookies.txt      # Linux / macOS

PowerShell:

$env:BILI_COOKIES = "C:\path\cookies.txt"

Note Output Directory

The tool does not hardcode a default Vault path to avoid silently creating empty directories on other machines. You can pass arguments explicitly or set environment variables:

bili-note note "<URL>" --note-dir "<vault>/Sources/Videos"

export BILI_VAULT="/path/to/MyVault"
export BILI_TARGET_DIR="Sources/Videos"   # Optional, default is Sources/Videos

Common Commands

# Fetch only metadata and subtitles to the working directory
bili-note fetch "<URL>" --out ./work

# Write note from existing work directory (can attach content.json)
bili-note write --work ./work --note-dir "<vault>/Sources/Videos" --content-file content.json

# One step: fetch + write
bili-note note "<URL>" --note-dir "<vault>/Sources/Videos" [--content-file content.json]

# Check generated note structure
bili-note verify --note "<note path>"

# Local self-test: cookie, yt-dlp, output directory (no network connection)
bili-note selftest

Example of content.json field conventions (time unit is seconds; the tool handles rendering MM:SS and jump links):

{
  "summary": "One sentence, 60-120 chars, conclusion first.",
  "body": "200-400 chars covering the argument and the conclusion.",
  "tags": ["认知", "人文"],
  "cards": ["CC_example"],
  "bullets": [
    {"time": 0,  "title": "Short heading", "text": "One sentence."},
    {"time": 23, "title": "Short heading", "text": "One sentence."}
  ]
}

The generated note contains type: video-note, source original link, tags, and other front matter. The body includes a video info callout, summary, a bulleted list with ?t= links, and a collapsible full transcript at the bottom.

Use Cases and Notes

Who it is for: DSH / Agent developers who already use Obsidian as a knowledge base and need to create “jumpable, searchable” notes from Bilibili videos; scenarios where mechanical steps are scriptable, but summaries and tags are filled by a model according to a contract.

Recommendations before use:

  1. Read the README and LICENSE at the GitHub Repository to confirm that the behavior and license meet your environmental requirements.
  2. DSH skills and networking steps execute under the permissions of the current dsh process (reading cookies, calling yt-dlp, writing to the Vault directory). Please check the source code and dependency sources before installing plugins or skills.
  3. Cookie files contain login state; do not commit them to public repositories. While fetching only subtitles reduces bandwidth and compliance risks, you must still comply with Bilibili’s rules regarding content copyright.

The DSH community adheres to the philosophy that “everything is a plugin”; SkillHub is an independent directory site with no official affiliation with DeepSeek or High-Flyer.

Conclusion

bilibili-note splits Bilibili video note-taking into “subtitle and layout automation” and “contract-based summary judgment,” making it suitable for integration into DSH workflows for Obsidian knowledge accumulation. For directory and metadata, see SkillHub: 3588834014-del/bilibili-note; for source code and detailed instructions, see GitHub: 3588834014-del/bilibili-note.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye