Ima8 / yt-whisper

Using OpenAI's Whisper to automatically generate YouTube subtitles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic YouTube subtitle generation (A fork from https://github.com/m1guelpf/yt-whisper)

This repository uses yt-dlp and OpenAI's Whisper to generate subtitle files for any youtube video.

Installation

To get started, you'll need Python 3.7 or newer. Install the binary by running the following command:

pip uninstall yt-whisper -y
pip install git+https://github.com/Ima8/yt-whisper.git

Need to install ffmpeg first.

Usage

# Transcribe a local video
yt_whisper ~/Downloads/awesome_video.mp4

# Transcribe a Youtube video (default using `base` model)
yt_whisper "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# Transcribe a Youtube video using a better model (--model is one of `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`, `medium`, `medium.en`, `large`)
yt_whisper https://www.youtube.com/watch?v=6mZagYSymB4 --model large

# Skip language detection and use user's input language
yt_whisper https://www.youtube.com/watch?v=6mZagYSymB4 --language th --model large

# Adding `--task translate` will translate the subtitles into English:
yt_whisper "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --task translate

# Run the following to view all available options:
yt_whisper --help

License

This script is open-source and licensed under the MIT License. For more details, check the LICENSE file.

About

Using OpenAI's Whisper to automatically generate YouTube subtitles

License:MIT License


Languages

Language:Python 100.0%