youtube-transcript

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

YouTube Transcript

YouTube 字幕文本提取

Fetch transcripts from YouTube videos.
从YouTube视频中提取字幕文本。

Setup

环境搭建

bash
cd {baseDir}
npm install
bash
cd {baseDir}
npm install

Usage

使用方法

bash
{baseDir}/transcript.js <video-id-or-url>
Accepts video ID or full URL:
  • EBw7gsDPAYQ
  • https://www.youtube.com/watch?v=EBw7gsDPAYQ
  • https://youtu.be/EBw7gsDPAYQ
bash
{baseDir}/transcript.js <视频ID或完整链接>
支持视频ID或完整链接:
  • EBw7gsDPAYQ
  • https://www.youtube.com/watch?v=EBw7gsDPAYQ
  • https://youtu.be/EBw7gsDPAYQ

Output

输出结果

Timestamped transcript entries:
[0:00] All right. So, I got this UniFi Theta
[0:15] I took the camera out, painted it
[1:23] And here's the final result
带时间戳的字幕条目:
[0:00] 好的,我拿到了这个UniFi Theta
[0:15] 我把相机拿出来,给它喷了漆
[1:23] 这就是最终的成果

Notes

注意事项

  • Requires the video to have captions/transcripts available
  • Works with auto-generated and manual transcripts
  • 要求视频本身提供字幕/字幕文本
  • 支持自动生成和手动添加的字幕