mirror of
https://github.com/ManiMatter/decluttarr.git
synced 2026-04-21 16:25:35 +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(
|
logger.debug(
|
||||||
"_download_clients_qBit/get_protected_and_private: Checking if torrents are private (only done for old qbit versions)",
|
"_download_clients_qBit/get_protected_and_private: Checking if torrents are private (only done for old qbit versions)",
|
||||||
)
|
)
|
||||||
qbit_item_props = await make_request(
|
qbit_item_props = await self.get_torrent_properties(qbit_item["hash"])
|
||||||
"get",
|
|
||||||
self.api_url + "/torrents/properties",
|
|
||||||
self.settings,
|
|
||||||
params={"hash": qbit_item["hash"]},
|
|
||||||
cookies=self.cookie,
|
|
||||||
)
|
|
||||||
if not qbit_item_props:
|
if not qbit_item_props:
|
||||||
logger.error(
|
logger.error(
|
||||||
"Torrent %s not found on qBittorrent - potentially removed while checking if private. "
|
"Torrent %s not found on qBittorrent - potentially removed while checking if private. "
|
||||||
@@ -363,6 +358,18 @@ class QbitClient:
|
|||||||
)
|
)
|
||||||
return response.json()
|
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):
|
async def get_torrent_files(self, download_id):
|
||||||
# this may not work if the wrong qbit
|
# this may not work if the wrong qbit
|
||||||
logger.debug("_download_clients_qBit/get_torrent_files: Getting torrent files")
|
logger.debug("_download_clients_qBit/get_torrent_files: Getting torrent files")
|
||||||
|
|||||||
Reference in New Issue
Block a user