mirror of
https://github.com/ManiMatter/decluttarr.git
synced 2026-04-20 07:54:18 +02:00
Fix qbit_item_props.get("is_private", False):
AttributeError: 'Response' object has no attribute 'get'
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user