From e8b566c468e4e7a93fefa9ba26574b25e2b6ab64 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sat, 8 Nov 2025 12:07:22 +0100 Subject: [PATCH] Fix qbit_item_props.get("is_private", False): AttributeError: 'Response' object has no attribute 'get' --- src/settings/_download_clients_qbit.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/settings/_download_clients_qbit.py b/src/settings/_download_clients_qbit.py index ddcb74a..3b770a3 100644 --- a/src/settings/_download_clients_qbit.py +++ b/src/settings/_download_clients_qbit.py @@ -292,13 +292,8 @@ class QbitClient: logger.debug( "_download_clients_qBit/get_protected_and_private: Checking if torrents are private (only done for old qbit versions)", ) - qbit_item_props = await make_request( - "get", - self.api_url + "/torrents/properties", - self.settings, - params={"hash": qbit_item["hash"]}, - cookies=self.cookie, - ) + qbit_item_props = await self.get_torrent_properties(qbit_item["hash"]) + if not qbit_item_props: logger.error( "Torrent %s not found on qBittorrent - potentially removed while checking if private. " @@ -363,6 +358,18 @@ class QbitClient: ) return response.json() + async def get_torrent_properties(self, qbit_hash): + params = {"hash": qbit_hash.lower()} + response = await make_request( + "get", + self.api_url + "/torrents/properties", + self.settings, + params=params, + cookies=self.cookie, + ) + return response.json() + + async def get_torrent_files(self, download_id): # this may not work if the wrong qbit logger.debug("_download_clients_qBit/get_torrent_files: Getting torrent files")