mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-06-01 22:09:27 +02:00
fix: remove Buzzheavier downloader
This commit is contained in:
@@ -16,7 +16,6 @@ export const DOWNLOADER_NAME: Record<Downloader, string> = {
|
||||
[Downloader.Mediafire]: "Mediafire",
|
||||
[Downloader.TorBox]: "TorBox",
|
||||
[Downloader.Hydra]: "Nimbus",
|
||||
[Downloader.Buzzheavier]: "Buzzheavier",
|
||||
[Downloader.FuckingFast]: "FuckingFast",
|
||||
[Downloader.VikingFile]: "VikingFile",
|
||||
[Downloader.Rootz]: "Rootz",
|
||||
|
||||
@@ -92,7 +92,6 @@ const handleAxiosError = (
|
||||
};
|
||||
|
||||
const HOST_NAMES: Partial<Record<Downloader, string>> = {
|
||||
[Downloader.Buzzheavier]: "Buzzheavier",
|
||||
[Downloader.FuckingFast]: "FuckingFast",
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
DatanodesApi,
|
||||
MediafireApi,
|
||||
PixelDrainApi,
|
||||
FuckingFastApi,
|
||||
VikingFileApi,
|
||||
RootzApi,
|
||||
} from "../hosters";
|
||||
@@ -27,7 +28,6 @@ import { GameFilesManager } from "../game-files-manager";
|
||||
import { HydraDebridClient } from "./hydra-debrid";
|
||||
import { PremiumizeClient } from "./premiumize";
|
||||
import { AllDebridClient } from "./all-debrid";
|
||||
import { BuzzheavierApi, FuckingFastApi } from "@main/services/hosters";
|
||||
import { JsHttpDownloader } from "./js-http-downloader";
|
||||
import { getDirectorySize } from "@main/events/helpers/get-directory-size";
|
||||
import {
|
||||
@@ -864,8 +864,6 @@ export class DownloadManager {
|
||||
return this.getPixelDrainDownloadOptions(download, resumingFilename);
|
||||
case Downloader.Datanodes:
|
||||
return this.getDatanodesDownloadOptions(download, resumingFilename);
|
||||
case Downloader.Buzzheavier:
|
||||
return this.getBuzzheavierDownloadOptions(download, resumingFilename);
|
||||
case Downloader.FuckingFast:
|
||||
return this.getFuckingFastDownloadOptions(download, resumingFilename);
|
||||
case Downloader.Mediafire:
|
||||
@@ -1046,26 +1044,6 @@ export class DownloadManager {
|
||||
);
|
||||
}
|
||||
|
||||
private static async getBuzzheavierDownloadOptions(
|
||||
download: Download,
|
||||
resumingFilename?: string
|
||||
) {
|
||||
logger.log(
|
||||
`[DownloadManager] Processing Buzzheavier download for URI: ${download.uri}`
|
||||
);
|
||||
const directUrl = await BuzzheavierApi.getDirectLink(download.uri);
|
||||
const filename = this.resolveFilename(
|
||||
resumingFilename,
|
||||
download.uri,
|
||||
directUrl
|
||||
);
|
||||
return this.buildDownloadOptions(
|
||||
directUrl,
|
||||
download.downloadPath,
|
||||
filename
|
||||
);
|
||||
}
|
||||
|
||||
private static async getFuckingFastDownloadOptions(
|
||||
download: Download,
|
||||
resumingFilename?: string
|
||||
@@ -1268,27 +1246,6 @@ export class DownloadManager {
|
||||
save_path: download.downloadPath,
|
||||
};
|
||||
}
|
||||
case Downloader.Buzzheavier: {
|
||||
logger.log(
|
||||
`[DownloadManager] Processing Buzzheavier download for URI: ${download.uri}`
|
||||
);
|
||||
try {
|
||||
const directUrl = await BuzzheavierApi.getDirectLink(download.uri);
|
||||
logger.log(`[DownloadManager] Buzzheavier direct URL obtained`);
|
||||
return this.createDownloadPayload(
|
||||
directUrl,
|
||||
download.uri,
|
||||
downloadId,
|
||||
download.downloadPath
|
||||
);
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`[DownloadManager] Error processing Buzzheavier download:`,
|
||||
error
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
case Downloader.FuckingFast: {
|
||||
logger.log(
|
||||
`[DownloadManager] Processing FuckingFast download for URI: ${download.uri}`
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import axios from "axios";
|
||||
import {
|
||||
HOSTER_USER_AGENT,
|
||||
extractHosterFilename,
|
||||
handleHosterError,
|
||||
} from "./fuckingfast";
|
||||
import { logger } from "@main/services";
|
||||
|
||||
export class BuzzheavierApi {
|
||||
private static readonly BUZZHEAVIER_DOMAINS = [
|
||||
"buzzheavier.com",
|
||||
"bzzhr.co",
|
||||
"fuckingfast.net",
|
||||
];
|
||||
|
||||
private static isSupportedDomain(url: string): boolean {
|
||||
const lowerUrl = url.toLowerCase();
|
||||
return this.BUZZHEAVIER_DOMAINS.some((domain) => lowerUrl.includes(domain));
|
||||
}
|
||||
|
||||
private static async getBuzzheavierDirectLink(url: string): Promise<string> {
|
||||
try {
|
||||
const baseUrl = url.split("#")[0];
|
||||
logger.log(
|
||||
`[Buzzheavier] Starting download link extraction for: ${baseUrl}`
|
||||
);
|
||||
|
||||
await axios.get(baseUrl, {
|
||||
headers: { "User-Agent": HOSTER_USER_AGENT },
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
const downloadUrl = `${baseUrl}/download`;
|
||||
logger.log(`[Buzzheavier] Making HEAD request to: ${downloadUrl}`);
|
||||
const headResponse = await axios.head(downloadUrl, {
|
||||
headers: {
|
||||
"hx-current-url": baseUrl,
|
||||
"hx-request": "true",
|
||||
referer: baseUrl,
|
||||
"User-Agent": HOSTER_USER_AGENT,
|
||||
},
|
||||
maxRedirects: 0,
|
||||
validateStatus: (status) =>
|
||||
status === 200 || status === 204 || status === 301 || status === 302,
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
const hxRedirect = headResponse.headers["hx-redirect"];
|
||||
logger.log(`[Buzzheavier] Received hx-redirect header: ${hxRedirect}`);
|
||||
if (!hxRedirect) {
|
||||
logger.error(
|
||||
`[Buzzheavier] No hx-redirect header found. Status: ${headResponse.status}`
|
||||
);
|
||||
throw new Error(
|
||||
"Could not extract download link. File may be deleted or is a directory."
|
||||
);
|
||||
}
|
||||
|
||||
const domain = new URL(baseUrl).hostname;
|
||||
const directLink = hxRedirect.startsWith("/dl/")
|
||||
? `https://${domain}${hxRedirect}`
|
||||
: hxRedirect;
|
||||
logger.log(`[Buzzheavier] Extracted direct link`);
|
||||
return directLink;
|
||||
} catch (error) {
|
||||
logger.error(`[Buzzheavier] Error in getBuzzheavierDirectLink:`, error);
|
||||
handleHosterError(error);
|
||||
}
|
||||
}
|
||||
|
||||
public static async getDirectLink(url: string): Promise<string> {
|
||||
if (!this.isSupportedDomain(url)) {
|
||||
throw new Error(
|
||||
`Unsupported domain. Supported domains: ${this.BUZZHEAVIER_DOMAINS.join(", ")}`
|
||||
);
|
||||
}
|
||||
return this.getBuzzheavierDirectLink(url);
|
||||
}
|
||||
|
||||
public static async getFilename(
|
||||
url: string,
|
||||
directUrl?: string
|
||||
): Promise<string> {
|
||||
return extractHosterFilename(url, directUrl);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ export * from "./gofile";
|
||||
export * from "./datanodes";
|
||||
export * from "./mediafire";
|
||||
export * from "./pixeldrain";
|
||||
export * from "./buzzheavier";
|
||||
export * from "./fuckingfast";
|
||||
export * from "./vikingfile";
|
||||
export * from "./rootz";
|
||||
|
||||
@@ -9,7 +9,6 @@ export const DOWNLOADER_NAME = {
|
||||
[Downloader.PixelDrain]: "PixelDrain",
|
||||
[Downloader.Datanodes]: "Datanodes",
|
||||
[Downloader.Mediafire]: "Mediafire",
|
||||
[Downloader.Buzzheavier]: "Buzzheavier",
|
||||
[Downloader.FuckingFast]: "FuckingFast",
|
||||
[Downloader.TorBox]: "TorBox",
|
||||
[Downloader.Hydra]: "Nimbus",
|
||||
|
||||
+13
-14
@@ -1,18 +1,17 @@
|
||||
export enum Downloader {
|
||||
RealDebrid,
|
||||
Torrent,
|
||||
Gofile,
|
||||
PixelDrain,
|
||||
Datanodes,
|
||||
Mediafire,
|
||||
TorBox,
|
||||
Hydra,
|
||||
Buzzheavier,
|
||||
FuckingFast,
|
||||
VikingFile,
|
||||
Rootz,
|
||||
Premiumize,
|
||||
AllDebrid,
|
||||
RealDebrid = 0,
|
||||
Torrent = 1,
|
||||
Gofile = 2,
|
||||
PixelDrain = 3,
|
||||
Datanodes = 4,
|
||||
Mediafire = 5,
|
||||
TorBox = 6,
|
||||
Hydra = 7,
|
||||
FuckingFast = 9,
|
||||
VikingFile = 10,
|
||||
Rootz = 11,
|
||||
Premiumize = 12,
|
||||
AllDebrid = 13,
|
||||
}
|
||||
|
||||
export enum DownloadSourceStatus {
|
||||
|
||||
@@ -135,13 +135,6 @@ export const getDownloadersForUri = (uri: string) => {
|
||||
if (uri.startsWith("https://datanodes.to")) return [Downloader.Datanodes];
|
||||
if (uri.startsWith("https://www.mediafire.com"))
|
||||
return [Downloader.Mediafire];
|
||||
if (
|
||||
uri.startsWith("https://buzzheavier.com") ||
|
||||
uri.startsWith("https://bzzhr.co") ||
|
||||
uri.startsWith("https://fuckingfast.net")
|
||||
) {
|
||||
return [Downloader.Buzzheavier];
|
||||
}
|
||||
if (uri.startsWith("https://fuckingfast.co")) {
|
||||
return [Downloader.FuckingFast];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user