mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
feat: add timeouts to Prowlarr API requests
This commit is contained in:
+3
-2
@@ -98,7 +98,7 @@ DOWNLOAD_TORRENT_FILES=False # Enable torrent file retrieval (instead of magnet
|
||||
# - Example multi: COMET_URL='["https://comet1.example.com", "https://comet2.example.com"]'
|
||||
#
|
||||
# Scraper Context Modes:
|
||||
# Each SCRAPE_* setting and INDEXER_MANAGER_MODE can control when scrapers are used:
|
||||
# Each SCRAPE_* setting can control when scrapers are used:
|
||||
# - true/both: Used for live scraping AND background scraping (default)
|
||||
# - live: Only used for live scraping (when users request content)
|
||||
# - background: Only used for background scraping (automatic content pre-caching)
|
||||
@@ -109,7 +109,8 @@ DOWNLOAD_TORRENT_FILES=False # Enable torrent file retrieval (instead of magnet
|
||||
# SCRAPE_TORRENTIO=live # Fast live scraping only
|
||||
# SCRAPE_ZILEAN=background # Background cache building only
|
||||
# SCRAPE_NYAA=false # Completely disabled
|
||||
# INDEXER_MANAGER_MODE=live # Jackett/Prowlarr for live scraping only
|
||||
# SCRAPE_JACKETT=live # Jackett for live scraping only
|
||||
# SCRAPE_PROWLARR=background # Prowlarr for background scraping only
|
||||
|
||||
SCRAPE_COMET=False
|
||||
COMET_URL=https://comet.elfhosted.com
|
||||
|
||||
@@ -99,6 +99,7 @@ class ProwlarrScraper(BaseScraper):
|
||||
get_indexers = await self.session.get(
|
||||
f"{settings.PROWLARR_URL}/api/v1/indexer",
|
||||
headers={"X-Api-Key": settings.PROWLARR_API_KEY},
|
||||
timeout=aiohttp.ClientTimeout(total=settings.INDEXER_MANAGER_TIMEOUT),
|
||||
)
|
||||
get_indexers = await get_indexers.json()
|
||||
|
||||
@@ -116,6 +117,9 @@ class ProwlarrScraper(BaseScraper):
|
||||
self.session.get(
|
||||
f"{settings.PROWLARR_URL}/api/v1/search?query={query}&indexerIds={'&indexerIds='.join(str(indexer_id) for indexer_id in indexers_id)}&type=search",
|
||||
headers={"X-Api-Key": settings.PROWLARR_API_KEY},
|
||||
timeout=aiohttp.ClientTimeout(
|
||||
total=settings.INDEXER_MANAGER_TIMEOUT
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user