bilibili-to-ima-note
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.
Introduction source: third_party · user_0e231422 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
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_CLIENTIDIMA_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 titleowner.name— UP主 nameowner.mid— UP主 midduration— video duration in secondsdesc— video descriptionstat— stats (view, like, favorite, coin, share, reply)tid/tname— categorypubdate— 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:
- Options JSON passed as 3rd argument (highest priority)
- Environment variables
IMA_CLIENT_ID/IMA_API_KEY/IMA_OPENAPI_CLIENTID/IMA_OPENAPI_APIKEY - Files
~/.config/ima/client_idand~/.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 (
-100programmatic error): Check credentials first, then retry. - IMA API fails (
-200update available): Follow the update instruction to update the ima-skill, then retry. - Content too large: Split into multiple
append_doccalls. - 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
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决用户从 Bilibili 视频生成结构化学习笔记的实际需求
- 具备明确的场景定位和广泛的实用价值
Highlights
- 触发词精准完整,覆盖多种用户表达变体
- 边界清晰,不易与其他 Skill 重叠
Areas to improve
-
缺少 When to Use 显式章节 Reported severity: Minor
文档结构完整但未显式标注 When to Use 章节
Recommendation: 建议在 Overview 后添加显式的 When to Use 章节以提升可读性
Highlights
- Phase/步骤划分清晰,执行流程明确
- 包含完整的端到端示例和错误处理说明
Highlights
- 工具来源明确,参数使用正确
- 覆盖主要异常场景并提供解决方案
- 对平台差异(PowerShell/Git Bash)有详细说明
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.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 13, 15, 17, 95, 109
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
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.
User discussion
No verified reviews yet.