feat: using aria2 for http downloads

This commit is contained in:
Chubby Granny Chaser
2024-07-02 15:33:26 +01:00
parent 8eca067aed
commit a39082d326
18 changed files with 3014 additions and 156 deletions

View 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 }
);
};