diff --git a/Writerside/topics/download-client-configuration.md b/Writerside/topics/download-client-configuration.md index 08a89c1..68f038d 100644 --- a/Writerside/topics/download-client-configuration.md +++ b/Writerside/topics/download-client-configuration.md @@ -84,6 +84,10 @@ Port of the SABnzbd API. Default is `8080`. API key for SABnzbd. You can find this in SABnzbd's configuration under "General" → "API Key". +- `base_path` + +API base path for SABnzbd. It usually ends with `/api`, the default is `/api`. + ## Example Configuration Here's a complete example of the download clients section in your `config.toml`: diff --git a/config.dev.toml b/config.dev.toml index 8cb5ae7..6354314 100644 --- a/config.dev.toml +++ b/config.dev.toml @@ -111,6 +111,7 @@ enabled = false host = "http://localhost" port = 8080 api_key = "" +base_path = "/api" [indexers] # Prowlarr settings diff --git a/config.example.toml b/config.example.toml index 17fece9..67b3389 100644 --- a/config.example.toml +++ b/config.example.toml @@ -111,6 +111,7 @@ enabled = false host = "http://localhost" port = 8080 api_key = "" +base_path = "/api" [indexers] # Prowlarr settings diff --git a/media_manager/torrent/config.py b/media_manager/torrent/config.py index 908bd9d..7f6e359 100644 --- a/media_manager/torrent/config.py +++ b/media_manager/torrent/config.py @@ -30,6 +30,7 @@ class SabnzbdConfig(BaseSettings): port: int = 8080 api_key: str = "" enabled: bool = False + base_path: str = "/api" class TorrentConfig(BaseSettings): diff --git a/media_manager/torrent/download_clients/sabnzbd.py b/media_manager/torrent/download_clients/sabnzbd.py index 1a10c77..cc2893b 100644 --- a/media_manager/torrent/download_clients/sabnzbd.py +++ b/media_manager/torrent/download_clients/sabnzbd.py @@ -33,7 +33,7 @@ class SabnzbdDownloadClient(AbstractDownloadClient): port=str(self.config.port), api_key=self.config.api_key, ) - self.client._base_url = f"{self.config.host.rstrip('/')}:{self.config.port}/api" # the library expects a /sabnzbd prefix for whatever reason + self.client._base_url = f"{self.config.host.rstrip('/')}:{self.config.port}{self.config.base_path}" # the library expects a /sabnzbd prefix for whatever reason try: # Test connection version = self.client.version()