Skip to content

AI-assisted subtitle generation CLI for Youtube

License

Notifications You must be signed in to change notification settings

yoanbernabeu/Subtitlr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Features

Generate subtitles - 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-****************************

Generate subtitles - 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

Translating subtitles

For translations we offer you the possibility to use the DeepL API with a free account only (500000 per month).

Create an free account on DeepL

You must have previously generated your subtitle file with the generate command.

You can use the following command to translate subtitles:

Subtitlr translate --input input.srt --lang EN --output output_EN.srt --apiKeyDeepl ****************************

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

generate command

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)

translate command

Name Description Required
input Input file true
lang Language to translate (in ISO 639-1 format) true
output Output file true
apiKeyDeepl DeepL API key true

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 [email protected]: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.