feat: add support for VikingFile and display if link is available

This commit is contained in:
Moyasee
2026-01-02 23:20:08 +02:00
parent 9769eecec6
commit 8fa33119d6
12 changed files with 226 additions and 35 deletions

View File

@@ -11,12 +11,19 @@ class HttpDownloader:
)
)
def start_download(self, url: str, save_path: str, header: str, out: str = None):
def start_download(self, url: str, save_path: str, header, out: str = None):
if self.download:
self.aria2.resume([self.download])
else:
downloads = self.aria2.add(url, options={"header": header, "dir": save_path, "out": out})
options = {"dir": save_path}
if header:
if isinstance(header, list):
options["header"] = header
else:
options["header"] = header
if out:
options["out"] = out
downloads = self.aria2.add(url, options=options)
self.download = downloads[0]
def pause_download(self):