add downloader info

This commit is contained in:
jxxghp
2023-07-10 18:38:56 +08:00
parent 15bb043fe8
commit 28b429a5d7
7 changed files with 88 additions and 4 deletions

View File

@ -4,6 +4,7 @@ from typing import Optional, Union, Tuple, List
import qbittorrentapi
from qbittorrentapi import TorrentFilesList, TorrentDictionary
from qbittorrentapi.client import Client
from qbittorrentapi.transfer import TransferInfoDictionary
from app.core.config import settings
from app.log import logger
@ -285,3 +286,13 @@ class Qbittorrent(metaclass=Singleton):
except Exception as err:
logger.error(f"设置种子文件状态出错:{err}")
return False
def transfer_info(self) -> Optional[TransferInfoDictionary]:
"""
获取传输信息
"""
try:
return self.qbc.transfer_info()
except Exception as err:
logger.error(f"获取传输信息出错:{err}")
return None