From 110b5b90ca357f464e413eeb718b82f4a2ecd499 Mon Sep 17 00:00:00 2001 From: xelgand Date: Thu, 7 Mar 2024 14:28:12 +0100 Subject: [PATCH 1/2] Maintain scheme when building the qBittorrent client --- sickchill/oldbeard/clients/qbittorrent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sickchill/oldbeard/clients/qbittorrent.py b/sickchill/oldbeard/clients/qbittorrent.py index 06e774890d..c6cf6195d5 100644 --- a/sickchill/oldbeard/clients/qbittorrent.py +++ b/sickchill/oldbeard/clients/qbittorrent.py @@ -14,10 +14,11 @@ class Client(GenericClient): def __init__(self, host: str = None, username: str = None, password: str = None): super().__init__("qBittorrent", host, username, password) parsed_url = urlparse(self.host or settings.TORRENT_HOST) - self.host = parsed_url.hostname + self.url = parsed_url.geturl() self.port = parsed_url.port + logger.debug(f"qBittorrent URL: {self.url}") self.api = qbittorrentapi.Client( - host=self.host, + host=self.url, port=self.port or None, username=self.username or settings.TORRENT_USERNAME, password=self.password or settings.TORRENT_PASSWORD, From e3f1f555b86fca6f31fb5f621a84924b282ffcf4 Mon Sep 17 00:00:00 2001 From: xelgand Date: Thu, 7 Mar 2024 15:10:35 +0100 Subject: [PATCH 2/2] Rename the host parameter to url to reflect the expected input --- sickchill/oldbeard/clients/qbittorrent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sickchill/oldbeard/clients/qbittorrent.py b/sickchill/oldbeard/clients/qbittorrent.py index c6cf6195d5..3eb0912a86 100644 --- a/sickchill/oldbeard/clients/qbittorrent.py +++ b/sickchill/oldbeard/clients/qbittorrent.py @@ -11,9 +11,9 @@ class Client(GenericClient): - def __init__(self, host: str = None, username: str = None, password: str = None): - super().__init__("qBittorrent", host, username, password) - parsed_url = urlparse(self.host or settings.TORRENT_HOST) + def __init__(self, url: str = None, username: str = None, password: str = None): + super().__init__("qBittorrent", url, username, password) + parsed_url = urlparse(self.url or settings.TORRENT_HOST) self.url = parsed_url.geturl() self.port = parsed_url.port logger.debug(f"qBittorrent URL: {self.url}")