Skip to content

nkovalcin/video-script-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Script Translator

Translate and reformat YouTube video transcripts into polished scripts using OpenAI GPT-4. Supports any language pair and multiple storytelling frameworks.

Table of Contents

What It Does

  1. Takes a raw YouTube transcript (plain text file)
  2. Splits it into chunks to handle token limits
  3. Translates from source to target language via GPT-4 Turbo
  4. Reformats the content using a storytelling framework
  5. Outputs a polished, ready-to-use video script

Storytelling Frameworks

Framework Description
Hero's Journey Starts with a problem/crisis, analyzes the situation, ends with a hopeful vision
Problem-Solution-Future Problem first, then analysis, then positive outlook
Narrative Circle Starts and ends with the same idea/metaphor, but with a new perspective
Contrast & Compare Multiple perspectives side by side for balanced analysis

Requirements

pip install -r requirements.txt

Usage

Interactive mode

python translate.py --input transcript.txt

The script will prompt you to select a language, framework, and style.

Full CLI mode

python translate.py \
  --input transcript.txt \
  --output script.txt \
  --source-lang English \
  --target-lang Spanish \
  --framework "Problem-Solution-Future" \
  --style "dynamic and engaging"

Environment variable for API key

export OPENAI_API_KEY=sk-...
python translate.py --input transcript.txt

Arguments

Argument Default Description
--input transcript.txt Input transcript file
--output script_output.txt Output script file
--source-lang English Source language
--target-lang English Target language (same as source = reformat only)
--framework Hero's Journey Storytelling framework
--style (empty) Additional style instructions

Example

# Translate an English tech review into a German script
python translate.py \
  --input tech-review-transcript.txt \
  --output german-script.txt \
  --source-lang English \
  --target-lang German \
  --framework "Hero's Journey" \
  --style "with technical terminology, enthusiastic tone"

License

MIT

About

Translate and reformat YouTube transcripts into polished scripts using OpenAI GPT-4 — supports any language pair and multiple storytelling frameworks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages