Merge pull request #96 from thsrite/main

This commit is contained in:
jxxghp
2023-08-12 22:54:46 +08:00
committed by GitHub
9 changed files with 224 additions and 26 deletions

View File

@@ -1,3 +1,4 @@
from msilib.schema import File
from pathlib import Path
from typing import Set, Tuple, Optional, Union, List
@@ -187,6 +188,12 @@ class QbittorrentModule(_ModuleBase):
"""
return self.qbittorrent.start_torrents(ids=hashs)
def torrent_files(self, tid: str) -> Optional[List[File]]:
"""
获取种子文件列表
"""
return self.qbittorrent.get_files(tid=tid)
def downloader_info(self) -> schemas.DownloaderInfo:
"""
下载器信息

View File

@@ -1,8 +1,9 @@
import time
from msilib.schema import File
from typing import Optional, Union, Tuple, List
import qbittorrentapi
from qbittorrentapi import TorrentFilesList, TorrentDictionary
from qbittorrentapi import TorrentDictionary
from qbittorrentapi.client import Client
from qbittorrentapi.transfer import TransferInfoDictionary
@@ -265,7 +266,7 @@ class Qbittorrent(metaclass=Singleton):
logger.error(f"删除种子出错:{err}")
return False
def get_files(self, tid: str) -> Optional[TorrentFilesList]:
def get_files(self, tid: str) -> Optional[List[File]]:
"""
获取种子文件清单
"""

View File

@@ -1,3 +1,4 @@
from msilib.schema import File
from pathlib import Path
from typing import Set, Tuple, Optional, Union, List
@@ -171,6 +172,12 @@ class TransmissionModule(_ModuleBase):
"""
return self.transmission.start_torrents(ids=hashs)
def torrent_files(self, tid: str) -> Optional[List[File]]:
"""
获取种子文件列表
"""
return self.transmission.get_files(tid=tid)
def downloader_info(self) -> schemas.DownloaderInfo:
"""
下载器信息