AI-assisted subtitle generation CLI for Youtube
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.
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-****************************
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
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 ****************************
- 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
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) |
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 |
- 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
- Windows (Not tested): Download the latest release
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
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.