Automatically extract transcripts from YouTube videos or playlists. Uses official captions when available, and falls back to Whisper AI with interactive Y / A / N prompt support. Saves everything as organized .md files.
Extract transcripts from YouTube videos or playlists in Markdown format, with automatic fallback to Whisper AI when subtitles are unavailable.
- Supports YouTube video or playlist URLs
- Uses YouTube's public API for native subtitles
- Falls back to Whisper transcription when needed
- Interactive prompt for Whisper (Y=Yes, A=Yes to all, N=No)
- Generates per-video Markdown + consolidated transcript file
- Organized folders:
individual_transcripts
,all_transcripts
,video_files
- Python 3.8+
yt-dlp
whisper
youtube_transcript_api
python-dotenv
ffmpeg
Install dependencies:
pip install -r requirements.txt
Create a .env
file with your YouTube API key:
YOUTUBE_API_KEY=YOUR_API_KEY
python extract_transcripts.py
Paste a video or playlist link and follow the prompts.
individual_transcripts/
:.md
files per videoall_transcripts/transcripts.md
: consolidated transcriptskipped.log
: videos with no transcriptionvideo_files/
: temporary files used by Whisper
It is possible to translate transcripts into any language!
During execution, you will be prompted to choose a target language (e.g., en
, pt
, es
, etc.).
Press Enter to keep the video's transcript in the original language.
MIT — feel free to use, modify, and share.
Use with Telegram to YouTube Uploader to summarize your content.