How jermsmit/snare works
Snare is a self-hosted media download manager. A user submits a URL and options through the web dashboard; the jobs API records it, the queue manager dispatches it, and the downloader selects yt-dlp or gallery-dl, reports progress, and saves media for browsing, preview, or download. Cookie profiles and settings support that workflow, while system and archive APIs provide monitoring and file management. The graph follows the documented capabilities and sampled source; UI-to-API links reflect the frontend API calls, while unsampled implementation details are left broad.
Main entry points: app.js Dashboard SPA · main.py FastAPI app · downloader.py Download runner · database.py SQLite database
Components 16
Web interface
- Dashboard SPA
frontend/static/js/app.js - Page shell
frontend/templates/index.html
API routes
- FastAPI app
backend/main.py - Jobs API
backend/api/routes/jobs.py - Cookie profiles API
backend/api/routes/cookies.py - Archive API
backend/api/routes/archive.py - System settings API
backend/api/routes/system.py
Download processing
- Queue manager
backend/core/queue_manager.py - Download runner
backend/core/downloader.py
Persistent state
- SQLite database
backend/core/database.py - Downloaded media
Other components
- Browser user
- yt-dlp
- gallery-dl
- Server disk
- Cookie-Editor
Connections 25
- Browser user → Dashboard SPA: uses
- FastAPI app → Page shell: serves
- Dashboard SPA → FastAPI app: loads page
- Dashboard SPA → Jobs API: calls jobs
- Dashboard SPA → Cookie profiles API: calls profiles
- Dashboard SPA → Archive API: calls archive
- Dashboard SPA → System settings API: calls settings
- FastAPI app → Jobs API: dispatches
- FastAPI app → Cookie profiles API: dispatches
- FastAPI app → Archive API: dispatches
- FastAPI app → System settings API: dispatches
- Jobs API → SQLite database: reads/writes jobs
- Jobs API → Queue manager: cancels job
- Queue manager → SQLite database: reads/writes queue
- Queue manager → Download runner: runs download
- Download runner → SQLite database: reads/writes state
- Download runner → yt-dlp: runs tool
- Download runner → gallery-dl: runs tool
- Download runner → Downloaded media: writes files
- Cookie profiles API → SQLite database: reads/writes profiles
- Cookie-Editor → Dashboard SPA: provides cookie JSON
- System settings API → SQLite database: reads/writes settings
- System settings API → Server disk: checks usage
- Archive API → Downloaded media: browses/serves files
- Archive API → Server disk: deletes files