bilibili-to-ima-note

Used when a user shares a Bilibili video link and wants structured notes saved to the IMA knowledge base. This skill covers: extracting the BV ID from the URL, fetching video information/metadata via the Bilibili API, generating structured Markdown notes, and creating/updating IMA notes via OpenAPI with the video link attached. It can also be triggered by requests like “take a note” that include a Bilibili link.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "bilibili-to-ima-note" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-109cef0973d50c2a74a8942068c6b7d8347fc3b184a25153a73a013ca0a173f2. Verify the upstream source and version against https://skillhub.cn/skills/user_0e231422/bilibili-to-ima-note before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Used when a user shares a Bilibili video link and wants structured notes saved to the IMA knowledge base. This skill covers: extracting the BV ID from the URL, fetching video information/metadata via the Bilibili API, generating structured Markdown notes, and creating/updating IMA notes via OpenAPI with the video link attached. It can also be triggered by requests like “take a note” that include a Bilibili link.

0 Downloads

Introduction source: third_party · user_0e231422 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: bilibili-to-ima-note
description: "This skill should be used when the user shares a Bilibili video URL (bilibili.com) and wants to generate structured notes, summaries, or study notes from the video, then save them to IMA (ima知识库) notes automatically. It covers: extracting BV ID from URL, fetching video info/metadata via Bilibili API, generating structured markdown notes, creating/updating IMA notes via OpenAPI, and appending the video link. Also triggered by requests like \"记笔记\" combined with a Bilibili link."

Bilibili to IMA Note

Overview

Fetch Bilibili video metadata via official API, generate structured markdown notes, and save them to IMA (ima知识库) notes via the IMA OpenAPI. When a note already exists for the same video, append the new content and video link.

Prerequisites

IMA Credentials

IMA credentials must be stored at one of:

  • ~/.config/ima/client_id — Client ID
  • ~/.config/ima/api_key — API Key

Or set as environment variables:

  • IMA_OPENAPI_CLIENTID
  • IMA_OPENAPI_APIKEY

IMA API Script

The IMA OpenAPI wrapper script is located at the pre-installed ima-skill:

  • ~/.workbuddy/skills/skill_2053082144792322048/ima_api.cjs

Always use the full absolute path to this script. Do NOT rely on PATH.

Node.js Runtime

Use the managed Node.js binary:

  • C:\Users\枉凝眉\.workbuddy\binaries\node\versions\22.22.2\node.exe

Workflow

Step 1: Extract BV ID and Fetch Video Info

Given a Bilibili URL (e.g. https://www.bilibili.com/video/BV1ctjm67EiY/), extract the BV ID (the BV followed by alphanumeric characters in the URL path).

Fetch video metadata from the official Bilibili API:

https://api.bilibili.com/x/web-interface/view?bvid={BV_ID}

Key fields to extract from the response data object:

  • title — video title
  • owner.name — UP主 name
  • owner.mid — UP主 mid
  • duration — video duration in seconds
  • desc — video description
  • stat — stats (view, like, favorite, coin, share, reply)
  • tid / tname — category
  • pubdate — publish timestamp (Unix)

Step 2: Generate Structured Notes

Generate markdown notes covering the following structure:

# {Title}

> **视频信息**
> - UP 主:{name}
> - 时长:{duration}秒({minutes}分{seconds}秒)
> - 来源:Bilibili({bvid})
> - 标签:{tags}

---

## 内容概要

[Generate a comprehensive summary of the video based on the title and description.
If description is limited, infer likely content from the title and category.]

---

## 关键知识点

[Organize key points from the video into structured sections with bullet points.]

---

## 总结

[1-2 paragraph summary of the key takeaways.]

Step 3: Save to IMA

Use the IMA OpenAPI to create a note:

node "{IMA_API_SCRIPT}" "openapi/note/v1/import_doc" '{"content_format": 1, "content": "{MARKDOWN_CONTENT_ESCAPED}"}' '{"clientId":"{CLIENT_ID}","apiKey":"{API_KEY}"}'

IMPORTANT — Proper escaping: The content field contains markdown with special characters. Use one of these approaches:

Approach A — Node.js script (preferred): Write a small .cjs script that reads the content from a file, constructs the JSON body programmatically, then calls imaApi by requiring ima_api.cjs directly.

Example:

const path = require('path');
const SKILL_DIR = 'C:/Users/枉凝眉/.workbuddy/skills/skill_2053082144792322048';
const { imaApi } = require(path.join(SKILL_DIR, 'ima_api.cjs'));
const opts = {
  clientId: 'XXXX',
  apiKey: 'XXXX'
};
(async () => {
  const r = await imaApi('openapi/note/v1/import_doc', {
    content_format: 1,
    content: '... markdown ...'
  }, opts);
  console.log('RESULT:', r);
})().catch(e => console.error('ERR:', e.message || e.msg || e));

Approach B — Search then append (if note may already exist): Before creating, search for existing notes by title using search_note. If found, use append_doc instead of import_doc to add content to the existing note.

Search:

openapi/note/v1/search_note
Body: {"search_type": 0, "query_info": {"title": "关键词"}, "start": 0, "end": 5}

Append (if note exists):

openapi/note/v1/append_doc
Body: {"note_id": "EXISTING_NOTE_ID", "content_format": 1, "content": "\n\n---\n\n[追加的新内容]"}

Step 4: Append Video Link

After creating the note, append the video link at the end:

openapi/note/v1/append_doc
Body: {"note_id": "NOTE_ID", "content_format": 1, "content": "\n\n---\n\n> **视频链接**:[点击观看原视频]({VIDEO_URL})"}

Credential Handling

Credentials are read by ima_api.cjs automatically from:

  1. Options JSON passed as 3rd argument (highest priority)
  2. Environment variables IMA_CLIENT_ID / IMA_API_KEY / IMA_OPENAPI_CLIENTID / IMA_OPENAPI_APIKEY
  3. Files ~/.config/ima/client_id and ~/.config/ima/api_key

When calling directly, pass credentials via the options JSON in the 3rd argument. When credentials are stored in the config files, the third argument can be '{}' or omitted entirely.

Error Handling

  • Bilibili API fails: Try fetching again. If the API returns code !== 0, report the error message to the user.
  • IMA API fails (-100 programmatic error): Check credentials first, then retry.
  • IMA API fails (-200 update available): Follow the update instruction to update the ima-skill, then retry.
  • Content too large: Split into multiple append_doc calls.
  • PowerShell encoding: If running in PowerShell 5.1, the request body will be silently converted to GBK. Either use Git Bash, PowerShell 7+, or the UTF-8 byte array workaround. See the ima-skill SKILL.md for details.

Platform Notes

  • Git Bash (Bash tool): Use forward slashes for paths. The managed node binary works with full paths.
  • PowerShell: PowerShell 5.1 silently encodes request body as GBK. Use UTF-8 byte array mode or switch to Git Bash. Prefer Git Bash for IMA API calls.
  • Python managed runtime: Available at C:\Users\枉凝眉\.workbuddy\binaries\python\versions\3.13.12\python.exe
  • Node.js managed runtime: Available at C:\Users\枉凝眉\.workbuddy\binaries\node\versions\22.22.2\node.exe

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决用户从 Bilibili 视频生成结构化学习笔记的实际需求
  • 具备明确的场景定位和广泛的实用价值
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖多种用户表达变体
  • 边界清晰,不易与其他 Skill 重叠
Structure and Standards90/100

Areas to improve

  • 缺少 When to Use 显式章节 Reported severity: Minor

    文档结构完整但未显式标注 When to Use 章节

    Recommendation: 建议在 Overview 后添加显式的 When to Use 章节以提升可读性

Highlights

  • Phase/步骤划分清晰,执行流程明确
  • 包含完整的端到端示例和错误处理说明
Execution Reliability85/100

Highlights

  • 工具来源明确,参数使用正确
  • 覆盖主要异常场景并提供解决方案
  • 对平台差异(PowerShell/Git Bash)有详细说明
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • api.bilibili.com
  • www.bilibili.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.