mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
15 lines
429 B
TypeScript
15 lines
429 B
TypeScript
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;
|
|
}
|
|
}
|