How g0ldyy/comet works
Comet is a Stremio torrent-discovery addon, with Kodi and Torznab interfaces and an optional decentralized metadata network. Its main user flow is a client request handled by the API, which exposes stream and search capabilities; the repository evidence shows supporting metadata, scraper, persistence, and streaming components, but not the full request-to-result calls between them. Separate branches cover scheduled scraping, CometNet, debrid integrations, and operational features. Edges are limited to README statements and relationships visible in the supplied source index or excerpts; unsampled endpoint internals are not inferred.
Main entry points: app.py HTTP application · worker.py Background scraper · manager.py Metadata resolution · media_search.py Media search
Components 19
Client interfaces
- HTTP application
comet/api/app.py - API endpoints
comet/api/endpoints - Kodi addon
kodi/plugin.video.comet - Torznab interface
comet/api/endpoints/torznab.py
Discovery and delivery
- Media search
comet/services/media_search.py - Scraper manager
comet/scrapers/manager.py - Scraper adapters
comet/scrapers - Metadata resolution
comet/metadata/manager.py - Torrent management
comet/services/torrent_manager.py - Debrid services
comet/debrid - Stream delivery
comet/services/streaming/manager.py - Background scraper
comet/background_scraper/worker.py
State and operations
- Database
comet/core/database.py - Prometheus metrics
comet/observability/metrics.py
Federation
- CometNet manager
comet/cometnet/manager.py - P2P protocol
comet/cometnet/protocol.py
Other components
- Stremio client
- Kodi user
- Indexer clients
Connections 20
- Stremio client → HTTP application: requests addon
README.md - Kodi user → Kodi addon: uses addon
README.md - Indexer clients → Torznab interface: queries index
README.md - HTTP application → API endpoints: registers routes
comet/api/app.py - HTTP application → Background scraper: starts worker
comet/api/app.py - HTTP application → Prometheus metrics: records requests
comet/api/app.py - Torznab interface → Media search: uses search
comet/api/endpoints/torznab.py - Media search → Scraper manager: invokes scrapers
- Scraper manager → Scraper adapters: dispatches scraping
comet/scrapers/manager.py - Scraper manager → Metadata resolution: uses anime data
comet/scrapers/manager.py - Metadata resolution → Database: reads and caches
comet/metadata/manager.py - Metadata resolution → Media search: resolves metadata
- Torrent management → Database: persists torrents
comet/services/torrent_manager.py - Torrent management → P2P protocol: uses protocol
comet/services/torrent_manager.py - Stream delivery → Torrent management: uses torrent data
- Stream delivery → Debrid services: proxies debrid streams
README.md - Background scraper → Database: updates scrape state
comet/background_scraper/worker.py - Background scraper → Metadata resolution: requests metadata
comet/background_scraper/worker.py - Background scraper → Media search: orchestrates scraping
comet/background_scraper/worker.py - CometNet manager → P2P protocol: coordinates protocol
comet/cometnet/manager.py