mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
add config option to accept/reject torrents from prowlarr with a possibly broken url
This commit is contained in:
@@ -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"]
|
||||
```
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user