chore(extractor): detect languages from HubCloud title

This commit is contained in:
WebStreamr 2026-03-27 19:30:30 +00:00
parent ad47aecea3
commit 89e57d48d9
No known key found for this signature in database
3 changed files with 31 additions and 1 deletions

View file

@ -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,
},

View file

@ -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",

View file

@ -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",