Loading...
Loading...
A comprehensive tool for searching, analyzing, and extracting Bilibili video content. This skill must be triggered whenever users mention Bilibili, provide Bilibili links (bilibili.com, b23.tv), request to search for specific videos, extract video metadata (title, uploader, view count, description), obtain video subtitles, or retrieve comments/barrage for analysis and summarization. It supports handling 412 risk control prompts and Cookie injection.
npx skill4agent add hwj123hwj/custom-skills bilibili-video-helper| Function | API | Cookie Required |
|---|---|---|
| Video Search | | ❌ |
| Video Details | | ❌ |
| Comment List | | ❌ |
| Subtitle List | | ✅ |
| Barrage | | ✅ |
Please log in to Bilibili on your desktop browser, press F12 to open Developer Tools, switch to the Network tab, refresh the page and click any request, then copy the entire cookie: ... content from the Request Headers on the right and send it to me.COOKIE='The complete cookie content provided by the user'GET /x/web-interface/search/typecurl -s "https://api.bilibili.com/x/web-interface/search/type?keyword=AI&page=1&page_size=10&search_type=video" | \
jq '.data.result[] | {title: .title, author: .author, play: .play, duration: .duration, bvid: .bvid}'keywordpagepage_sizesearch_type=videotitle<em class="keyword">authorplaydurationbvidGET /x/web-interface/viewBVID="BV1hNFdz4EZp"
curl -s "https://api.bilibili.com/x/web-interface/view?bvid=$BVID" | \
jq '.data | {title, bvid, aid, cid, owner: .owner.name, desc, duration, stat}'| Field | Explanation |
|---|---|
| Title |
| BVID |
| AID |
| CID of the video segment |
| Uploader |
| Description |
| Duration (seconds) |
| View count |
| Like count |
| Coin count |
| Favorite count |
| Share count |
| Barrage count |
| Comment count |
GET /x/v2/replyAID=$(curl -s "https://api.bilibili.com/x/web-interface/view?bvid=$BVID" | jq -r '.data.aid')curl -s "https://api.bilibili.com/x/v2/reply?type=1&oid=$AID&sort=1&ps=30" | \
jq '.data.page, (.data.replies | length)'curl -s "https://api.bilibili.com/x/v2/reply?type=1&oid=$AID&sort=1&ps=20" | \
jq -r '.data.replies | sort_by(-.like) | .[] | "【\(.member.uname)】\(.content.message[:100])... [👍\(.like)]"'type=1oidsort=0sort=1sort=2pspnGET /x/player/v2CID=$(curl -s "https://api.bilibili.com/x/web-interface/view?bvid=$BVID" | jq -r '.data.cid')curl -s "https://api.bilibili.com/x/player/v2?bvid=$BVID&cid=$CID" \
-H "Cookie: $COOKIE" \
-H "Referer: https://www.bilibili.com/video/$BVID" | \
jq '.data.subtitle.subtitles[] | {lan: .lan, lan_doc: .lan_doc, url: .subtitle_url}'{"lan": "ai-zh", "lan_doc": "中文", "url": "//aisubtitle.hdslb.com/..."}
{"lan": "ai-en", "lan_doc": "English", "url": "//aisubtitle.hdslb.com/..."}SUBTITLE_URL="https://aisubtitle.hdslb.com/bfs/ai_subtitle/prod/xxx"
curl -s "$SUBTITLE_URL" | jq -r '.body[].content'ai-zhai-enai-jaai-esai-ptai-aryt-dlpyt-dlp --add-header "Cookie:$COOKIE" --write-sub --sub-lang danmaku --skip-download -o "/tmp/%(id)s.%(ext)s" "https://www.bilibili.com/video/$BVID"cat /tmp/${BVID}.danmaku.xml | sed 's/<d /\n<d /g' | grep -oP '>[^<]+<' | tr -d '<>' | grep -v '^$'GET /x/space/wbi/arc/searchUID="12345678"
curl -s "https://api.bilibili.com/x/space/arc/search?mid=$UID&ps=30&pn=1&order=pubdate" \
-H "User-Agent: Mozilla/5.0" | \
jq '.data.list.vlist[] | {bvid: .bvid, title: .title, play: .play, created: .created, length: .length}'midpspnorderpubdateclickfor pn in 1 2 3; do
curl -s "https://api.bilibili.com/x/space/arc/search?mid=$UID&ps=30&pn=$pn&order=pubdate" \
-H "User-Agent: Mozilla/5.0" | \
jq -r '.data.list.vlist[].bvid'
sleep 1.5
doneBVID="BV1xx411c7mD"
yt-dlp --add-header "Cookie:$COOKIE" \
-f bestaudio \
--extract-audio --audio-format mp3 \
-o "/tmp/%(id)s.%(ext)s" \
"https://www.bilibili.com/video/$BVID"AUDIO_FILE="/tmp/${BVID}.mp3"
SILICONFLOW_API_KEY="your_api_key"
curl -s "https://api.siliconflow.cn/v1/audio/transcriptions" \
-H "Authorization: Bearer $SILICONFLOW_API_KEY" \
-F "file=@${AUDIO_FILE};type=audio/mpeg" \
-F "model=FunAudioLLM/SenseVoiceSmall" | \
jq -r '.text'CREATE TABLE IF NOT EXISTS bili_videos (
bvid VARCHAR(20) PRIMARY KEY,
title TEXT,
up_name VARCHAR(255),
up_mid BIGINT,
duration INTEGER, -- seconds
view_count INTEGER,
like_count INTEGER,
coin_count INTEGER,
pub_time TIMESTAMP,
content TEXT, -- Subtitle or ASR transcribed text
source VARCHAR(20), -- 'subtitle' or 'asr'
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);psql $DATABASE_URL -c "
INSERT INTO bili_videos (bvid, title, up_name, up_mid, pub_time, content, source)
VALUES ('BV1xx411c7mD', 'Video Title', 'Uploader Name', 12345678, '2024-01-01', 'Subtitle text...', 'subtitle')
ON CONFLICT (bvid) DO UPDATE SET content = EXCLUDED.content;
"DATABASE_URLjqyt-dlp