How mhdzumair/mediafusion works
MediaFusion is a self-hosted streaming aggregator: users configure sources and playback preferences, request catalogs or streams through Stremio, Kodi, or the browser, and receive playable results from indexers and supported providers. The Rust backend is the primary runtime represented in the current tree; the README documents its multi-client and provider capabilities. The tree also contains a substantial deprecated Python implementation, but the supplied excerpts do not establish its runtime wiring, so it is not drawn as a second workflow.
Main entry points: stream.rs Stream endpoint · pool.rs PostgreSQL data · orchestrator.rs Source aggregation · main.rs Rust API service
Components 21
Client experiences
- Stremio
- Kodi add-on
clients/kodi/plugin.video.mediafusion/lib/router.py - Browser player
clients/frontend/src/components/player/VideoPlayer.tsx - Web application
clients/frontend/src/App.tsx - Browser extension
clients/browser-extension/src/popup/App.tsx
Backend API
- Rust API service
backend/src/main.rs - Catalog and manifest
backend/src/routes/catalog.rs - Stream endpoint
backend/src/routes/stream.rs - Content management
backend/src/routes/content/mod.rs
Discovery and aggregation
- Source aggregation
backend/src/scrapers/orchestrator.rs - Metadata lookup
backend/src/scrapers/metadata/mod.rs - Stream parsing
backend/src/parser/mod.rs - Indexers and feeds
Playback and state
- Playback providers
backend/src/providers/torrents/mod.rs - Usenet providers
backend/src/providers/usenet/mod.rs - PostgreSQL data
backend/src/db/pool.rs - Stream cache
backend/src/cache/stream_cache.rs
Operations and integrations
- Background jobs
backend/src/jobs/runner.rs - Telegram bot
backend/src/bot/dispatch.rs - External integrations
backend/src/routes/integrations.rs
Other components
- Viewers and admins
Connections 22
- Viewers and admins → Web application: configure and browse
README.md - Viewers and admins → Stremio: install and watch
README.md - Viewers and admins → Kodi add-on: watch with
README.md - Web application → Rust API service: request services
README.md - Browser extension → Rust API service: import content
- Stremio → Catalog and manifest: request catalogs
README.md - Kodi add-on → Catalog and manifest: request catalogs
README.md - Browser player → Stream endpoint: request streams
README.md - Rust API service → Catalog and manifest: serves routes
- Rust API service → Stream endpoint: serves routes
- Catalog and manifest → PostgreSQL data: reads catalog data
- Stream endpoint → Source aggregation: requests candidates
- Source aggregation → Indexers and feeds: searches sources
README.md - Source aggregation → Metadata lookup: resolves metadata
- Source aggregation → Stream parsing: normalizes results
- Stream endpoint → Stream cache: uses stream cache
- Stream endpoint → Playback providers: supports debrid and P2P
README.md - Stream endpoint → Usenet providers: supports Usenet
- Content management → PostgreSQL data: manages content
- Background jobs → PostgreSQL data: persists job state
- Telegram bot → PostgreSQL data: uses stored data
- External integrations → PostgreSQL data: uses user data