Skip to main content

AI 视频笔记生成 CLI 工具

Project description

BiliNote-CLI

English | 简体中文

AI 视频笔记生成工具 - 让 AI 为你的视频做笔记

项目说明:本项目基于 BiliNote fork 并进行大量重构。
感谢原作者 Jeffery Huang 的杰出工作。

功能

让 ai 自动把视频转换为 markdown 格式笔记

  • 多平台支持:Bilibili、YouTube、抖音、快手、本地视频
  • AI 笔记生成:支持 DeepSeek、OpenAI、Qwen 等
  • 截图插入、视频跳转链接、多模态理解
  • 批量执行、关键词搜索

安装

# 安装 CLI
uv tool install bilinote-cli

# 安装 FFmpeg(必需)
brew install ffmpeg  # macOS
winget install ffmpeg # Windows
# Windows还可以:从 ffmpeg.org 下载,解压后,再将 bin 文件夹路径添加到系统环境变量 PATH 中

配置

# 设置 API Key(必需)
bilinote config set DEEPSEEK_API_KEY sk-your-api-key

# 设置 Cookie(推荐,用于获取平台字幕、避免被反爬虫)
bilinote config set BILIBILI_COOKIE "SESSDATA=xxx; ..."

# 查看配置状态
bilinote config list

其他配置在 ~/.bilinote/config.yaml

  • windows: C:\Users\<user_name>\.bilinote\config.yaml
transcriber:
  default_type: "bcut" # 默认音频转写器
  whisper_model_size: "base"

使用

# 基础用法
bilinote process "https://www.bilibili.com/video/BV1mQ9jBcEf4"

# 批量处理
bilinote process "<url1>" "<url2>"

# 带截图和链接
bilinote process "<url>" --screenshot --link --style 学术风

# 多模态理解(AI 看画面)
bilinote process "<url>" --video-understanding --model gpt-4o

# 自定义输出目录
bilinote process "<url>" --output-dir ./notes/

# 搜索视频
bilinote search "Python 教程" --platform bilibili

# 其他命令
bilinote model-list            # 列出可用模型
bilinote model-set-default deepseek  # 设置默认模型
bilinote check # 检查环境(ffmpeg、LLM可用性)
bilinote install-shortcut # 安装 macOS 快捷指令(推荐)

目录结构

~/.bilinote/ #windows: C:\Users\<user_name>\.bilinote\
├── data/
│   ├── downloads/     # 下载的音频   ├── cache/         # 转写缓存   ├── output/notes/  # 生成的笔记★   └── state/         # 任务状态
├── config.yaml        # 用户配置★
└── logs/

命令说明

命令 说明
process <url> 处理视频生成笔记
search <keyword> 搜索视频并批量生成
model-list 列出可用模型
model-set-default <model> 设置默认模型
config set <key> <value> 设置密钥
config list 查看配置状态
install-shortcut 安装快捷指令(仅限 macOS)
check 环境检查

process 参数

参数 说明
--model AI 模型,如 deepseek-chat, gpt-4o
--quality 音频质量:fast, medium, slow
--screenshot 插入视频截图
--link 插入视频跳转链接
--style 笔记风格:学术风、口语风等
--video-understanding 启用多模态理解
--output-dir 输出目录路径

【指南】提取 Safari Cookie

  1. 打开 Safari 的开发者模式。
  2. 在浏览器中打开目标网站,按 F12(或 Cmd + Opt + I)打开开发者工具。
  3. 切换到 Network (网络) 标签页。
  4. 刷新页面,随便找一个请求,右键点击该请求。
  5. 选择 Copy -> Copy as cURL
  6. 在你的剪贴板里,你会看到一串完整的命令,其中 -H 'cookie: ...' 后面就是该网站的所有 Cookie。

【指南】使用快捷指令一键运行(仅限 macOS)

安装快捷指令:终端运行 bilinote install-shortcut

使用方式

  1. 浏览器内点击网址栏,选择到 B 站视频链接的网址文本。
  2. 点击菜单栏(屏幕左上角)的浏览器 App 名称(如“Safari”)。
  3. 点击【服务】 -> 【BiliNote】

【指南】配置 whisper-cpp 作为本地音频转写器

macOS 安装 whisper.cpp 指南

1. 安装 whisper-cpp

brew install whisper-cpp

2. 下载模型

# 创建目录并进入
mkdir -p ~/whisper-models && cd ~/whisper-models
# 下载模型(以 base 模型为例)
curl -L -o ggml-base.bin 'https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin?download=true'
  • 或:到 huggingface 网站 下载 whisper 模型。手动移动到模型存储目录。
  • ⚠️ 注意:如果你选择把模型放入其他目录,那么需在 config.yaml 内修改模型地址。

Windows 安装 whisper.cpp 指南

1. 下载程序

  • 访问 whisper.cpp Github Releases 页面
  • 下载软件压缩包:
    • CPU 版:whisper-bin-x64.zip
    • NVIDIA 显卡加速版:whisper-cublas-12.4.0-bin-x64.zip
  • 解压到固定目录,如 D:\ProgramFiles\whispercpp

2. 下载模型

  • 访问 Huggingface 模型页面
  • 下载 ggml-base.bin(或其他模型)
  • 建议放入 D:\ProgramFiles\whispercpp\models\

3. 添加到 PATH

管理员身份打开命令提示符,执行:

setx /M PATH "D:\ProgramFiles\whispercpp;%PATH%"
  • ⚠️ 注意:上面的 D:\ProgramFiles\whispercpp 需替换为 whisper-cli.exe 所在的目录。
  • 重启命令提示符后生效。
  • 验证是否安装成功:whisper-cli --help
  • 如果安装遇到问题,建议手动在系统环境变量中添加。

配置 whisper-cpp(macOS / Windows 通用)

在 config.yaml 中填写模型文件(如ggml-base.bin)的路径:

transcriber:
  default_type: "whisper-cpp"
  whisper-cpp:
    model_path: "D:/ProgramFiles/whispercpp/models/ggml-base.bin"  # Win
    # model_path: "~/whisper-models/ggml-base.bin"                 # macOS
  • ⚠️ 注意:地址应该使用 / 而不是 \
  • ⚠️ 注意:如果模型放在其他位置,model_path 需相应修改。

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilinote_cli-0.1.2.tar.gz (121.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilinote_cli-0.1.2-py3-none-any.whl (120.5 kB view details)

Uploaded Python 3

File details

Details for the file bilinote_cli-0.1.2.tar.gz.

File metadata

  • Download URL: bilinote_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 121.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilinote_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 eacd545c2142a70119f72ea413cc195db082f7c790a7ab8a6c44e41acd622c4d
MD5 85d6cd1dafdddd878f3bbd34d8361092
BLAKE2b-256 3a25a9e9fb92b720d9548c770a9391a6691f8b6b4ad96aee8cb8890d6a4edccf

See more details on using hashes here.

File details

Details for the file bilinote_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bilinote_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 120.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilinote_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c9b502f81a765e9dc353191e40db5c390a2cf4c3cf60aef77390d0ff3ca1919a
MD5 2b2747e4e4c8555c2864f8d239da9ad9
BLAKE2b-256 0adf5703e99a5133e1cd57e9e73d883bd6ade4604a20239c40614751f87c2277

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page