Hacker News 中文摘要

RSS订阅

Yt-transcriber – 输入YouTube链接即可获取转录文本 -- Yt-transcriber – Give a YouTube URL and get a transcription

文章摘要

GitHub上的yt-transcriber是一款TUI应用,用户输入YouTube视频链接后,可获取转录文本,支持可能的说话人识别、摘要生成或翻译功能,利用开源AI工具帮助用户节省观看冗长视频的时间。

文章总结

GitHub 项目:yt-transcriber

项目简介
yt-transcriber 是一个基于文本用户界面(TUI)的应用程序,用户只需提供一个 YouTube 视频链接或本地音视频文件路径,即可生成视频的文字转录。该工具还支持可能的说话人识别、摘要生成和翻译功能。这些功能依赖于开源 AI 工具,旨在帮助用户节省观看内容稀疏的 YouTube 视频的时间。

主要功能
- 视频转录:支持通过 YouTube 链接或本地文件生成文字转录。
- 说话人识别:通过结合 LLM(大语言模型)和说话人分割库,识别不同说话者(功能仍在开发中)。
- 摘要生成:通过 summarize 脚本生成视频摘要,需设置 OPENAI_API_KEY
- 翻译功能:通过 translate 脚本将转录内容翻译为指定语言,需设置 OPENAI_API_KEY
- 多格式支持:支持几乎所有 ffmpeg 能处理的音视频格式。
- 测试套件:可通过 yt-transcriber TESTTEST=1 yt-transcriber 运行测试。
- 扩展支持:未来计划支持其他视频平台,并可能转换为 Web 服务或应用。

安装说明
- Nix 用户:如果已安装 Nix 或使用 NixOS,只需将 yt-transcribersummarizetranslate 脚本链接到 PATH 中的目录即可。脚本会自动获取并缓存所有依赖项。
- 非 Nix 用户:可手动安装 shellpython312ffmpegglow 等依赖项,但作者不保证兼容性。
- Python 依赖:通过 pip 安装到 $XDG_CACHE_HOME/yt-transcriber/.venv 目录中。
- Whisper 模型:下载到 $XDG_CACHE_HOME/yt-transcriber/.whisper 目录。

使用示例
- 生成转录并保存到文件:
shell ./yt-transcriber -m medium "https://www.youtube.com/watch?v=<youtube_id>" > ~/Documents/transcript.txt - 生成转录并生成摘要:
shell ./yt-transcriber -m small "/path/to/video/or/audio/file.mp4" | ./summarize | ./translate Süddeutsch > ~/Documents/bavarian_german_summary.txt - 生成转录并使用 glow 美化输出:
shell yt-transcriber "https://www.youtube.com/watch?v=<youtube_id>" | summarize --markdown | glow

项目背景
该项目旨在利用开源 AI 工具,帮助用户快速获取 YouTube 视频的文字内容,节省观看时间。作者因缺乏足够时间观看内容稀疏的视频而开发了此工具。

许可证
项目采用 MIT 许可证

项目状态
截至 2025 年 3 月,项目已获得 90 颗星,暂无分叉。主要开发语言为 Shell(96.6%)和 Nix(3.4%)。

评论总结

评论主要围绕视频转录工具的使用和替代方案展开,观点如下:

  1. 使用GPT编写脚本的便捷性

    • cmaury认为使用GPT编写脚本比使用他人的代码库更快捷。
      • "It takes 5 seconds to ask GPT to write a script to do this tailored to your specific use case."
      • "It's way faster than trying to get someone else's repo up and running."
  2. 转录技术的挑战

    • mikeve指出说话人分离(speaker diarization)技术复杂,常用工具如pyannote效果不佳。
      • "Speaker diarization is surprisingly tricky to do."
      • "The most common approach seems to be to use pyannote, but the quality is not amazing..."
  3. 利用YouTube现有字幕

    • paulirish和0points建议直接使用YouTube的自动生成字幕,并通过yt-dlp工具获取。
      • "Can also just fetch the subs already in YouTube rather than retranscribing."
      • "Youtube already offers AI transcriptions on their site."
  4. 其他转录工具推荐

    • isubkhankulov和Leftium推荐了其他转录工具和项目,如ContentFlow和基于whisper的Python脚本。
      • "I’ve been using this free tool. It gives quality diarized transcripts."
      • "They all seem to be built on top of yt-dlp, whisper, and ffmpeg."
  5. 自动转录工具的改进

    • eigenvalue分享了自己开发的工具,能够自动转录整个播放列表,并生成优化后的文档。
      • "I made a tool like this a while ago which was useful for transcribing a whole playlist automatically using whisper."
      • "I ended up turning a beefed up version of it which makes polished written documents from the raw transcript."

总结:评论者普遍认为转录工具的使用存在多种选择,GPT编写脚本、YouTube现有字幕、以及基于whisper的工具都是可行的替代方案,但转录技术尤其是说话人分离仍具挑战性。