Some readers have asked me if they could automate note-taking from Bilibili videos. I created a Skill for that and now I’m open-sourcing it.
The Skill does this: give it a Bilibili link, it automatically downloads the video’s audio, sends it to AI for transcription, uses another AI to generate a summary, and finally saves both the full transcript and summary into an Obsidian inbox.
The whole process requires no manual operation; just wait a bit and it’s done.
Tools Required
This Skill requires a few tools to work together.
yt-dlp
This is a command-line tool for downloading audio/video from various platforms. The Skill uses it to download the audio stream from Bilibili videos as M4A files.
macOS Installation (recommended):
brew install yt-dlp
If you don’t have Homebrew, you can also install via pip:
pip install yt-dlp
ffmpeg
yt-dlp depends on ffmpeg for audio processing; without it, errors may occur.
brew install ffmpeg
Python 3
The Skill includes a Python script that handles API calls, file processing, and template rendering. macOS usually comes with Python 3; verify with:
python3 -V
As long as you see a version number, that’s fine. No specific version required.
Gemini API (Audio Transcription)
Transcription uses Google’s Gemini model, specifically gemini-3-flash-preview.
This model has a daily free quota for regular Google accounts, sufficient for daily use. If you exceed the quota, you’ll get a 429 error; just wait until the next day when the quota resets.
Get an API Key at: aistudio.google.com
Once inside, click Get API key on the left and create one.
DeepSeek API (Content Summarization)
Summarization uses DeepSeek, which I find suits my summarization habits.
Get an API Key at: platform.deepseek.com
Register an account, then create an API Key. DeepSeek’s API is very affordable; a small top-up lasts a long time.
Installation and Usage
Step 1: Download the Skill Package
Download from my blog: https://blog.discoverlabs.ac.cn/downloads/bili-to-obsidian-skill/
After extracting, place the folder in ~/.claude/skills/, ensuring the path is ~/.claude/skills/bili_to_obsidian/.
Step 2: Fill in the Configuration
Open ~/.claude/skills/bili_to_obsidian/scripts/bili_to_obsidian.py and find the first few lines:
API_KEY = "YOUR_GEMINI_API_KEY"
DEEPSEEK_API_KEY = "YOUR_DEEPSEEK_API_KEY"
TEMPLATE_PATH = Path("/path/to/your/Obsidian-vault/02-Templates/Note.md")
OUTPUT_DIR = Path("/path/to/your/Obsidian-vault/00-Inbox")
Modify these fields:
YOUR_GEMINI_API_KEY: Replace with the key you obtained from aistudio.google.comYOUR_DEEPSEEK_API_KEY: Replace with the key you obtained from DeepSeekTEMPLATE_PATH: Replace with the full path to your Obsidian note templateOUTPUT_DIR: Replace with the full path to your Obsidian inbox
If you don’t use an Obsidian note template, you can set TEMPLATE_PATH to any non-existent path; the script will generate a basic format if the template is not found, which still works.
Step 3: Invoke
In Claude Code, enter:
/bili_to_obsidian paste-the-Bilibili-video-link-here
Then wait for it to finish; it usually completes within a few minutes.
Important Notes
Gemini’s free quota is limited per day. If you process many videos in a day and encounter a 429 error, you’ve exceeded the quota. Wait until the next day for the quota to reset. If you frequently exceed it, register multiple Google accounts and rotate API keys.
The path lines must be changed to your own. The ones in the download package are from my computer; using them directly will cause errors.
The format is based on my Obsidian template. If your template structure differs, the transcript content may be placed incorrectly. In that case, just give the script to an AI, describe your template structure, and ask it to adjust the anchor points.
Download
Download from my blog (I’ve removed my own API keys):
https://blog.discoverlabs.ac.cn/downloads/bili-to-obsidian-skill/
I’ve been using this Skill for a while. It’s especially convenient for transcribing educational Bilibili videos and saving them directly into Obsidian for reference.
Additionally, the audio download uses yt-dlp, which supports not only Bilibili but also hundreds of video sites like YouTube, Twitter, Douyin, etc. So this Skill isn’t limited to Bilibili; you can use it with links from other platforms as well. Feel free to try it out and extend it further.