From be4200de8175f661dc0615c8393fb3b31f271a0a Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Fri, 29 May 2026 03:56:32 +0100 Subject: [PATCH] fix: remove Buzzheavier downloader --- src/big-picture/src/constants.ts | 1 - src/main/helpers/download-error-handler.ts | 1 - .../services/download/download-manager.ts | 45 +--------- src/main/services/hosters/buzzheavier.ts | 86 ------------------- src/main/services/hosters/index.ts | 1 - src/renderer/src/constants.ts | 1 - src/shared/constants.ts | 27 +++--- src/shared/index.ts | 7 -- 8 files changed, 14 insertions(+), 155 deletions(-) delete mode 100644 src/main/services/hosters/buzzheavier.ts diff --git a/src/big-picture/src/constants.ts b/src/big-picture/src/constants.ts index 0c537777b..e98181453 100644 --- a/src/big-picture/src/constants.ts +++ b/src/big-picture/src/constants.ts @@ -16,7 +16,6 @@ export const DOWNLOADER_NAME: Record = { [Downloader.Mediafire]: "Mediafire", [Downloader.TorBox]: "TorBox", [Downloader.Hydra]: "Nimbus", - [Downloader.Buzzheavier]: "Buzzheavier", [Downloader.FuckingFast]: "FuckingFast", [Downloader.VikingFile]: "VikingFile", [Downloader.Rootz]: "Rootz", diff --git a/src/main/helpers/download-error-handler.ts b/src/main/helpers/download-error-handler.ts index c9adb6418..c6d8fcb42 100644 --- a/src/main/helpers/download-error-handler.ts +++ b/src/main/helpers/download-error-handler.ts @@ -92,7 +92,6 @@ const handleAxiosError = ( }; const HOST_NAMES: Partial> = { - [Downloader.Buzzheavier]: "Buzzheavier", [Downloader.FuckingFast]: "FuckingFast", }; diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index c9174f39a..7eb776756 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -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}` diff --git a/src/main/services/hosters/buzzheavier.ts b/src/main/services/hosters/buzzheavier.ts deleted file mode 100644 index 9ef2d8309..000000000 --- a/src/main/services/hosters/buzzheavier.ts +++ /dev/null @@ -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 { - 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 { - 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 { - return extractHosterFilename(url, directUrl); - } -} diff --git a/src/main/services/hosters/index.ts b/src/main/services/hosters/index.ts index d4e1b09c6..3c0b3a078 100644 --- a/src/main/services/hosters/index.ts +++ b/src/main/services/hosters/index.ts @@ -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"; diff --git a/src/renderer/src/constants.ts b/src/renderer/src/constants.ts index d6dfb3d8e..123b464a6 100644 --- a/src/renderer/src/constants.ts +++ b/src/renderer/src/constants.ts @@ -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", diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 3e343582f..3b9974e7e 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -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 { diff --git a/src/shared/index.ts b/src/shared/index.ts index a28de9ad2..898e2810c 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -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]; }