diff --git a/python_rpc/http_downloader.py b/python_rpc/http_downloader.py index a383a403..95e735a9 100644 --- a/python_rpc/http_downloader.py +++ b/python_rpc/http_downloader.py @@ -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"]) diff --git a/python_rpc/main.py b/python_rpc/main.py index bc108a33..4202a871 100644 --- a/python_rpc/main.py +++ b/python_rpc/main.py @@ -148,11 +148,11 @@ def action(): torrent_downloader.start_download(url, data['save_path']) else: if existing_downloader and isinstance(existing_downloader, HttpDownloader): - existing_downloader.start_download(url, data['save_path'], data.get('header'), data.get('out'), data.get('allow_multiple_connections', False)) + existing_downloader.start_download(url, data['save_path'], data.get('header'), data.get('out'), data.get('allow_multiple_connections', False), data.get('connections_limit', 24)) else: http_downloader = HttpDownloader(hydra_httpdl_bin) downloads[game_id] = http_downloader - http_downloader.start_download(url, data['save_path'], data.get('header'), data.get('out'), data.get('allow_multiple_connections', False)) + http_downloader.start_download(url, data['save_path'], data.get('header'), data.get('out'), data.get('allow_multiple_connections', False), data.get('connections_limit', 24)) downloading_game_id = game_id diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 35841d33..a079f360 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -313,6 +313,8 @@ export class DownloadManager { url: downloadLink, save_path: download.downloadPath, header: `Cookie: accountToken=${token}`, + allow_multiple_connections: true, + connections_limit: 8, }; } case Downloader.PixelDrain: {