How jpaulovaz/ersatztv-youtube-playlist-generator works
ErsatzTV YouTube Downloader discovers videos and channel sources, deduplicates them by destination, persists a shared download queue, and produces library-ready media. The web UI and schedulers initiate library and channel workflows; channel catalog and synchronization are distinct from library discovery. Download processing also supports subtitles, metadata, profiles, retries, and orphan management. ErsatzTV catalog, scan, and Smart Collection features are documented, but their full wiring was not sampled; their nodes use supported enclosing paths and uncertain links are omitted.
Main entry points: downloadManager.js Download manager · server.js HTTP server · channelSyncService.js Channel sync · syncService.js Library discovery
Components 28
Web interface
- Dashboard UI
public/app.js - Channel UI
public/js/channelsView.js
Discovery and sync
- Library discovery
src/syncService.js - Channel sync
src/discovery/channelSyncService.js - Channel catalog
src/discovery/channelCatalogService.js - YouTube provider
src/discovery/youtubeSourceProvider.js
Queue and media
- Download manager
src/downloadManager.js - Worker selection
src/download/workerSelector.js - Persistent queue
src/download/queueState.js - Media profiles
src/mediaProfileService.js - Media metadata
src/movieMetadataService.js - Subtitle processing
src/subtitleService.js
External services
- YouTube API
src/youtubeApi.js - yt-dlp
- FFmpeg tools
- ErsatzTV
src/ersatztvService.js
Other components
- Administrator
- HTTP server
src/server.js - Channel routes
src/routes/channelRoutes.js - Library routes
src/routes/libraryRoutes.js - ErsatzTV routes
src/routes/ersatztvRoutes.js - Local authentication
src/auth.js - Configuration
src/config.js - Library scheduler
src/scheduler.js - Channel scheduler
src/channelScheduler.js - Library media
- Library timer
src/main.js - Channel timer
src/main.js
Connections 33
- Administrator → Dashboard UI: uses
- Dashboard UI → HTTP server: requests
- Channel UI → HTTP server: requests
- HTTP server → Local authentication: authenticates
- HTTP server → Channel routes: dispatches
- HTTP server → Library routes: dispatches
- HTTP server → ErsatzTV routes: dispatches
- HTTP server → Configuration: loads config
- Library routes → Library discovery: starts discovery
- Channel routes → Channel catalog: analyzes channel
- Channel routes → Channel sync: starts sync
- Library discovery → YouTube provider: fetches sources
- Channel catalog → YouTube API: queries API
- Channel catalog → YouTube provider: falls back
- Channel sync → Channel catalog: refreshes catalog
- Channel sync → YouTube provider: fetches destination
- Library discovery → Download manager: queues videos
- Channel sync → Download manager: queues videos
- Download manager → Persistent queue: persists state
- Download manager → Worker selection: selects work
- Download manager → yt-dlp: downloads
- Download manager → FFmpeg tools: processes media
- Download manager → Media profiles: applies profile
- Download manager → Media metadata: writes metadata
- Download manager → Subtitle processing: handles subtitles
- Download manager → Library media: writes files
- Library scheduler → Library discovery: triggers discovery
- Channel scheduler → Channel sync: triggers sync
- Library timer → Library scheduler: starts
- Library timer → Channel scheduler: starts
- ErsatzTV routes → ErsatzTV: checks and links
- ErsatzTV → Library media: scans library
- ErsatzTV → Dashboard UI: returns catalog