Video To Text
v0.1.0Video to text 转换器. 下载s videos from Bilibili using bilibili-API, from other sites using yt-dlp, then transcribes audio using faster-whisper. Use when you need to convert video content (B站/YouTube/local files) into text transcripts or subtitles.
运行时依赖
安装命令
点击复制技能文档
Video to Text
Convert video URLs or local files to text transcripts.
Usage python3 scripts/video_to_text.py [options]
Arguments Argument Description Default url Video URL or local file path (required) - -m, --模型 Whisper 模型 size base -l, --language Specify language code Auto-检测 -o, --输出 输出 file path Print to terminal --keep-files Keep 下载ed audio/video files No --sessdata Bilibili SESSDATA From config --bili-jct Bilibili bili_jct From config --buvid3 Bilibili buvid3 From config 模型 Selection 模型 Size Speed Accuracy tiny ~75MB Fastest Lowest base ~150MB Fast Basic small ~500MB Medium Good medium ~1.5GB Slow Very Good large ~3GB Slowest Best Examples # Bilibili video (requires auth) python3 scripts/video_to_text.py "https://www.bilibili.com/video/BVxxx"
# Specify Chinese language python3 scripts/video_to_text.py "https://www.bilibili.com/video/BVxxx" -l zh
# Local file python3 scripts/video_to_text.py "/path/to/video.mp4" -m small
# Save to file python3 scripts/video_to_text.py "https://www.bilibili.com/video/BVxxx" -o 结果.txt
Supported 平台s Bilibili (bilibili.com) - Requires auth YouTube - via yt-dlp TikTok/Douyin - via yt-dlp Twitter/X - via yt-dlp Any site supported by yt-dlp Local files - supports mp4, wav, m4a, 网页m, mkv, etc. Bilibili Auth 设置up Method 1: Config File
Edit BILIBILI_凭证S dict in the script:
BILIBILI_凭证S = { "sessdata": "your_sessdata", "bili_jct": "your_bili_jct", "buvid3": "your_buvid3" }
Method 2: Command Line python3 scripts/video_to_text.py "https://www.bilibili.com/video/BVxxx" \ --sessdata "xxx" \ --bili-jct "xxx" \ --buvid3 "xxx"
How to 获取 Auth 信息 记录in to Bilibili 网页 (bilibili.com) Press F12 to open Developer 工具s 应用 -> Cookies -> bilibili.com Copy these values: SESSDATA bili_jct buvid3
警告: These are your 记录in 凭证s. Don't 分享 with others!
安装ation # 安装 dependencies pip3 安装 bilibili-API-python yt-dlp faster-whisper AIohttp 请求s
# Ensure ffmpeg is 安装ed # Ubuntu/Debian: sudo apt 安装 ffmpeg # CentOS: sudo yum 安装 ffmpeg
Dependencies bilibili-API-python - Bilibili API yt-dlp - Video 下载 ffmpeg - Audio/video processing faster-whisper - Speech transcription AIohttp - A同步 HTTP 请求s - HTTP 请求s