From c1bd1d30d7a702587a54a803224cb5173c731106 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Sun, 18 Aug 2024 16:21:05 +0100 Subject: [PATCH] feat: adding support to qiwi --- src/main/services/hosters/qiwi.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/services/hosters/qiwi.ts diff --git a/src/main/services/hosters/qiwi.ts b/src/main/services/hosters/qiwi.ts new file mode 100644 index 00000000..e18b011c --- /dev/null +++ b/src/main/services/hosters/qiwi.ts @@ -0,0 +1,15 @@ +import { requestWebPage } from "@main/helpers"; + +export class QiwiApi { + public static async getDownloadUrl(url: string) { + const document = await requestWebPage(url); + const fileName = document.querySelector("h1")?.textContent; + + const slug = url.split("/").pop(); + const extension = fileName?.split(".").pop(); + + const downloadUrl = `https://spyderrock.com/${slug}.${extension}`; + + return downloadUrl; + } +}