fix: add connections limit parameter to http downloader

This commit is contained in:
Hachi-R
2025-04-12 16:25:45 -03:00
parent be232d88e4
commit 007fa6f009
3 changed files with 6 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ class HttpDownloader:
self.process = None
self.last_status = None
def start_download(self, url: str, save_path: str, header: str = None, out: str = None, allow_multiple_connections: bool = False):
def start_download(self, url: str, save_path: str, header: str = None, out: str = None, allow_multiple_connections: bool = False, connections_limit: int = 1):
cmd = [self.hydra_exe]
cmd.append(url)
@@ -25,7 +25,7 @@ class HttpDownloader:
cmd.extend(["--header", header])
if allow_multiple_connections:
cmd.extend(["--connections", "24"])
cmd.extend(["--connections", str(connections_limit)])
else:
cmd.extend(["--connections", "1"])