From 39850dccf70a2bae1355e6c3018931457cefd382 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:18:34 +0000 Subject: [PATCH] feat(extractor): support PixelServer in HubCloud looks like it will limit download speed after a while, but some sources only have that one.. --- src/extractor/HubCloud.ts | 59 ++++++++++++------- .../https:hubcloud.onedriveidt1evqfuviqiei | 4 +- ...lyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0} | 12 ++-- .../__snapshots__/HubCloud.test.ts.snap | 26 +++++++- 4 files changed, 72 insertions(+), 29 deletions(-) rename src/extractor/__fixtures__/HubCloud/{https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSQmVieHZmMU5oV0Q0M2lDNGxSUXNHYz0 => https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0} (91%) diff --git a/src/extractor/HubCloud.ts b/src/extractor/HubCloud.ts index 007888f..6e5357a 100644 --- a/src/extractor/HubCloud.ts +++ b/src/extractor/HubCloud.ts @@ -21,26 +21,45 @@ export class HubCloud extends Extractor { const linksHtml = await this.fetcher.text(ctx, new URL(redirectUrlMatch[1] as string)); const $ = cheerio.load(linksHtml); - return $('a') - .filter((_i, el) => { - const text = $(el).text(); + return [ + ...$('a') + .filter((_i, el) => { + const text = $(el).text(); - return text.includes('FSL') || text.includes('Download File'); - }) - .map((_i, el) => { - const url = new URL($(el).attr('href') as string); - return { - url, - format: Format.unknown, - label: `${this.label} (FSL)`, - sourceId: `${this.id}_fsl`, - ttl: this.ttl, - meta: { - ...meta, - bytes: bytes.parse($('#size').text()) as number, - title: $('title').text().trim(), - }, - }; - }).toArray(); + return text.includes('FSL') || text.includes('Download File'); + }) + .map((_i, el) => { + const url = new URL($(el).attr('href') as string); + return { + url, + format: Format.unknown, + label: `${this.label} (FSL)`, + sourceId: `${this.id}_fsl`, + ttl: this.ttl, + meta: { + ...meta, + bytes: bytes.parse($('#size').text()) as number, + title: $('title').text().trim(), + }, + }; + }).toArray(), + ...$('a') + .filter((_i, el) => $(el).text().includes('PixelServer')) + .map((_i, el) => { + const url = new URL(($(el).attr('href') as string).replace('/u/', '/api/file/')); + return { + url, + format: Format.unknown, + label: `${this.label} (PixelServer)`, + sourceId: `${this.id}_pixelserver`, + ttl: this.ttl, + meta: { + ...meta, + bytes: bytes.parse($('#size').text()) as number, + title: $('title').text().trim(), + }, + }; + }).toArray(), + ]; }; } diff --git a/src/extractor/__fixtures__/HubCloud/https:hubcloud.onedriveidt1evqfuviqiei b/src/extractor/__fixtures__/HubCloud/https:hubcloud.onedriveidt1evqfuviqiei index b959220..99b1382 100644 --- a/src/extractor/__fixtures__/HubCloud/https:hubcloud.onedriveidt1evqfuviqiei +++ b/src/extractor/__fixtures__/HubCloud/https:hubcloud.onedriveidt1evqfuviqiei @@ -217,7 +217,7 @@ HubCloud | Create An Account | Generate Direct Download Link + Generate Direct Download Link
@@ -280,7 +280,7 @@ setTimeout(function(){ document.querySelector(".loading").classList.add("d-none"); document.querySelector(".vd").classList.remove("d-none"); }, 2000); -var url = 'https://stockbhoomi.com/hubcloud.php?host=hubcloud&id=idt1evqfuviqiei&token=RUhXL2kvWnI3MmtFTTlyc1VGY2JSQmVieHZmMU5oV0Q0M2lDNGxSUXNHYz0='; +var url = 'https://stockbhoomi.com/hubcloud.php?host=hubcloud&id=idt1evqfuviqiei&token=RUhXL2kvWnI3MmtFTTlyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0='; var download = document.getElementById('download'); download.onclick = function() { diff --git a/src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSQmVieHZmMU5oV0Q0M2lDNGxSUXNHYz0 b/src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0 similarity index 91% rename from src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSQmVieHZmMU5oV0Q0M2lDNGxSUXNHYz0 rename to src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0 index a33e42f..011081d 100644 --- a/src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSQmVieHZmMU5oV0Q0M2lDNGxSUXNHYz0 +++ b/src/extractor/__fixtures__/HubCloud/https:stockbhoomi.comhubcloud.phphosthubcloudandididt1evqfuviqieiandtokenRUhXL2kvWnI3MmtFTTlyc1VGY2JSR2FsTnZCdkd0NFN5aUpPN1V0NHRSaz0 @@ -186,14 +186,14 @@ HubCloud | Login - Download [PixelServer : 2] + Download [PixelServer : 2] - + Download [Server : 10Gbps]

@@ -205,7 +205,7 @@ HubCloud | Login - Download [FSL Server] + Download [FSL Server]