YouTube Summarizer
Prerequisites
yt-dlpmust be installed (pip install yt-dlp)
Workflow
1. Extract transcript
Run the bundled script to fetch and clean the transcript:
python scripts/fetch_transcript.py "<YOUTUBE_URL>" --lang <LANG> 2>/tmp/yt_meta.json > /tmp/yt_transcript.txt
--lang ja(default) for Japanese videos,--lang enfor English.- The script auto-detects original-language captions first, then falls back.
- stdout: cleaned plain-text transcript.
- stderr: JSON metadata
{"video_id", "title", "language"}. - If no subtitles exist, the script exits with code 1.
2. Read transcript and metadata
Read /tmp/yt_meta.json for the title and language, then read /tmp/yt_transcript.txt for the full text.
3. Summarize
Produce a structured summary in the user's language. Use the following structure as a guide (adapt headings to fit the content):
- Title / topic (one line)
- Core concept (1-2 paragraphs explaining the main idea)
- Key sections (3-5 sections with subheadings, covering the major points)
- Conclusion / takeaway
Keep the summary concise but comprehensive. Preserve technical terms and proper nouns from the original.
4. Clean up
Remove temporary files after summarization:
rm -f /tmp/yt_transcript.txt /tmp/yt_meta.json