add future option to disable torrent-only streams

Signed-off-by: David Young <davidy@funkypenguin.co.nz>
This commit is contained in:
David Young
2025-12-10 17:13:08 +13:00
parent 738912d2dd
commit 7576431c24
4 changed files with 26 additions and 0 deletions
+8
View File
@@ -183,6 +183,14 @@ PROXY_DEBRID_STREAM_MAX_CONNECTIONS=-1 # -1 to disable connection limits
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE=realdebrid
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY=CHANGE_ME
# ============================== #
# Torrent Stream Policy #
# ============================== #
DISABLE_TORRENT_STREAMS=False # When true, torrent-only requests return a friendly message instead of magnets
TORRENT_DISABLED_STREAM_NAME=[INFO] Comet # Stremio stream name shown when torrents are disabled
TORRENT_DISABLED_STREAM_DESCRIPTION=Direct torrent playback is disabled on this server. Please configure a debrid provider. # Description shown to users in Stremio
TORRENT_DISABLED_STREAM_URL=https://comet.fast # Optional URL included in the placeholder stream response
# ============================== #
# Content Filtering #
# ============================== #
+1
View File
@@ -10,6 +10,7 @@
* add optional database-backed anime mapping cache with configurable refresh interval
* add `GUNICORN_PRELOAD_APP` setting to control whether workers inherit a preloaded app or initialize independently
* add `DATABASE_STARTUP_CLEANUP_INTERVAL` to throttle heavy startup cleanup sweeps across workers
* add `DISABLE_TORRENT_STREAMS` toggle with customizable placeholder stream metadata
## [2.31.0](https://github.com/g0ldyy/comet/compare/v2.30.0...v2.31.0) (2025-12-08)
+11
View File
@@ -145,6 +145,17 @@ async def stream(
]
}
if settings.DISABLE_TORRENT_STREAMS and config["debridService"] == "torrent":
placeholder_stream = {
"name": settings.TORRENT_DISABLED_STREAM_NAME or "[INFO] Comet",
"description": settings.TORRENT_DISABLED_STREAM_DESCRIPTION
or "Direct torrent playback is disabled on this server.",
}
if settings.TORRENT_DISABLED_STREAM_URL:
placeholder_stream["url"] = settings.TORRENT_DISABLED_STREAM_URL
return {"streams": [placeholder_stream]}
connector = aiohttp.TCPConnector(limit=0)
async with aiohttp.ClientSession(connector=connector) as session:
metadata_scraper = MetadataScraper(session)
+6
View File
@@ -100,6 +100,12 @@ class AppSettings(BaseSettings):
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE: Optional[str] = "realdebrid"
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY: Optional[str] = None
STREMTHRU_URL: Optional[str] = "https://stremthru.13377001.xyz"
DISABLE_TORRENT_STREAMS: Optional[bool] = False
TORRENT_DISABLED_STREAM_NAME: Optional[str] = "[INFO] Comet"
TORRENT_DISABLED_STREAM_DESCRIPTION: Optional[str] = (
"Direct torrent playback is disabled on this server."
)
TORRENT_DISABLED_STREAM_URL: Optional[str] = "https://comet.fast"
REMOVE_ADULT_CONTENT: Optional[bool] = False
BACKGROUND_SCRAPER_ENABLED: Optional[bool] = False
BACKGROUND_SCRAPER_CONCURRENT_WORKERS: Optional[int] = 1