How drunktrader/shortclipper works
LazyClipper turns a YouTube URL into persisted, timestamped clip candidates for inspection and selection in a React workspace. The main flow is project creation, video ingestion, audio extraction and transcription, transcript cleanup and chunking, LLM candidate detection and review, then ranked moments exposed through the API. PostgreSQL holds project state and results; media and transcript files are stored on disk. The README documents the broader flow, while some implementation details—especially media extraction and transcription—are supported by imports and documentation rather than sampled function bodies.
Main entry points: pipeline.py Project pipeline · routes.py Project API routes · llm.py LLM analyzer · models.py Project data models
Components 21
User workspace
- React workspace
frontend/src/App.tsx - API client
frontend/src/api.ts
API and orchestration
- FastAPI app
backend/app/main.py - Project API routes
backend/app/api/routes.py - Project pipeline
backend/app/services/pipeline.py - Runtime settings
backend/app/config.py
Media and analysis
- YouTube ingestion
backend/app/services/youtube.py - Audio extraction
backend/app/services/media.py - WhisperX transcription
backend/app/services/transcription.py - Transcript cleanup
backend/app/analysis/transcript.py - Moment scoring
backend/app/analysis/moments.py - LLM analyzer
backend/app/services/llm.py
Persistence
- Database access
backend/app/db.py - Project data models
backend/app/models.py - PostgreSQL
- Project file storage
Other components
- User
- YouTube / yt-dlp
- FFmpeg
- WhisperX
- OpenAI-compatible gateway
Connections 28
- User → React workspace: submits URL
README.md - React workspace → API client: requests data
frontend/src/App.tsx - API client → Project API routes: calls REST API
README.md - Project API routes → React workspace: returns project data
README.md - FastAPI app → Project API routes: mounts routes
backend/app/main.py - FastAPI app → Project pipeline: registers runner
backend/app/main.py - Project API routes → Project pipeline: submits processing
README.md - Project pipeline → YouTube ingestion: gets metadata and video
backend/app/services/pipeline.py - YouTube ingestion → YouTube / yt-dlp: uses yt-dlp
README.md - Project pipeline → Audio extraction: extracts audio
backend/app/services/pipeline.py - Audio extraction → FFmpeg: uses FFmpeg
README.md - Project pipeline → WhisperX transcription: transcribes audio
backend/app/services/pipeline.py - WhisperX transcription → WhisperX: runs transcription
README.md - Project pipeline → Transcript cleanup: normalizes and chunks
backend/app/services/pipeline.py - Project pipeline → LLM analyzer: analyzes chunks
backend/app/services/pipeline.py - LLM analyzer → Moment scoring: validates and deduplicates
backend/app/services/llm.py - LLM analyzer → OpenAI-compatible gateway: sends analysis requests
README.md - Project pipeline → Moment scoring: scores candidates
backend/app/services/pipeline.py - Project pipeline → Project data models: persists results
backend/app/services/pipeline.py - Project API routes → Project data models: queries project results
backend/app/api/routes.py - Database access → Project data models: registers tables
backend/app/db.py - Database access → PostgreSQL: connects to database
README.md - Project data models → PostgreSQL: stores project state and results
README.md - Project pipeline → Project file storage: writes media and transcript files
README.md - Runtime settings → Project file storage: creates project storage
backend/app/config.py - FastAPI app → Database access: initializes database
backend/app/main.py - Runtime settings → YouTube ingestion: configures ingestion
backend/app/services/youtube.py - Runtime settings → LLM analyzer: configures analysis
backend/app/services/llm.py