/Subtitlr

AI-assisted subtitle generation CLI for Youtube

Primary LanguageGoMIT LicenseMIT

Subtitlr (Experimental)

GitHub release (latest by date) GitHub

AI-assisted subtitle generation CLI for Youtube

Subtitlr

Description

This application, a subtitle generator for YouTube, utilizes OpenAI's Whisper API.

This tool leverages artificial intelligence to efficiently transcribe speech in YouTube videos into text, thereby generating accurate subtitles (in SRT format).

It's designed to improve the accessibility and convenience of video content, ensuring that no matter your language or hearing ability, you can fully engage with and comprehend the material.

Usage - The simplest way

The simplest way to use Subtitlr without configuration is to use the following command:

Subtitlr generate --id qJpR1NBx4cU --lang fr --output output.srt --apiKey sk-****************************

Usage - With configuration

You can also use a .env file to store your API key (in OPENAI_API_KEY variable) and use the following command:

Subtitlr configure --apiKey sk-****************************

And after that, you can use the following command without the --apiKey parameter:

Subtitlr generate --id qJpR1NBx4cU --lang fr --output output.srt

Requirements

  • OpenAI API key
  • FFmpeg
  • Linux (tested on Ubuntu 22.04), MacOS (not tested), Windows (not tested)
  • You have read/write rights to the current directory

Parameters

Name Description Required
id Youtube video id true
lang Language speaking in the video (in ISO 639-1 format) true
output Output file true
apiKey OpenAI API key false (if you use the configure command)

Installation

From binary

  • Linux/Darwin

Using cURL

wget -qO- https://raw.githubusercontent.com/yoanbernabeu/Subtitlr/main/install.sh | bash

Using wget

curl -sL https://raw.githubusercontent.com/yoanbernabeu/Subtitlr/main/install.sh | bash

From source

Subtitlr is written in Go, so you need to install it first.

git clone git@github.com:yoanbernabeu/Subtitlr.git
cd Subtitlr
go build -o Subtitlr

License

MIT

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.