mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
feat: add support for VikingFile and display if link is available
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user