mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: using aria2 for http downloads
This commit is contained in:
parent
8eca067aed
commit
a39082d326
18 changed files with 3014 additions and 156 deletions
23
src/main/services/aria2c.ts
Normal file
23
src/main/services/aria2c.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import path from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
import { app } from "electron";
|
||||
|
||||
export const startAria2 = () => {
|
||||
const binaryPath = app.isPackaged
|
||||
? path.join(process.resourcesPath, "aria2", "aria2c")
|
||||
: path.join(__dirname, "..", "..", "aria2", "aria2c");
|
||||
|
||||
return spawn(
|
||||
binaryPath,
|
||||
[
|
||||
"--enable-rpc",
|
||||
"--rpc-listen-all",
|
||||
"--file-allocation=none",
|
||||
"--allow-overwrite=true",
|
||||
"--enable-peer-exchange=false",
|
||||
"--enable-dht=false",
|
||||
"--bt-enable-lpd=false",
|
||||
],
|
||||
{ stdio: "inherit", windowsHide: true }
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue