From 91bb371e0bc0c944a33c91d543751bc070d3bbc8 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Mon, 14 Apr 2025 09:34:00 -0300 Subject: [PATCH] fix: reduce connections limit for http downloads --- python_rpc/http_downloader.py | 4 ++-- python_rpc/main.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python_rpc/http_downloader.py b/python_rpc/http_downloader.py index 22c4cafc..05786afd 100644 --- a/python_rpc/http_downloader.py +++ b/python_rpc/http_downloader.py @@ -14,8 +14,8 @@ class HttpDownloader: cmd.append(url) cmd.extend([ - "--chunk-size", "16", - "--buffer-size", "24", + "--chunk-size", "64", + "--buffer-size", "20", "--force-download", "--log", "--silent" diff --git a/python_rpc/main.py b/python_rpc/main.py index b820a284..10747d08 100644 --- a/python_rpc/main.py +++ b/python_rpc/main.py @@ -36,7 +36,7 @@ if start_download_payload: http_downloader = HttpDownloader(hydra_httpdl_bin) downloads[initial_download['game_id']] = http_downloader try: - http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'), initial_download.get('allow_multiple_connections', False), initial_download.get('connections_limit', 16)) + http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'), initial_download.get('allow_multiple_connections', False), initial_download.get('connections_limit', 8)) except Exception as e: print("Error starting http download", e) @@ -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('allow_multiple_connections', False), data.get('connections_limit', 16)) + existing_downloader.start_download(url, data['save_path'], data.get('header'), data.get('allow_multiple_connections', False), data.get('connections_limit', 8)) 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('allow_multiple_connections', False), data.get('connections_limit', 16)) + http_downloader.start_download(url, data['save_path'], data.get('header'), data.get('allow_multiple_connections', False), data.get('connections_limit', 8)) downloading_game_id = game_id