From 201d89e2c4cf1a070e41fba5e03580470b0238e1 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Wed, 25 Dec 2024 21:39:59 +0000 Subject: [PATCH] feat: adding torbox integration --- src/main/main.ts | 3 +++ .../services/download/download-manager.ts | 14 ++++++++++ src/main/services/download/torbox.ts | 23 ++++++++-------- src/renderer/src/assets/icons/torbox.webp | Bin 0 -> 12150 bytes src/renderer/src/constants.ts | 1 + .../src/pages/downloads/download-group.tsx | 25 +++++++++++++++++- .../modals/download-settings-modal.tsx | 8 +++--- src/shared/constants.ts | 1 + src/shared/index.ts | 2 +- 9 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 src/renderer/src/assets/icons/torbox.webp diff --git a/src/main/main.ts b/src/main/main.ts index add619e1..81916174 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -11,6 +11,7 @@ import { uploadGamesBatch } from "./services/library-sync"; import { Aria2 } from "./services/aria2"; import { Downloader } from "@shared"; import { IsNull, Not } from "typeorm"; +import { TorBoxClient } from "./services/download/torbox"; const loadState = async (userPreferences: UserPreferences | null) => { import("./events"); @@ -21,6 +22,8 @@ const loadState = async (userPreferences: UserPreferences | null) => { RealDebridClient.authorize(userPreferences?.realDebridApiToken); } + TorBoxClient.authorize("7371d5ec-52fa-4b87-9052-0c8c96d947cc"); + Ludusavi.addManifestToLudusaviConfig(); HydraApi.setupApi().then(() => { diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 80a3f6fb..1c91c4dc 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -20,6 +20,7 @@ import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity import { RealDebridClient } from "./real-debrid"; import path from "path"; import { logger } from "../logger"; +import { TorBoxClient } from "./torbox"; export class DownloadManager { private static downloadingGameId: number | null = null; @@ -29,6 +30,7 @@ export class DownloadManager { game?.status === "active" ? await this.getDownloadPayload(game).catch(() => undefined) : undefined, + initialSeeding?.map((game) => ({ game_id: game.id, url: game.uri!, @@ -294,6 +296,18 @@ export class DownloadManager { save_path: game.downloadPath!, }; } + case Downloader.TorBox: { + const downloadUrl = await TorBoxClient.getDownloadUrl(game.uri!); + console.log(downloadUrl); + + if (!downloadUrl) return; + return { + action: "start", + game_id: game.id, + url: downloadUrl, + save_path: game.downloadPath!, + }; + } } } diff --git a/src/main/services/download/torbox.ts b/src/main/services/download/torbox.ts index 3eade81d..1ef57768 100644 --- a/src/main/services/download/torbox.ts +++ b/src/main/services/download/torbox.ts @@ -20,7 +20,7 @@ export class TorBoxClient { Authorization: `Bearer ${apiToken}`, }, }); - this.apiToken = apiToken; + this.apiToken = "7371d5ec-52fa-4b87-9052-0c8c96d947cc"; } static async addMagnet(magnet: string) { @@ -55,22 +55,16 @@ export class TorBoxClient { } static async requestLink(id: number) { - const searchParams = new URLSearchParams({}); - - searchParams.set("token", this.apiToken); - searchParams.set("torrent_id", id.toString()); - searchParams.set("zip_link", "true"); + const searchParams = new URLSearchParams({ + token: this.apiToken, + torrent_id: id.toString(), + zip_link: "true", + }); const response = await this.instance.get( "/torrents/requestdl?" + searchParams.toString() ); - if (response.status !== 200) { - logger.error(response.data.error); - logger.error(response.data.detail); - return null; - } - return response.data.data; } @@ -94,4 +88,9 @@ export class TorBoxClient { const torrent = await this.addMagnet(magnetUri); return torrent.torrent_id; } + + static async getDownloadUrl(uri: string) { + const id = await this.getTorrentId(uri); + return this.requestLink(id); + } } diff --git a/src/renderer/src/assets/icons/torbox.webp b/src/renderer/src/assets/icons/torbox.webp new file mode 100644 index 0000000000000000000000000000000000000000..68d68531b4ebc3e12028bedd4d3946060d4196d0 GIT binary patch literal 12150 zcmV-+FNx4nNk&F)F8}~nMM6+kP&iCtF8}~9|G|F{RSP4xZ6i7Q|F4s__N>>4m;n7^ z>{A69WCJQm*X9xE_yF&Qun%mPlXUL1%sU@Z-bukhA!X5L#x(!`dE0WHTc6MBegyr% z`Wf8y{kQEt>$94(?&o#5_y7O znA^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pyIN%J7 zf5f@FZP{zC5sA9?}AK+aiDgAKj325bDAVIQ{zLz6?}(a zB5Dx(&b7fLCJDdpdSqq?g7_1$>Qu0jeVVcNVzgeoEgG3QRCIZ_Bol?0nc&lJ&) zIC7&)e`%7bDfPUU@h0x;5Z#A#LSh%`5sChlT4iPkUWCJDxejUfFiE_o+vkBWM5OGN z%aB${DMd2edsFWvB1{m8i*c2I;A(_)oex5oierb09oA0WjEig;X^6xskU-%s*tGm4 z5v;v%j~%+VS(>UNBu*Bw?G~i%y&>6GPVI&JT@{e=x*^3y>!Eq_C2o*!>{WdmN}@rx~%Ib)b|79L{^X&xYt+OtzfG4i?FQ#Ql{P7M}s(xLH~9mL$i6wD7pZ%SL1(*0X}N&Q&JK z{H`rX;s!c*#uAabm@GI8QYy)^a2MKwC3Yy-@jQq0BaM= z3!#Q!BaXWj>6pYOslA#7@s~$D-lRdhMf)2T=<#t{Fu&y6#=%P0Z8Yg#k$5en=T1Pm zGbV_{sdm{tlM;Vm-7T;qun41Ly#3Cd1y{o)(<`L
- {DOWNLOADER_NAME[game.downloader]} + {game.downloader === Downloader.TorBox ? ( +
+ TorBox + TorBox +
+ ) : ( + {DOWNLOADER_NAME[game.downloader]} + )}
diff --git a/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx b/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx index 191d9ac1..8d650c17 100644 --- a/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/download-settings-modal.tsx @@ -68,11 +68,9 @@ export function DownloadSettingsModal({ return true; }); - /* Gives preference to Real Debrid */ - const selectedDownloader = filteredDownloaders.includes( - Downloader.RealDebrid - ) - ? Downloader.RealDebrid + /* Gives preference to TorBox */ + const selectedDownloader = filteredDownloaders.includes(Downloader.TorBox) + ? Downloader.TorBox : filteredDownloaders[0]; setSelectedDownloader( diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 2d313abb..4ab7443d 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -4,6 +4,7 @@ export enum Downloader { Gofile, PixelDrain, Qiwi, + TorBox, } export enum DownloadSourceStatus { diff --git a/src/shared/index.ts b/src/shared/index.ts index 85868391..e0b09deb 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -92,7 +92,7 @@ export const getDownloadersForUri = (uri: string) => { return [Downloader.RealDebrid]; if (uri.startsWith("magnet:")) { - return [Downloader.Torrent, Downloader.RealDebrid]; + return [Downloader.Torrent, Downloader.TorBox, Downloader.RealDebrid]; } return [];