mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
Remove Cors proxy
This commit is contained in:
parent
c554dd0cbe
commit
d017b0c261
@ -1,7 +1,6 @@
|
|||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
|
|
||||||
export class MediafireApi {
|
export class MediafireApi {
|
||||||
private static readonly corsProxy = "https://corsproxy.io/?";
|
|
||||||
private static readonly validMediafireIdentifierDL = /^[a-zA-Z0-9]+$/m;
|
private static readonly validMediafireIdentifierDL = /^[a-zA-Z0-9]+$/m;
|
||||||
private static readonly validMediafirePreDL =
|
private static readonly validMediafirePreDL =
|
||||||
/(?<=['"])(https?:)?(\/\/)?(www\.)?mediafire\.com\/(file|view|download)\/[^'"?]+\?dkey=[^'"]+(?=['"])/;
|
/(?<=['"])(https?:)?(\/\/)?(www\.)?mediafire\.com\/(file|view|download)\/[^'"?]+\?dkey=[^'"]+(?=['"])/;
|
||||||
@ -12,9 +11,7 @@ export class MediafireApi {
|
|||||||
public static async getDownloadUrl(mediafireUrl: string): Promise<string> {
|
public static async getDownloadUrl(mediafireUrl: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const processedUrl = this.processUrl(mediafireUrl);
|
const processedUrl = this.processUrl(mediafireUrl);
|
||||||
const response = await fetch(
|
const response = await fetch(processedUrl);
|
||||||
`${this.corsProxy}${encodeURIComponent(processedUrl)}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!response.ok) throw new Error("Failed to fetch Mediafire page");
|
if (!response.ok) throw new Error("Failed to fetch Mediafire page");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user