mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
Merge branch 'ci/rust-rpc' of github.com:hydralauncher/hydra into feat/hydra-debrid
This commit is contained in:
@@ -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"])
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -314,6 +314,8 @@ export class DownloadManager {
|
||||
url: downloadLink,
|
||||
save_path: download.downloadPath,
|
||||
header: `Cookie: accountToken=${token}`,
|
||||
allow_multiple_connections: true,
|
||||
connections_limit: 8,
|
||||
};
|
||||
}
|
||||
case Downloader.PixelDrain: {
|
||||
|
||||
Reference in New Issue
Block a user