From 89e57d48d95a6f8dd6446048ae72de51dd481f37 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 27 Mar 2026 19:30:30 +0000 Subject: [PATCH] chore(extractor): detect languages from HubCloud title --- src/extractor/HubCloud.ts | 6 ++++- .../__snapshots__/HubCloud.test.ts.snap | 22 +++++++++++++++++++ .../__snapshots__/HubDrive.test.ts.snap | 4 ++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/extractor/HubCloud.ts b/src/extractor/HubCloud.ts index e055e14..782bb16 100644 --- a/src/extractor/HubCloud.ts +++ b/src/extractor/HubCloud.ts @@ -1,7 +1,7 @@ import bytes from 'bytes'; import * as cheerio from 'cheerio'; import { Context, Format, InternalUrlResult, Meta } from '../types'; -import { findHeight } from '../utils'; +import { findCountryCodes, findHeight } from '../utils'; import { Extractor } from './Extractor'; export class HubCloud extends Extractor { @@ -27,6 +27,7 @@ export class HubCloud extends Extractor { const $ = cheerio.load(linksHtml); const title = $('title').text().trim(); + const countryCodes = [...new Set([...meta.countryCodes ?? [], ...findCountryCodes(title)])]; const height = meta.height ?? findHeight(title); return Promise.all([ @@ -46,6 +47,7 @@ export class HubCloud extends Extractor { ...meta, bytes: bytes.parse($('#size').text()) as number, extractorId: `${this.id}_fsl`, + countryCodes, height, title, }, @@ -67,6 +69,7 @@ export class HubCloud extends Extractor { ...meta, bytes: bytes.parse($('#size').text()) as number, extractorId: `${this.id}_fslv2`, + countryCodes, height, title, }, @@ -87,6 +90,7 @@ export class HubCloud extends Extractor { ...meta, bytes: bytes.parse($('#size').text()) as number, extractorId: `${this.id}_pixelserver`, + countryCodes, height, title, }, diff --git a/src/extractor/__snapshots__/HubCloud.test.ts.snap b/src/extractor/__snapshots__/HubCloud.test.ts.snap index c5c0d55..d4ec20f 100644 --- a/src/extractor/__snapshots__/HubCloud.test.ts.snap +++ b/src/extractor/__snapshots__/HubCloud.test.ts.snap @@ -7,6 +7,10 @@ exports[`HubCloud handle crayon shin-chan 1993 1`] = ` "label": "HubCloud (FSL)", "meta": { "bytes": 28550795100, + "countryCodes": [ + "hi", + "ja", + ], "extractorId": "hubcloud_fsl", "height": 1080, "title": "Crayon Shinchan Action Kamen vs Demon (1993) 1080p BluRay REMUX AVC [Hindi DD 2.0 + Japanese FLAC 2.0] (PitiPati-Ionicboy) (4kHDHub.com).mkv", @@ -24,6 +28,10 @@ exports[`HubCloud handle dark 2017 s03e08 1`] = ` "label": "HubCloud (FSL)", "meta": { "bytes": 3382286745, + "countryCodes": [ + "de", + "en", + ], "extractorId": "hubcloud_fsl", "height": 1080, "title": "Dark.S03E08.The.Paradise.1080p.NF.WEB-DL.English.DDP5.1-German.DDP5.1.H.264-4kHdHub.Com.mkv", @@ -36,6 +44,10 @@ exports[`HubCloud handle dark 2017 s03e08 1`] = ` "label": "HubCloud (PixelServer)", "meta": { "bytes": 3382286745, + "countryCodes": [ + "de", + "en", + ], "extractorId": "hubcloud_pixelserver", "height": 1080, "title": "Dark.S03E08.The.Paradise.1080p.NF.WEB-DL.English.DDP5.1-German.DDP5.1.H.264-4kHdHub.Com.mkv", @@ -56,6 +68,7 @@ exports[`HubCloud handle dexter original sin 2024 s01e01 1`] = ` "label": "HubCloud (FSL)", "meta": { "bytes": 5733781340, + "countryCodes": [], "extractorId": "hubcloud_fsl", "height": 2160, "title": "Dexter.Original.Sin.S01E01.2160p.SKST.WEB-DL.H.265.DDP5.1-Tyrell.mkv", @@ -68,6 +81,7 @@ exports[`HubCloud handle dexter original sin 2024 s01e01 1`] = ` "label": "HubCloud (PixelServer)", "meta": { "bytes": 5733781340, + "countryCodes": [], "extractorId": "hubcloud_pixelserver", "height": 2160, "title": "Dexter.Original.Sin.S01E01.2160p.SKST.WEB-DL.H.265.DDP5.1-Tyrell.mkv", @@ -88,6 +102,10 @@ exports[`HubCloud handle goat 2026 1`] = ` "label": "HubCloud (FSL)", "meta": { "bytes": 19091129630, + "countryCodes": [ + "en", + "hi", + ], "extractorId": "hubcloud_fsl", "height": 2160, "title": "Goat (2026) 2160p 10bit HDR10+ DV iTunes WEB-DL HEVC x265 [Hindi AMZN DDP 5.1 640kbps + English DDP Atmos 5.1] ESub-(BYNDR-4kHdHub).mkv", @@ -100,6 +118,10 @@ exports[`HubCloud handle goat 2026 1`] = ` "label": "HubCloud (FSLv2)", "meta": { "bytes": 19091129630, + "countryCodes": [ + "en", + "hi", + ], "extractorId": "hubcloud_fslv2", "height": 2160, "title": "Goat (2026) 2160p 10bit HDR10+ DV iTunes WEB-DL HEVC x265 [Hindi AMZN DDP 5.1 640kbps + English DDP Atmos 5.1] ESub-(BYNDR-4kHdHub).mkv", diff --git a/src/extractor/__snapshots__/HubDrive.test.ts.snap b/src/extractor/__snapshots__/HubDrive.test.ts.snap index dc141fe..3e577d5 100644 --- a/src/extractor/__snapshots__/HubDrive.test.ts.snap +++ b/src/extractor/__snapshots__/HubDrive.test.ts.snap @@ -7,6 +7,10 @@ exports[`HubDrive handle avatar 1`] = ` "label": "HubCloud (FSL)", "meta": { "bytes": 64649995223, + "countryCodes": [ + "en", + "hi", + ], "extractorId": "hubcloud_fsl", "height": 2160, "title": "Avatar (2009) Extended Collector's Edition IMAX 2160p UHD BluRay REMUX DV HDR 10bit HEVC [Hindi DDP 5.1 + English DTS-HD MA 5.1] x265 (LM-LUMiX) 4KHDHUB.[Com].mkv",