stephen schuresko 423b9250c5 chore(language-codes): add English words and adjust detection threshold
- Added 'has', 'acquire', and 'without' to COMMON_ENGLISH_WORDS dictionary
- Modified is_english detection threshold from 0.05 to 0.04 matches ratio
- Added debug logging to show matches count during English detection
2026-04-07 12:43:06 -04:00
2026-04-07 10:04:27 -04:00

YouTube Transcript Downloader and Translator

A Python program to download YouTube video transcripts and translate them to English.

Features

  • Extract YouTube video ID from various URL formats
  • Download video transcripts in multiple languages
  • Save transcripts to text files
  • Support for timestamped output
  • Automatic translation to English using Google Translate
  • Language detection to determine if translation is needed

Installation

  1. Install the required dependencies:
pip install -r requirements.txt

Or install directly:

pip install youtube-transcript-api deep-translator

Usage

Command Line

python youtube_transcript_downloader.py <youtube_url>

Interactive Mode

If no URL is provided, the program will prompt you to enter one:

python youtube_transcript_downloader.py

Examples

# Using a standard YouTube URL
python youtube_transcript_downloader.py https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Using a shortened youtu.be URL
python youtube_transcript_downloader.py https://youtu.be/dQw4w9WgXcQ

Output

The program will:

  1. Display the transcript in the terminal
  2. Save the transcript to a file named transcript_<video_id>.txt
  3. If translation is needed, prompt the user to translate to English
  4. Save both original and translated transcripts to separate files

Notes

  • The video must have captions/subtitles available for transcript extraction
  • The program first tries to fetch English transcripts
  • If no English transcript is available, it will try to get the original language
  • The program automatically detects if translation is needed and prompts to translate to English
  • For videos without English captions, the program will prompt you to translate the transcript

Requirements

  • Python 3.6+
  • youtube-transcript-api
  • deep-translator
Description
No description provided
Readme 122 KiB
Languages
Python 100%