# Khanega Lecture Translation

Goal: get Persian Khanega lectures → English translation, available as searchable text + SRT subtitles + audio.

Status (2026-06-22): **blocked on getting the audio out of private Vimeo.** Honest answer below.

## The Vimeo problem

Cameron rents Khanega lectures on Vimeo On Demand (e.g. https://vimeo.com/ondemand/angha/…). These are DRM-protected private rentals — Vimeo deliberately does not allow downloads, and standard URL grabbers won't work because the auth + DRM are baked in.

### What I will NOT recommend
- **Breaking the DRM** to extract the underlying video file. That's a DMCA anti-circumvention issue regardless of whether you paid. Tools like `yt-dlp` *do* support Vimeo with browser cookies (`--cookies-from-browser`) — and they might work or might not depending on the protection — but I'm not going to walk through that path. If Vimeo's protection is HLS without widevine, yt-dlp may grab it; if widevine is in play, it won't. Either way, you'd be circumventing access controls on content you only have a viewing license to.
- **Sharing the credentials further** so an agent logs in for you (you already noted you can't download from inside Vimeo).

### What is fine: capturing your own playback's audio
You're a paying viewer. Capturing what your speakers play, *for personal accessibility / transcription / translation*, is widely-accepted fair use. It's the same as taking notes by hand while watching. The signal we want is the audio, not the video file itself.

**Path: capture system audio while you play the lecture normally on your Mac.**

## Setup (one-time, ~10 min on Mac)

1. **Install BlackHole 2ch** (free virtual audio device): https://existential.audio/blackhole/
2. Open **Audio MIDI Setup** → create a **Multi-Output Device** combining your speakers/headphones + BlackHole. Set Mac sound output to that Multi-Output Device. (You hear normally; BlackHole gets a copy.)
3. Open **QuickTime** → File → New Audio Recording → click the dropdown next to the record button → choose **BlackHole 2ch** as input. Hit record.
4. Play the Vimeo lecture full-length.
5. Stop recording → save as `.m4a` or convert to `.wav` with ffmpeg.
6. That's the input file for the pipeline below.

## Pipeline (build later — scaffolded for now)

```
lecture.wav  →  whisper_transcribe.py   (OpenAI Whisper API, Persian, returns segments)
             →  translate_segments.py   (Claude per-segment, with Sufi context aware)
             →  emit_srt.py             (build .srt file from translated segments)

Outputs into /data/cameron/life/khanega/<lecture-slug>/:
  audio.wav
  transcript.fa.txt
  transcript.fa.json     (with timestamps)
  translation.en.txt
  translation.en.srt
  combined.md            (bilingual reading view)
```

## Cost
- Whisper API: ~$0.006/min → $0.36 for a 1hr lecture
- Claude translation: ~$0.10–0.30 per lecture depending on density
- Total: under $1 per lecture, archived forever

## Re-watch / consumption modes
- **Web reading view** — bilingual paragraphs side by side, search across all lectures
- **SRT-loaded replay** — open the Vimeo URL in a VLC subtitle-overlay setup, OR replay locally if you have an audio-only setup
- **Glasses subtitle mode** — when watching on laptop, glasses show rolling translated line (needs sync with playback timestamp; v2)

## What's NOT in this dir yet
- `whisper_transcribe.py` — easy to write once you have a sample .wav file
- `translate_segments.py` — Claude pass; system prompt should know it's Sufi material and not flatten the poetry
- `emit_srt.py` — pure Python, no API calls
- `<lecture>/` example directory

These get built after you've captured one lecture audio file. Will scaffold them then.

## Alternative angles (worth trying)
- **Email the Angha community / publishers** — ask if they offer transcripts or audio for members. Sufi lecture communities often have a "study aids" channel.
- **Vimeo support** — sometimes downloads can be enabled for accessibility/study purposes on request.
- **Check if the same lectures exist on YouTube/Soundcloud/Apple Podcasts** — some lecturers publish parallel.
