Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt2setup

Turn any YouTube tutorial into a runnable setup plan.

yt2setup downloads a video's audio, transcribes it locally with faster-whisper (no cloud speech API needed), then extracts a structured setup plan — a summary plus numbered steps with copy-pasteable shell commands. If ANTHROPIC_API_KEY is set it uses Claude to do the extraction; otherwise it falls back to a regex-based heuristic that pulls out lines that look like shell commands.

Output per video:

yt2setup_output/<video_id>/
  transcript.txt   # full transcript
  setup_plan.md    # human-readable plan
  setup.sh         # extracted commands, ready to run

Install

git clone https://github.com/epipra/yt2setup.git
cd yt2setup
pip install -r requirements.txt
# ffmpeg is required by yt-dlp's audio extraction
sudo apt-get install -y ffmpeg   # or: brew install ffmpeg

Usage

# Transcribe + generate a plan (no execution)
python3 yt2setup.py https://youtu.be/VIDEO_ID

# Use Claude to extract a cleaner, structured plan
export ANTHROPIC_API_KEY=sk-ant-...
python3 yt2setup.py https://youtu.be/VIDEO_ID

# Review setup.sh, then run it with confirmation
python3 yt2setup.py https://youtu.be/VIDEO_ID --apply

# Non-interactive
python3 yt2setup.py https://youtu.be/VIDEO_ID --apply --yes

# Bigger/more accurate model
python3 yt2setup.py https://youtu.be/VIDEO_ID --model small

If YouTube blocks the download ("Sign in to confirm you're not a bot")

Cloud/datacenter IPs are frequently rate-limited or bot-checked by YouTube. This is a YouTube-side restriction, not a bug in this tool. Fixes:

# Export cookies.txt from a logged-in browser session (e.g. via the
# "Get cookies.txt" browser extension), then:
python3 yt2setup.py https://youtu.be/VIDEO_ID --cookies-file cookies.txt

# Or, if running yt2setup on your own machine with a browser installed:
python3 yt2setup.py https://youtu.be/VIDEO_ID --cookies-from-browser chrome

cookies.txt is git-ignored — never commit it, it is a live session credential.

Safety

  • Nothing is ever executed without --apply, and --apply still prompts for confirmation unless you also pass --yes.
  • Before running, setup.sh is scanned for a short list of obviously destructive patterns (rm -rf /, fork bombs, dd to a block device, curl | sudo bash, etc.) and execution is refused if any match — review the script yourself in that case.
  • The heuristic (non-Claude) extractor never generates commands on its own; it only quotes command-like lines it found verbatim in the transcript.

Options

Flag Meaning
--out DIR output directory root (default ./yt2setup_output)
--model SIZE faster-whisper model: tiny, base (default), small, medium, large-v3
--cookies-file PATH cookies.txt for yt-dlp
--cookies-from-browser BROWSER pull cookies from a local browser (chrome, firefox, ...)
--apply execute the generated setup.sh after review
--yes skip the confirmation prompt (use with --apply)
--force redo download/transcription even if a cached transcript exists

Why local transcription

Using faster-whisper on CPU means no per-minute API billing, no audio leaving your machine, and it works fully offline once the model weights are cached. A base model transcribes reasonably fast on a 4-core machine; use small/medium for higher accuracy at the cost of speed.

License

MIT, see LICENSE.

About

Turn any YouTube tutorial into a runnable setup plan: local transcription (faster-whisper) + Claude/heuristic extraction of steps and shell commands, with a guarded --apply mode.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages