How to Let AI Watch Bilibili Reviews and Generate Buying Guides in Minutes
Discover how to transform Claude AI into a powerful research assistant that automatically fetches Bilibili video subtitles, converts them into clean markdown, analyzes the content, and produces structured product selection reports, all without manually watching videos, using Python scripts, cookies, and Claude Skills.
Why AI Can’t Directly Watch Videos
AI models understand text, not video files. To let an AI "watch" a video, the video must first be converted into subtitles, which are plain text that the model can process.
Human Buying Process on Bilibili
The typical steps a person follows when buying a product from video reviews are:
Open Bilibili and log in.
Search for relevant review videos.
Watch videos and take notes on specifications, noise, durability, etc.
Compare options based on personal needs.
Visit e‑commerce sites to purchase.
The core of this workflow is: search → watch → learn → decide .
Turning the Process into an AI Workflow
Because AI cannot watch videos, the first step is to obtain subtitles via Bilibili’s API. A simple Python script can download subtitle files directly, avoiding the overhead of loading full web pages.
import requests
url = "https://api.bilibili.com/x/player/v2?cid=..."
headers = {"Cookie": "YOUR_BILIBILI_COOKIE"}
resp = requests.get(url, headers=headers)
# parse and save subtitle fileKey points of the script:
It fetches only the subtitle file, keeping the request clean.
It runs quickly without rendering the page.
It works silently in the background.
Why a Cookie Is Required
Bilibili’s anti‑scraping mechanism blocks requests without a valid login cookie. The cookie proves the request comes from an authenticated user, allowing the subtitle data to be returned.
To obtain the cookie:
Log in to Bilibili in a browser.
Press F12 to open Developer Tools.
Go to the Application tab, select Cookies , and copy the name‑value pairs for the Bilibili domain.
Cleaning Subtitles for AI
Subtitle files (e.g., SRT) contain timestamps and sequence numbers that add noise and consume tokens. Removing them yields a dense, high‑information‑density input for the model.
1
00:00:01,000 --> 00:00:03,500
大家好,今天测评加湿器
2
00:00:03,500 --> 00:00:06,000
我们准备了五款不同价位的产品After cleaning, the content becomes:
大家好,今天测评加湿器
我们准备了五款不同价位的产品
首先看第一款,某品牌的入门级产品Building a Claude Skill
Claude Skills package the entire workflow—prompt, script, and documentation—into a reusable "skill bundle". The SKILL.md file describes the skill, its allowed tools, and usage instructions.
---
name: Bilibili Subtitle Fetcher
description: Fetches Bilibili video subtitles, converts to Markdown, and provides product recommendations.
allowed-tools: [Bash, Read, Write, Glob]
---
# B站视频字幕获取与分析
## 功能说明
1. 搜索B站视频
2. 获取视频字幕
3. 分析字幕内容
4. 给出选购建议
## 使用方法
在需要分析测评视频时,调用此脚本获取字幕。
## 注意事项
- 需要提供B站的 Cookie
- 字幕会自动转换为 Markdown 格式The skill can be tested by simply asking Claude: "帮我看看加湿器的 B 站测评,给我选购建议". Claude automatically invokes the skill, fetches subtitles, analyzes them, and returns a structured report with links and timestamps.
Iterating and Improving the Skill
Initial tests may retrieve only a few videos or miss view‑count data. The script can be enhanced to fetch up to 30 videos, sort by view count, and select the top 6 most relevant ones for analysis.
# fetch 30 videos, sort by view count, pick top 6
videos = fetch_videos(query="加湿器测评", limit=30)
sorted_videos = sorted(videos, key=lambda v: v['view'], reverse=True)[:6]
for v in sorted_videos:
subtitles = get_subtitles(v['id'])
# process subtitlesThis iteration reduces token usage while preserving diverse viewpoints, leading to more reliable recommendations.
Future Directions
Potential enhancements include:
Supporting additional platforms (YouTube, Douyin) and falling back to speech‑to‑text when subtitles are absent.
Adding interactive prompts for budget, room size, and special requirements.
Packaging the skill as an open‑source repository for community contributions.
By sharing skills, developers can distribute not only knowledge but also ready‑to‑run tools, accelerating AI adoption across teams.
Conclusion
Transforming a human video‑review workflow into an AI‑driven process involves three steps: (1) extract clean textual data from videos, (2) let the AI analyze the data, and (3) package the whole pipeline as a reusable skill. This approach saves hours of manual work and makes AI a practical assistant for everyday purchasing decisions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
