Merge branch 'main' into fix/downloads-ui

This commit is contained in:
Moyase
2025-12-10 20:38:07 +02:00
committed by GitHub
3 changed files with 9 additions and 11 deletions

View File

@@ -33,9 +33,7 @@ export const loadState = async () => {
await import("./events"); await import("./events");
if (process.platform !== "darwin") { Aria2.spawn();
Aria2.spawn();
}
if (userPreferences?.realDebridApiToken) { if (userPreferences?.realDebridApiToken) {
RealDebridClient.authorize(userPreferences.realDebridApiToken); RealDebridClient.authorize(userPreferences.realDebridApiToken);

View File

@@ -7,9 +7,12 @@ export class Aria2 {
private static process: cp.ChildProcess | null = null; private static process: cp.ChildProcess | null = null;
public static spawn() { public static spawn() {
const binaryPath = app.isPackaged const binaryPath =
? path.join(process.resourcesPath, "aria2c") process.platform === "darwin"
: path.join(__dirname, "..", "..", "binaries", "aria2c"); ? "aria2c"
: app.isPackaged
? path.join(process.resourcesPath, "aria2c")
: path.join(__dirname, "..", "..", "binaries", "aria2c");
this.process = cp.spawn( this.process = cp.spawn(
binaryPath, binaryPath,

View File

@@ -36,16 +36,13 @@ export class GofileApi {
} }
public static async getDownloadLink(id: string) { public static async getDownloadLink(id: string) {
const searchParams = new URLSearchParams({
wt: WT,
});
const response = await axios.get<{ const response = await axios.get<{
status: string; status: string;
data: GofileContentsResponse; data: GofileContentsResponse;
}>(`https://api.gofile.io/contents/${id}?${searchParams.toString()}`, { }>(`https://api.gofile.io/contents/${id}`, {
headers: { headers: {
Authorization: `Bearer ${this.token}`, Authorization: `Bearer ${this.token}`,
"X-Website-Token": WT,
}, },
}); });