diff --git a/Writerside/topics/Indexer-Settings.md b/Writerside/topics/Indexer-Settings.md index de3f56a..47712e0 100644 --- a/Writerside/topics/Indexer-Settings.md +++ b/Writerside/topics/Indexer-Settings.md @@ -1,6 +1,7 @@ # Indexers -Indexer settings are configured in the `[indexers]` section of your `config.toml` file. MediaManager supports both Prowlarr and Jackett as indexer providers. +Indexer settings are configured in the `[indexers]` section of your `config.toml` file. MediaManager supports both +Prowlarr and Jackett as indexer providers. ## Prowlarr (`[indexers.prowlarr]`) @@ -16,6 +17,12 @@ Base URL of your Prowlarr instance. API key for Prowlarr. You can find this in Prowlarr's settings under General. +- `reject_torrents_on_url_error` + +Set to `true` to reject torrents if there is a URL error when fetching from Prowlarr. Until MediaManager v1.9.0 the +default behavior was `false`, but from v1.9.0 onwards the default is `true`. It's recommended to set this to `true` to +avoid adding possibly invalid torrents. + ## Jackett (`[indexers.jackett]`) - `enabled` @@ -40,14 +47,14 @@ Here's a complete example of the indexers section in your `config.toml`: ```toml [indexers] - [indexers.prowlarr] - enabled = true - url = "http://prowlarr:9696" - api_key = "your_prowlarr_api_key" +[indexers.prowlarr] +enabled = true +url = "http://prowlarr:9696" +api_key = "your_prowlarr_api_key" - [indexers.jackett] - enabled = false - url = "http://jackett:9117" - api_key = "your_jackett_api_key" - indexers = ["1337x", "rarbg"] +[indexers.jackett] +enabled = false +url = "http://jackett:9117" +api_key = "your_jackett_api_key" +indexers = ["1337x", "rarbg"] ``` diff --git a/config.dev.toml b/config.dev.toml index e3e5bc8..50af4de 100644 --- a/config.dev.toml +++ b/config.dev.toml @@ -119,6 +119,7 @@ base_path = "/api" enabled = false url = "http://localhost:9696" api_key = "" +reject_torrents_on_url_error = true # Jackett settings [indexers.jackett] diff --git a/config.example.toml b/config.example.toml index d828b72..4498289 100644 --- a/config.example.toml +++ b/config.example.toml @@ -119,6 +119,7 @@ base_path = "/api" enabled = false url = "http://localhost:9696" api_key = "" +reject_torrents_on_url_error = true # Jackett settings [indexers.jackett] diff --git a/media_manager/indexer/config.py b/media_manager/indexer/config.py index db16423..04e8063 100644 --- a/media_manager/indexer/config.py +++ b/media_manager/indexer/config.py @@ -5,6 +5,7 @@ class ProwlarrConfig(BaseSettings): enabled: bool = False api_key: str = "" url: str = "http://localhost:9696" + reject_torrents_on_url_error: bool = True class JackettConfig(BaseSettings): diff --git a/media_manager/indexer/indexers/prowlarr.py b/media_manager/indexer/indexers/prowlarr.py index f08f3f0..a22375d 100644 --- a/media_manager/indexer/indexers/prowlarr.py +++ b/media_manager/indexer/indexers/prowlarr.py @@ -25,6 +25,7 @@ class Prowlarr(GenericIndexer): config = AllEncompassingConfig().indexers.prowlarr self.api_key = config.api_key self.url = config.url + self.reject_torrents_on_url_error = config.reject_torrents_on_url_error log.debug("Registering Prowlarr as Indexer") def search(self, query: str, is_tv: bool) -> list[IndexerQueryResult]: @@ -96,7 +97,10 @@ class Prowlarr(GenericIndexer): log.debug( f"Failed to follow redirects for {initial_url}, falling back to the initial url as download url, error: {e}" ) - final_download_url = initial_url + if self.reject_torrents_on_url_error: + return None + else: + final_download_url = initial_url else: final_download_url = initial_url return IndexerQueryResult(