mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-27 20:22:47 +08:00
24 lines
626 B
Python
24 lines
626 B
Python
from typing import List
|
|
|
|
from app.db.systemconfig_oper import SystemConfigOper
|
|
from app.schemas.system import DownloaderConf
|
|
from app.schemas.types import SystemConfigKey
|
|
|
|
|
|
class DownloaderHelper:
|
|
"""
|
|
下载器帮助类
|
|
"""
|
|
|
|
def __init__(self):
|
|
self.systemconfig = SystemConfigOper()
|
|
|
|
def get_downloaders(self) -> List[DownloaderConf]:
|
|
"""
|
|
获取下载器
|
|
"""
|
|
downloader_confs: List[dict] = self.systemconfig.get(SystemConfigKey.Downloaders)
|
|
if not downloader_confs:
|
|
return []
|
|
return [DownloaderConf(**conf) for conf in downloader_confs]
|