From 3c3f77fc50328a00280ed97d9bd684f7423e4258 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Fri, 11 Apr 2025 14:19:57 -0300 Subject: [PATCH] fix: adjust chunk size and connection limits in http downloader --- python_rpc/http_downloader.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python_rpc/http_downloader.py b/python_rpc/http_downloader.py index 31fcc756..3304726d 100644 --- a/python_rpc/http_downloader.py +++ b/python_rpc/http_downloader.py @@ -14,14 +14,14 @@ class HttpDownloader: cmd.append(url) cmd.extend([ - "--chunk-size", "10", + "--chunk-size", "5", "--buffer-size", "16", - "--json-output", + "--log", "--silent" ]) if allow_multiple_connections: - cmd.extend(["--connections", "24"]) + cmd.extend(["--connections", "16"]) print(f"running hydra-httpdl: {' '.join(cmd)}") @@ -54,16 +54,16 @@ class HttpDownloader: response = { "status": "active", - "progress": status["progress"] / 100, - "downloadSpeed": status["download_speed"], + "progress": status["progress"], + "downloadSpeed": status["speed_bps"], "numPeers": 0, "numSeeds": 0, - "bytesDownloaded": status["bytes_downloaded"], - "fileSize": status["file_size"], - "folderName": status["file_name"] + "bytesDownloaded": status["downloaded_bytes"], + "fileSize": status["total_bytes"], + "folderName": status["filename"] } - if status["progress"] == 100.0: + if status["progress"] == 1: response["status"] = "complete" return response