From 898e332e7d596e0765be63c5c7546368602d0245 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 15:33:10 +0100 Subject: [PATCH 01/25] Add MHKX decorator and websites --- web/src/engine/websites/KanMan.ts | 29 +++++ .../engine/websites/{legacy => }/KanMan.webp | Bin web/src/engine/websites/ManhuaTai.ts | 21 ++++ .../websites/{legacy => }/ManhuaTai.webp | Bin web/src/engine/websites/SouDongMan.ts | 21 ++++ .../websites/{legacy => }/SouDongMan.webp | Bin web/src/engine/websites/TaoManhua.ts | 21 ++++ .../websites/{legacy => }/TaoManhua.webp | Bin web/src/engine/websites/decorators/MHKX.ts | 100 ++++++++++++++++++ web/src/engine/websites/legacy/KanMan.ts | 37 ------- web/src/engine/websites/legacy/ManhuaTai.ts | 38 ------- web/src/engine/websites/legacy/SouDongMan.ts | 39 ------- web/src/engine/websites/legacy/TaoManhua.ts | 38 ------- web/src/i18n/ILocale.ts | 7 +- web/src/i18n/locales/en_US.ts | 7 ++ 15 files changed, 205 insertions(+), 153 deletions(-) create mode 100644 web/src/engine/websites/KanMan.ts rename web/src/engine/websites/{legacy => }/KanMan.webp (100%) mode change 100755 => 100644 create mode 100644 web/src/engine/websites/ManhuaTai.ts rename web/src/engine/websites/{legacy => }/ManhuaTai.webp (100%) mode change 100755 => 100644 create mode 100644 web/src/engine/websites/SouDongMan.ts rename web/src/engine/websites/{legacy => }/SouDongMan.webp (100%) mode change 100755 => 100644 create mode 100644 web/src/engine/websites/TaoManhua.ts rename web/src/engine/websites/{legacy => }/TaoManhua.webp (100%) mode change 100755 => 100644 create mode 100644 web/src/engine/websites/decorators/MHKX.ts delete mode 100755 web/src/engine/websites/legacy/KanMan.ts delete mode 100755 web/src/engine/websites/legacy/ManhuaTai.ts delete mode 100755 web/src/engine/websites/legacy/SouDongMan.ts delete mode 100755 web/src/engine/websites/legacy/TaoManhua.ts diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts new file mode 100644 index 0000000000..df61ae03e6 --- /dev/null +++ b/web/src/engine/websites/KanMan.ts @@ -0,0 +1,29 @@ +import { Tags } from '../Tags'; +import icon from './KanMan.webp'; +import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import * as Common from './decorators/Common'; +import { FetchCSS, FetchRequest } from '../FetchProvider'; +import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; + +@Common.ImageAjax(true) +export default class extends MHKX { + public constructor() { + const product: MHXK_infos = { + id: '1', + name: 'kmh', + platform: 'pc' + }; + + super('kanman', `看漫画 (KanMan)`, 'https://www.kanman.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + } + public override get Icon() { + return icon; + } + + public override async FetchManga(provider: MangaPlugin, url: string): Promise { + const [data] = await FetchCSS(new FetchRequest(url), 'h1.title'); + const id: string = url.match(/(\d+)\/$/)[1]; + const title = data.textContent.trim(); + return new Manga(this, provider, id, title); + } +} \ No newline at end of file diff --git a/web/src/engine/websites/legacy/KanMan.webp b/web/src/engine/websites/KanMan.webp old mode 100755 new mode 100644 similarity index 100% rename from web/src/engine/websites/legacy/KanMan.webp rename to web/src/engine/websites/KanMan.webp diff --git a/web/src/engine/websites/ManhuaTai.ts b/web/src/engine/websites/ManhuaTai.ts new file mode 100644 index 0000000000..79b4cc201e --- /dev/null +++ b/web/src/engine/websites/ManhuaTai.ts @@ -0,0 +1,21 @@ +import { Tags } from '../Tags'; +import icon from './ManhuaTai.webp'; +import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import * as Common from './decorators/Common'; + +@Common.ImageAjax(true) +export default class extends MHKX { + public constructor() { + const product: MHXK_infos = { + id: '2', + name: 'mht', + platform: 'pc' + }; + + super('manhuatai', `ManhuaTai`, 'https://www.manhuatai.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + } + + public override get Icon() { + return icon; + } +} \ No newline at end of file diff --git a/web/src/engine/websites/legacy/ManhuaTai.webp b/web/src/engine/websites/ManhuaTai.webp old mode 100755 new mode 100644 similarity index 100% rename from web/src/engine/websites/legacy/ManhuaTai.webp rename to web/src/engine/websites/ManhuaTai.webp diff --git a/web/src/engine/websites/SouDongMan.ts b/web/src/engine/websites/SouDongMan.ts new file mode 100644 index 0000000000..3979848feb --- /dev/null +++ b/web/src/engine/websites/SouDongMan.ts @@ -0,0 +1,21 @@ +import { Tags } from '../Tags'; +import icon from './KanMan.webp'; +import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import * as Common from './decorators/Common'; + +@Common.ImageAjax(true) +export default class extends MHKX { + public constructor() { + const product: MHXK_infos = { + id: '9', + name: 'soudm', + platform: 'pc' + }; + + super('soudongman', `斗罗大陆 (SouDongMan)`, 'https://www.soudongman.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + } + + public override get Icon() { + return icon; + } +} \ No newline at end of file diff --git a/web/src/engine/websites/legacy/SouDongMan.webp b/web/src/engine/websites/SouDongMan.webp old mode 100755 new mode 100644 similarity index 100% rename from web/src/engine/websites/legacy/SouDongMan.webp rename to web/src/engine/websites/SouDongMan.webp diff --git a/web/src/engine/websites/TaoManhua.ts b/web/src/engine/websites/TaoManhua.ts new file mode 100644 index 0000000000..f868ac2179 --- /dev/null +++ b/web/src/engine/websites/TaoManhua.ts @@ -0,0 +1,21 @@ +import { Tags } from '../Tags'; +import icon from './KanMan.webp'; +import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import * as Common from './decorators/Common'; + +@Common.ImageAjax(true) +export default class extends MHKX { + public constructor() { + const product: MHXK_infos = { + id: '3', + name: 'smh', + platform: 'pc' + }; + + super('taomanhua', `神漫画 (Tao Manhua)`, 'https://www.taomanhua.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + } + + public override get Icon() { + return icon; + } +} \ No newline at end of file diff --git a/web/src/engine/websites/legacy/TaoManhua.webp b/web/src/engine/websites/TaoManhua.webp old mode 100755 new mode 100644 similarity index 100% rename from web/src/engine/websites/legacy/TaoManhua.webp rename to web/src/engine/websites/TaoManhua.webp diff --git a/web/src/engine/websites/decorators/MHKX.ts b/web/src/engine/websites/decorators/MHKX.ts new file mode 100644 index 0000000000..3bae953b1a --- /dev/null +++ b/web/src/engine/websites/decorators/MHKX.ts @@ -0,0 +1,100 @@ +import { type Tag } from '../../Tags'; +import { Choice } from '../../SettingsManager'; +import { EngineResourceKey as E, WebsiteResourceKey as W } from '../../../i18n/ILocale'; +import { Chapter, DecoratableMangaScraper, Manga, Page, type MangaPlugin } from '../../providers/MangaPlugin'; +import { FetchCSS, FetchJSON, FetchRequest } from '../../FetchProvider'; + +export type MHXK_infos = { + id: string, + name: string, + platform: string +} + +type APIResult = { + data: T, + status: number, + message: string; +} + +type APIManga = { + comic_id: number, + comic_name: string + comic_chapter: APIChapter[] + current_chapter: APIChapter +} + +type APIChapter = { + chapter_name: string, + chapter_newid: string + chapter_img_list: string[] +} + +export default class extends DecoratableMangaScraper { + protected product: MHXK_infos; + + public constructor(id: string, title: string, url: string, product: MHXK_infos, ...tags: Tag[]) { + super(id, title, url, ...tags); + this.product = product; + + this.Settings.format = new Choice('image.format', + W.Plugin_Settings_ImageFormat, + W.Plugin_Settings_ImageFormatInfo, + '1', + { key: '0', label: E.Settings_Global_Format_JPEG }, + { key: '1', label: E.Settings_Global_Format_WEBP }, + ); + + this.Settings.quality = new Choice('image.quality', + W.Plugin_Settings_ImageQuality, + W.Plugin_Settings_ImageQualityInfo, + 'high', + { key: 'high', label: W.Plugin_Settings_ImageQuality_High }, + { key: 'middle', label: W.Plugin_Settings_ImageQuality_Medium }, + { key: 'low', label: W.Plugin_Settings_ImageQuality_Low }, + ); + } + + public override ValidateMangaURL(url: string): boolean { + return new RegExp(`^${this.URI.origin}/[^/]+/$`).test(url); + } + + public override async FetchManga(provider: MangaPlugin, url: string): Promise { + const [data] = await FetchCSS(new FetchRequest(url), '[data-comic-id], [data-comic_id]'); + const id: string = data.dataset.comicId || data.dataset.comic_id; + const title = data.textContent.trim(); + return new Manga(this, provider, id, title); + } + + public override async FetchMangas(provider: MangaPlugin): Promise { + const uri = this.createCustomerURI('/getComicList/'); + const { data } = await FetchJSON>(new FetchRequest(uri.href)); + return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); + } + + public override async FetchChapters(manga: Manga): Promise { + const uri = this.createCustomerURI('/getComicInfoBody/'); + uri.searchParams.set('comic_id', manga.Identifier); + const { data } = await FetchJSON>(new FetchRequest(uri.href)); + return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); + } + + public override async FetchPages(chapter: Chapter): Promise { + const uri = this.createCustomerURI('/getchapterinfov2'); + uri.search = new URLSearchParams({ + product_id: this.product.id, + productname: this.product.name, + platformname: this.product.platform, + comic_id: chapter.Parent.Identifier, + chapter_newid: chapter.Identifier, + isWebp: this.Settings.format.Value as string, + quality: this.Settings.quality.Value as string + }).toString(); + const { data } = await FetchJSON>(new FetchRequest(uri.href)); + return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); + } + + createCustomerURI(endpoint: string) { + return new URL('/api' + endpoint, this.URI); + } + +} diff --git a/web/src/engine/websites/legacy/KanMan.ts b/web/src/engine/websites/legacy/KanMan.ts deleted file mode 100755 index f17f652c5e..0000000000 --- a/web/src/engine/websites/legacy/KanMan.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Auto-Generated export from HakuNeko Legacy -// See: https://gist.github.com/ronny1982/0c8d5d4f0bd9c1f1b21dbf9a2ffbfec9 - -//import { Tags } from '../../Tags'; -import icon from './KanMan.webp'; -import { DecoratableMangaScraper } from '../../providers/MangaPlugin'; - -export default class extends DecoratableMangaScraper { - - public constructor() { - super('kanman', `看漫画 (KanMan)`, 'https://www.kanman.com' /*, Tags.Language.English, Tags ... */); - } - - public override get Icon() { - return icon; - } -} - -// Original Source -/* -class KanMan extends MHXK { - - constructor() { - super(); - super.id = 'kanman'; - super.label = '看漫画 (KanMan)'; - this.tags = [ 'manga', 'webtoon', 'chinese' ]; - this.url = 'https://www.kanman.com'; - - this.product = { - id: 1, - name: 'kmh', - platform: 'pc' - }; - } -} -*/ \ No newline at end of file diff --git a/web/src/engine/websites/legacy/ManhuaTai.ts b/web/src/engine/websites/legacy/ManhuaTai.ts deleted file mode 100755 index 089d338322..0000000000 --- a/web/src/engine/websites/legacy/ManhuaTai.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Auto-Generated export from HakuNeko Legacy -// See: https://gist.github.com/ronny1982/0c8d5d4f0bd9c1f1b21dbf9a2ffbfec9 - -//import { Tags } from '../../Tags'; -import icon from './ManhuaTai.webp'; -import { DecoratableMangaScraper } from '../../providers/MangaPlugin'; - -export default class extends DecoratableMangaScraper { - - public constructor() { - super('manhuatai', `ManhuaTai`, 'https://www.manhuatai.com' /*, Tags.Language.English, Tags ... */); - } - - public override get Icon() { - return icon; - } -} - -// Original Source -/* -class ManhuaTai extends MHXK { - - constructor() { - super(); - super.id = 'manhuatai'; - super.label = 'ManhuaTai'; - this.tags = [ 'webtoon', 'chinese' ]; - this.url = 'https://www.manhuatai.com'; - - // extracted from: https://resource.mhxk.com/manhuatai_pc/static/js/chunk/vendor.a06c71.js - this.product = { - id: 2, - name: 'mht', - platform: 'pc' - }; - } -} -*/ \ No newline at end of file diff --git a/web/src/engine/websites/legacy/SouDongMan.ts b/web/src/engine/websites/legacy/SouDongMan.ts deleted file mode 100755 index 14a3abcd5e..0000000000 --- a/web/src/engine/websites/legacy/SouDongMan.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Auto-Generated export from HakuNeko Legacy -// See: https://gist.github.com/ronny1982/0c8d5d4f0bd9c1f1b21dbf9a2ffbfec9 - -//import { Tags } from '../../Tags'; -import icon from './SouDongMan.webp'; -import { DecoratableMangaScraper } from '../../providers/MangaPlugin'; - -export default class extends DecoratableMangaScraper { - - public constructor() { - super('soudongman', `斗罗大陆 (SouDongMan)`, 'https://www.soudongman.com' /*, Tags.Language.English, Tags ... */); - } - - public override get Icon() { - return icon; - } -} - -// Original Source -/* -class SouDongMan extends MHXK { - - constructor() { - super(); - super.id = 'soudongman'; - super.label = '斗罗大陆 (SouDongMan)'; - this.tags = [ 'webtoon', 'chinese' ]; - this.url = 'https://www.soudongman.com'; - - this.queryMangaTitle = 'div.title-warper h1.title'; - // extracted from: https://resource.mhxk.com/soudongman_pc/static/js/chunk/vendor.23b7d6.js - this.product = { - id: 9, - name: 'soudm', - platform: 'pc' - }; - } -} -*/ \ No newline at end of file diff --git a/web/src/engine/websites/legacy/TaoManhua.ts b/web/src/engine/websites/legacy/TaoManhua.ts deleted file mode 100755 index 9c360e2cfd..0000000000 --- a/web/src/engine/websites/legacy/TaoManhua.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Auto-Generated export from HakuNeko Legacy -// See: https://gist.github.com/ronny1982/0c8d5d4f0bd9c1f1b21dbf9a2ffbfec9 - -//import { Tags } from '../../Tags'; -import icon from './TaoManhua.webp'; -import { DecoratableMangaScraper } from '../../providers/MangaPlugin'; - -export default class extends DecoratableMangaScraper { - - public constructor() { - super('taomanhua', `神漫画 (Tao Manhua)`, 'https://www.taomanhua.com' /*, Tags.Language.English, Tags ... */); - } - - public override get Icon() { - return icon; - } -} - -// Original Source -/* -class TaoManhua extends MHXK { - - constructor() { - super(); - super.id = 'taomanhua'; - super.label = '神漫画 (Tao Manhua)'; - this.tags = [ 'webtoon', 'chinese' ]; - this.url = 'https://www.taomanhua.com'; - - // extracted from: https://resource.mhxk.com/shenmanhua_pc/static/js/chunk/vendor.d9c425.js - this.product = { - id: 3, - name: 'smh', - platform: 'pc' - }; - } -} -*/ \ No newline at end of file diff --git a/web/src/i18n/ILocale.ts b/web/src/i18n/ILocale.ts index 6984968939..3d0bac6fd4 100644 --- a/web/src/i18n/ILocale.ts +++ b/web/src/i18n/ILocale.ts @@ -118,7 +118,7 @@ export enum FrontendResourceKey { Frontend_Setting = 'Frontend_Setting', Frontend_Settings = 'Frontend_Settings', Frontend_Help = 'Frontend_Help', - Frontend_About= 'Frontend_About', + Frontend_About = 'Frontend_About', Frontend_Plugin = 'Frontend_Plugin', Frontend_Plugins = 'Frontend_Plugins', Frontend_Plugin_List = 'Frontend_Plugin_List', @@ -310,6 +310,11 @@ export enum WebsiteResourceKey { Plugin_Settings_UrlOverrideInfo = 'Plugin_Settings_UrlOverrideInfo', Plugin_Settings_ImageFormat = 'Plugin_Settings_ImageFormat', Plugin_Settings_ImageFormatInfo = 'Plugin_Settings_ImageFormatInfo', + Plugin_Settings_ImageQuality = 'Plugin_Settings_ImageQuality', + Plugin_Settings_ImageQualityInfo = 'Plugin_Settings_ImageQualityInfo', + Plugin_Settings_ImageQuality_High = 'Plugin_Settings_ImageQuality_High', + Plugin_Settings_ImageQuality_Medium = 'Plugin_Settings_ImageQuality_Medium', + Plugin_Settings_ImageQuality_Low = 'Plugin_Settings_ImageQuality_Low', Plugin_Common_MangaIndex_NotSupported = 'Plugin_Common_MangaIndex_NotSupported', Plugin_Common_Chapter_InvalidError = 'Plugin_Common_Chapter_InvalidError', Plugin_Common_Chapter_UnavailableError = 'Plugin_Common_Chapter_UnavailableError', diff --git a/web/src/i18n/locales/en_US.ts b/web/src/i18n/locales/en_US.ts index 75b7b5b221..6770d88698 100644 --- a/web/src/i18n/locales/en_US.ts +++ b/web/src/i18n/locales/en_US.ts @@ -268,6 +268,13 @@ const translations: VariantResource = { Plugin_Settings_ImageFormat: 'Preferred Image Format', Plugin_Settings_ImageFormatInfo: 'Download pictures using this file format if possible', + Plugin_Settings_ImageQuality: 'Image quality', + Plugin_Settings_ImageQualityInfo: 'Download pictures using this quality if possible', + + Plugin_Settings_ImageQuality_High: 'High', + Plugin_Settings_ImageQuality_Medium: 'Medium', + Plugin_Settings_ImageQuality_Low: 'Low', + Plugin_Common_MangaIndex_NotSupported: 'Unable to create the content index for this website. Use the Copy & Paste feature to directly access the content of a specific URL!', Plugin_Common_Chapter_UnavailableError: 'The chapter is not available (not purchased/unlocked/public)!', Plugin_Common_Chapter_InvalidError: 'Failed to extract the pages from the chapter content!', From 88cf440aaab55aa25aa9793ac3bf3cd01e39c207 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 15:33:36 +0100 Subject: [PATCH 02/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 43a1c2eeb2..c001c5119f 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -186,6 +186,7 @@ export { default as Jpmangas } from './Jpmangas'; export { default as KaiScans } from './KaiScans'; export { default as Kakaopage } from './Kakaopage'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -357,6 +358,7 @@ export { default as ManhuaMix } from './ManhuaMix'; export { default as ManhuaPlus } from './ManhuaPlus'; export { default as ManhuaScan } from './ManhuaScan'; export { default as Manhuass } from './Manhuass'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -519,6 +521,7 @@ export { default as Siyahmelek } from './Siyahmelek'; export { default as SkyMangas } from './SkyMangas'; export { default as SMangaVF } from './SMangaVF'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as StickHorse } from './StickHorse'; export { default as Submanga } from './Submanga'; @@ -529,6 +532,7 @@ export { default as Summertoon } from './Summertoon'; export { default as SundayWebry } from './SundayWebry'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapread } from './Tapread'; export { default as TatakaeScan } from './TatakaeScan'; export { default as TCBScans } from './TCBScans'; @@ -650,7 +654,6 @@ export { default as Imgur } from './legacy/Imgur'; export { default as ImiTui } from './legacy/ImiTui'; export { default as JapanRead } from './legacy/JapanRead'; export { default as JokerFansub } from './legacy/JokerFansub'; -export { default as KanMan } from './legacy/KanMan'; export { default as KirishimaFansub } from './legacy/KirishimaFansub'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; @@ -700,7 +703,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as ManhwasMen } from './legacy/ManhwasMen'; export { default as Manmankan } from './legacy/Manmankan'; export { default as MeioNovel } from './legacy/MeioNovel'; @@ -747,10 +749,8 @@ export { default as SixMH7 } from './legacy/SixMH7'; export { default as SixParkbbsClub } from './legacy/SixParkbbsClub'; export { default as SixParkbbsWeb } from './legacy/SixParkbbsWeb'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as Tapas } from './legacy/Tapas'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; From 8d5483206368b9f5a44dc8d19da759a0f756f6bb Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 15:51:58 +0100 Subject: [PATCH 03/25] fix plugin icons --- web/src/engine/websites/SouDongMan.ts | 2 +- web/src/engine/websites/TaoManhua.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/engine/websites/SouDongMan.ts b/web/src/engine/websites/SouDongMan.ts index 3979848feb..6c5b294ba9 100644 --- a/web/src/engine/websites/SouDongMan.ts +++ b/web/src/engine/websites/SouDongMan.ts @@ -1,5 +1,5 @@ import { Tags } from '../Tags'; -import icon from './KanMan.webp'; +import icon from './SouDongMan.webp'; import MHKX, { type MHXK_infos } from './decorators/MHKX'; import * as Common from './decorators/Common'; diff --git a/web/src/engine/websites/TaoManhua.ts b/web/src/engine/websites/TaoManhua.ts index f868ac2179..ce62268a65 100644 --- a/web/src/engine/websites/TaoManhua.ts +++ b/web/src/engine/websites/TaoManhua.ts @@ -1,5 +1,5 @@ import { Tags } from '../Tags'; -import icon from './KanMan.webp'; +import icon from './TaoManhua.webp'; import MHKX, { type MHXK_infos } from './decorators/MHKX'; import * as Common from './decorators/Common'; From b56aa3b37fb2d5a267bb634647b6f5c97e8c01d5 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 16:03:43 +0100 Subject: [PATCH 04/25] add tests --- web/src/engine/websites/KanMan_e2e.ts | 25 +++++++++++++++++++++++ web/src/engine/websites/ManhuaTai_e2e.ts | 25 +++++++++++++++++++++++ web/src/engine/websites/SouDongMan_e2e.ts | 25 +++++++++++++++++++++++ web/src/engine/websites/TaoManhua_e2e.ts | 25 +++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 web/src/engine/websites/KanMan_e2e.ts create mode 100644 web/src/engine/websites/ManhuaTai_e2e.ts create mode 100644 web/src/engine/websites/SouDongMan_e2e.ts create mode 100644 web/src/engine/websites/TaoManhua_e2e.ts diff --git a/web/src/engine/websites/KanMan_e2e.ts b/web/src/engine/websites/KanMan_e2e.ts new file mode 100644 index 0000000000..77e12f5c8d --- /dev/null +++ b/web/src/engine/websites/KanMan_e2e.ts @@ -0,0 +1,25 @@ +import { TestFixture } from '../../../test/WebsitesFixture'; + +const config = { + plugin: { + id: 'kanman', + title: '看漫画 (KanMan)' + }, + container: { + url: 'https://www.kanman.com/108632/', + id: '108632', + title: '龙腾战尊' + }, + child: { + id: 'yugao-1624325650020', + title: '预告' + }, + entry: { + index: 0, + size: 185_594, + type: 'image/webp' + } +}; + +const fixture = new TestFixture(config); +describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/ManhuaTai_e2e.ts b/web/src/engine/websites/ManhuaTai_e2e.ts new file mode 100644 index 0000000000..61ff1e3658 --- /dev/null +++ b/web/src/engine/websites/ManhuaTai_e2e.ts @@ -0,0 +1,25 @@ +import { TestFixture } from '../../../test/WebsitesFixture'; + +const config = { + plugin: { + id: 'manhuatai', + title: 'ManhuaTai' + }, + container: { + url: 'https://www.manhuatai.com/xitongbiwozuohuanghou/', + id: '106935', + title: '系统逼我做皇后' + }, + child: { + id: 'di290hua-1684488810', + title: '第290话 快点赚积分的法子' + }, + entry: { + index: 0, + size: 314_952, + type: 'image/webp' + } +}; + +const fixture = new TestFixture(config); +describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/SouDongMan_e2e.ts b/web/src/engine/websites/SouDongMan_e2e.ts new file mode 100644 index 0000000000..ea1d6f93ce --- /dev/null +++ b/web/src/engine/websites/SouDongMan_e2e.ts @@ -0,0 +1,25 @@ +import { TestFixture } from '../../../test/WebsitesFixture'; + +const config = { + plugin: { + id: 'soudongman', + title: '斗罗大陆 (SouDongMan)' + }, + container: { + url: 'https://www.soudongman.com/108224/', + id: '108224', + title: '无敌学霸系统' + }, + child: { + id: 'di303hua-1694658870', + title: '第303话 我要当圣使' + }, + entry: { + index: 0, + size: 238_698, + type: 'image/webp' + } +}; + +const fixture = new TestFixture(config); +describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/TaoManhua_e2e.ts b/web/src/engine/websites/TaoManhua_e2e.ts new file mode 100644 index 0000000000..8803b2d6da --- /dev/null +++ b/web/src/engine/websites/TaoManhua_e2e.ts @@ -0,0 +1,25 @@ +import { TestFixture } from '../../../test/WebsitesFixture'; + +const config = { + plugin: { + id: 'taomanhua', + title: '神漫画 (Tao Manhua)' + }, + container: { + url: 'https://www.taomanhua.com/bosschaoqiangdansongdeyaosi/', + id: '108924', + title: '离谱,你管这叫骷髅兵?' + }, + child: { + id: 'renshedangan-1663207710', + title: '人设档案' + }, + entry: { + index: 0, + size: 217_488, + type: 'image/webp' + } +}; + +const fixture = new TestFixture(config); +describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file From 91d7471d09915b4545b0eed1b891af8a94679589 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 16:10:05 +0100 Subject: [PATCH 05/25] Update zu_ZA.ts --- web/src/i18n/locales/zu_ZA.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/i18n/locales/zu_ZA.ts b/web/src/i18n/locales/zu_ZA.ts index ae344737c5..3238bb5804 100644 --- a/web/src/i18n/locales/zu_ZA.ts +++ b/web/src/i18n/locales/zu_ZA.ts @@ -243,6 +243,8 @@ const translations: VariantResource = { // NOTE: Use defaults for missing transl Plugin_Settings_UrlOverrideInfo: "crwdns2086:0crwdne2086:0", Plugin_Settings_ImageFormat: "crwdns2094:0crwdne2094:0", Plugin_Settings_ImageFormatInfo: "crwdns2096:0crwdne2096:0", + Plugin_Settings_ImageQuality: "", + Plugin_Settings_ImageQualityInfo: "", Plugin_Common_MangaIndex_NotSupported: "crwdns1606:0crwdne1606:0", Plugin_Common_Chapter_UnavailableError: "crwdns1608:0crwdne1608:0", Plugin_Common_Chapter_InvalidError: "crwdns1610:0crwdne1610:0", From e87c02d83b528c788c444decf5ba02b822b62f0d Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 12 Jan 2024 16:15:23 +0100 Subject: [PATCH 06/25] Update zu_ZA.ts --- web/src/i18n/locales/zu_ZA.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/i18n/locales/zu_ZA.ts b/web/src/i18n/locales/zu_ZA.ts index 3238bb5804..eb789cefda 100644 --- a/web/src/i18n/locales/zu_ZA.ts +++ b/web/src/i18n/locales/zu_ZA.ts @@ -245,6 +245,9 @@ const translations: VariantResource = { // NOTE: Use defaults for missing transl Plugin_Settings_ImageFormatInfo: "crwdns2096:0crwdne2096:0", Plugin_Settings_ImageQuality: "", Plugin_Settings_ImageQualityInfo: "", + Plugin_Settings_ImageQuality_High: "", + Plugin_Settings_ImageQuality_Medium: "", + Plugin_Settings_ImageQuality_Low: "", Plugin_Common_MangaIndex_NotSupported: "crwdns1606:0crwdne1606:0", Plugin_Common_Chapter_UnavailableError: "crwdns1608:0crwdne1608:0", Plugin_Common_Chapter_InvalidError: "crwdns1610:0crwdne1610:0", From 5a8a576baa820fea775a0ab4d64b07f4756d2563 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Tue, 16 Jan 2024 14:07:47 +0100 Subject: [PATCH 07/25] improve platform abstraction --- web/src/engine/websites/KanMan.ts | 4 ++-- web/src/engine/websites/decorators/MHKX.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index df61ae03e6..691051442f 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -2,7 +2,7 @@ import { Tags } from '../Tags'; import icon from './KanMan.webp'; import MHKX, { type MHXK_infos } from './decorators/MHKX'; import * as Common from './decorators/Common'; -import { FetchCSS, FetchRequest } from '../FetchProvider'; +import { FetchCSS } from '../platform/FetchProvider'; import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; @Common.ImageAjax(true) @@ -21,7 +21,7 @@ export default class extends MHKX { } public override async FetchManga(provider: MangaPlugin, url: string): Promise { - const [data] = await FetchCSS(new FetchRequest(url), 'h1.title'); + const [data] = await FetchCSS(new Request(url), 'h1.title'); const id: string = url.match(/(\d+)\/$/)[1]; const title = data.textContent.trim(); return new Manga(this, provider, id, title); diff --git a/web/src/engine/websites/decorators/MHKX.ts b/web/src/engine/websites/decorators/MHKX.ts index 3bae953b1a..9b0378a2e3 100644 --- a/web/src/engine/websites/decorators/MHKX.ts +++ b/web/src/engine/websites/decorators/MHKX.ts @@ -2,7 +2,7 @@ import { type Tag } from '../../Tags'; import { Choice } from '../../SettingsManager'; import { EngineResourceKey as E, WebsiteResourceKey as W } from '../../../i18n/ILocale'; import { Chapter, DecoratableMangaScraper, Manga, Page, type MangaPlugin } from '../../providers/MangaPlugin'; -import { FetchCSS, FetchJSON, FetchRequest } from '../../FetchProvider'; +import { FetchCSS, FetchJSON } from '../../platform/FetchProvider'; export type MHXK_infos = { id: string, @@ -59,7 +59,7 @@ export default class extends DecoratableMangaScraper { } public override async FetchManga(provider: MangaPlugin, url: string): Promise { - const [data] = await FetchCSS(new FetchRequest(url), '[data-comic-id], [data-comic_id]'); + const [data] = await FetchCSS(new Request(url), '[data-comic-id], [data-comic_id]'); const id: string = data.dataset.comicId || data.dataset.comic_id; const title = data.textContent.trim(); return new Manga(this, provider, id, title); @@ -67,14 +67,14 @@ export default class extends DecoratableMangaScraper { public override async FetchMangas(provider: MangaPlugin): Promise { const uri = this.createCustomerURI('/getComicList/'); - const { data } = await FetchJSON>(new FetchRequest(uri.href)); + const { data } = await FetchJSON>(new Request(uri.href)); return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); } public override async FetchChapters(manga: Manga): Promise { const uri = this.createCustomerURI('/getComicInfoBody/'); uri.searchParams.set('comic_id', manga.Identifier); - const { data } = await FetchJSON>(new FetchRequest(uri.href)); + const { data } = await FetchJSON>(new Request(uri.href)); return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); } @@ -89,7 +89,7 @@ export default class extends DecoratableMangaScraper { isWebp: this.Settings.format.Value as string, quality: this.Settings.quality.Value as string }).toString(); - const { data } = await FetchJSON>(new FetchRequest(uri.href)); + const { data } = await FetchJSON>(new Request(uri.href)); return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); } From 5351bb8611b2a024092063d7a35368af891fb242 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sat, 3 Feb 2024 16:42:48 +0100 Subject: [PATCH 08/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 65aea1c057..b0fcae064e 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -188,6 +188,7 @@ export { default as Jpmangas } from './Jpmangas'; export { default as KaiScans } from './KaiScans'; export { default as Kakaopage } from './Kakaopage'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -369,6 +370,7 @@ export { default as ManhuaMix } from './ManhuaMix'; export { default as ManhuaPlus } from './ManhuaPlus'; export { default as ManhuaScan } from './ManhuaScan'; export { default as Manhuass } from './Manhuass'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -535,6 +537,7 @@ export { default as Siyahmelek } from './Siyahmelek'; export { default as SkyMangas } from './SkyMangas'; export { default as SMangaVF } from './SMangaVF'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as StickHorse } from './StickHorse'; export { default as Submanga } from './Submanga'; @@ -545,6 +548,7 @@ export { default as Summertoon } from './Summertoon'; export { default as SundayWebry } from './SundayWebry'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapread } from './Tapread'; export { default as TatakaeScan } from './TatakaeScan'; export { default as TCBScans } from './TCBScans'; @@ -666,7 +670,6 @@ export { default as Imgur } from './legacy/Imgur'; export { default as ImiTui } from './legacy/ImiTui'; export { default as JapanRead } from './legacy/JapanRead'; export { default as JokerFansub } from './legacy/JokerFansub'; -export { default as KanMan } from './legacy/KanMan'; export { default as KirishimaFansub } from './legacy/KirishimaFansub'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; @@ -713,7 +716,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as Manmankan } from './legacy/Manmankan'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; @@ -757,10 +759,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as Tapas } from './legacy/Tapas'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; From f9d17829cb671da26168b7a2ff5eee724bcb2fb7 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Mon, 5 Feb 2024 17:33:04 +0100 Subject: [PATCH 09/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 47198eb561..dc338dad37 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -206,6 +206,7 @@ export { default as Jpmangas } from './Jpmangas'; export { default as KaiScans } from './KaiScans'; export { default as Kakaopage } from './Kakaopage'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -401,6 +402,7 @@ export { default as ManhuaPlus } from './ManhuaPlus'; export { default as ManhuaScan } from './ManhuaScan'; export { default as Manhuass } from './Manhuass'; export { default as ManhuaSY } from './ManhuaSY'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -579,6 +581,7 @@ export { default as Siyahmelek } from './Siyahmelek'; export { default as SkyMangas } from './SkyMangas'; export { default as SMangaVF } from './SMangaVF'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as StellarSaber } from './StellarSaber'; export { default as StickHorse } from './StickHorse'; @@ -590,6 +593,7 @@ export { default as Summertoon } from './Summertoon'; export { default as SundayWebry } from './SundayWebry'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapread } from './Tapread'; export { default as TarotScans } from './TarotScans'; export { default as TatakaeScan } from './TatakaeScan'; @@ -720,7 +724,6 @@ export { default as Imgur } from './legacy/Imgur'; export { default as ImiTui } from './legacy/ImiTui'; export { default as JapanRead } from './legacy/JapanRead'; export { default as JokerFansub } from './legacy/JokerFansub'; -export { default as KanMan } from './legacy/KanMan'; export { default as KirishimaFansub } from './legacy/KirishimaFansub'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; @@ -767,7 +770,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as Manmankan } from './legacy/Manmankan'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; @@ -811,10 +813,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as Tapas } from './legacy/Tapas'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; From f66e2e6d24fa610c55b3340085b31d3c3139cd90 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sat, 27 Apr 2024 13:32:29 +0200 Subject: [PATCH 10/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 190e19d91e..c6f61825a2 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -211,6 +211,7 @@ export { default as KadoComi } from './KadoComi'; export { default as KaiScans } from './KaiScans'; export { default as Kakaopage } from './Kakaopage'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -420,6 +421,7 @@ export { default as Manhuaren } from './Manhuaren'; export { default as ManhuaScan } from './ManhuaScan'; export { default as Manhuass } from './Manhuass'; export { default as ManhuaSY } from './ManhuaSY'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -608,6 +610,7 @@ export { default as SixParkbbsWeb } from './SixParkbbsWeb'; export { default as SkyMangas } from './SkyMangas'; export { default as SMangaVF } from './SMangaVF'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as SSSScanlator } from './SSSScanlator'; export { default as StarboundScans } from './StarboundScans'; @@ -622,6 +625,7 @@ export { default as SundayWebry } from './SundayWebry'; export { default as SuryaToon } from './SuryaToon'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapas } from './Tapas'; export { default as Tapread } from './Tapread'; export { default as TarotScans } from './TarotScans'; @@ -761,7 +765,6 @@ export { default as Imgur } from './legacy/Imgur'; export { default as ImiTui } from './legacy/ImiTui'; export { default as JapanRead } from './legacy/JapanRead'; export { default as JokerFansub } from './legacy/JokerFansub'; -export { default as KanMan } from './legacy/KanMan'; export { default as KirishimaFansub } from './legacy/KirishimaFansub'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; @@ -805,7 +808,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as Manmankan } from './legacy/Manmankan'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; @@ -848,10 +850,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; export { default as ToCoronaEx } from './legacy/ToCoronaEx'; From 3615237a058d9a01552cdadfb6eb7c488ce3cd54 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sat, 27 Apr 2024 13:35:56 +0200 Subject: [PATCH 11/25] fix case --- web/src/engine/websites/KanMan.ts | 4 ++-- web/src/engine/websites/ManhuaTai.ts | 4 ++-- web/src/engine/websites/SouDongMan.ts | 4 ++-- web/src/engine/websites/TaoManhua.ts | 4 ++-- web/src/engine/websites/decorators/MHKX.ts | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index 691051442f..0ff9e01405 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -1,6 +1,6 @@ import { Tags } from '../Tags'; import icon from './KanMan.webp'; -import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import MHKX, { type MhkxInfos } from './decorators/MHKX'; import * as Common from './decorators/Common'; import { FetchCSS } from '../platform/FetchProvider'; import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; @@ -8,7 +8,7 @@ import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MHXK_infos = { + const product: MhkxInfos = { id: '1', name: 'kmh', platform: 'pc' diff --git a/web/src/engine/websites/ManhuaTai.ts b/web/src/engine/websites/ManhuaTai.ts index 79b4cc201e..86b185058e 100644 --- a/web/src/engine/websites/ManhuaTai.ts +++ b/web/src/engine/websites/ManhuaTai.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './ManhuaTai.webp'; -import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import MHKX, { type MhkxInfos } from './decorators/MHKX'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MHXK_infos = { + const product: MhkxInfos = { id: '2', name: 'mht', platform: 'pc' diff --git a/web/src/engine/websites/SouDongMan.ts b/web/src/engine/websites/SouDongMan.ts index 6c5b294ba9..b78ae04423 100644 --- a/web/src/engine/websites/SouDongMan.ts +++ b/web/src/engine/websites/SouDongMan.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './SouDongMan.webp'; -import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import MHKX, { type MhkxInfos } from './decorators/MHKX'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MHXK_infos = { + const product: MhkxInfos = { id: '9', name: 'soudm', platform: 'pc' diff --git a/web/src/engine/websites/TaoManhua.ts b/web/src/engine/websites/TaoManhua.ts index ce62268a65..0848d1a7ed 100644 --- a/web/src/engine/websites/TaoManhua.ts +++ b/web/src/engine/websites/TaoManhua.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './TaoManhua.webp'; -import MHKX, { type MHXK_infos } from './decorators/MHKX'; +import MHKX, { type MhkxInfos } from './decorators/MHKX'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MHXK_infos = { + const product: MhkxInfos = { id: '3', name: 'smh', platform: 'pc' diff --git a/web/src/engine/websites/decorators/MHKX.ts b/web/src/engine/websites/decorators/MHKX.ts index 9b0378a2e3..fc60c07a1c 100644 --- a/web/src/engine/websites/decorators/MHKX.ts +++ b/web/src/engine/websites/decorators/MHKX.ts @@ -4,7 +4,7 @@ import { EngineResourceKey as E, WebsiteResourceKey as W } from '../../../i18n/I import { Chapter, DecoratableMangaScraper, Manga, Page, type MangaPlugin } from '../../providers/MangaPlugin'; import { FetchCSS, FetchJSON } from '../../platform/FetchProvider'; -export type MHXK_infos = { +export type MhkxInfos = { id: string, name: string, platform: string @@ -30,9 +30,9 @@ type APIChapter = { } export default class extends DecoratableMangaScraper { - protected product: MHXK_infos; + protected product: MhkxInfos; - public constructor(id: string, title: string, url: string, product: MHXK_infos, ...tags: Tag[]) { + public constructor(id: string, title: string, url: string, product: MhkxInfos, ...tags: Tag[]) { super(id, title, url, ...tags); this.product = product; @@ -66,20 +66,20 @@ export default class extends DecoratableMangaScraper { } public override async FetchMangas(provider: MangaPlugin): Promise { - const uri = this.createCustomerURI('/getComicList/'); + const uri = this.CreateCustomerURI('/getComicList/'); const { data } = await FetchJSON>(new Request(uri.href)); return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); } public override async FetchChapters(manga: Manga): Promise { - const uri = this.createCustomerURI('/getComicInfoBody/'); + const uri = this.CreateCustomerURI('/getComicInfoBody/'); uri.searchParams.set('comic_id', manga.Identifier); const { data } = await FetchJSON>(new Request(uri.href)); return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); } public override async FetchPages(chapter: Chapter): Promise { - const uri = this.createCustomerURI('/getchapterinfov2'); + const uri = this.CreateCustomerURI('/getchapterinfov2'); uri.search = new URLSearchParams({ product_id: this.product.id, productname: this.product.name, @@ -93,7 +93,7 @@ export default class extends DecoratableMangaScraper { return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); } - createCustomerURI(endpoint: string) { + private CreateCustomerURI(endpoint: string) { return new URL('/api' + endpoint, this.URI); } From 6c35bd98b7b83c53ad842318acdd46a594ea4535 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sat, 27 Apr 2024 13:49:31 +0200 Subject: [PATCH 12/25] add some settings translation --- web/src/i18n/locales/en_US.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/i18n/locales/en_US.ts b/web/src/i18n/locales/en_US.ts index 10a5f21b69..89191dbf9c 100644 --- a/web/src/i18n/locales/en_US.ts +++ b/web/src/i18n/locales/en_US.ts @@ -267,6 +267,12 @@ const translations: VariantResource = { Plugin_Settings_ImageFormat: 'Preferred Image Format', Plugin_Settings_ImageFormatInfo: 'Download pictures using this file format if possible', + Plugin_Settings_ImageQuality: 'Image quality', + Plugin_Settings_ImageQualityInfo: 'Download pictures using this quality if possible', + Plugin_Settings_ImageQuality_High: 'High', + Plugin_Settings_ImageQuality_Medium: 'Medium', + Plugin_Settings_ImageQuality_Low: 'Low', + Plugin_Common_MangaIndex_NotSupported: 'Unable to create the content index for this website. Use the Copy & Paste feature to directly access the content of a specific URL!', Plugin_Common_Chapter_UnavailableError: 'The chapter is not available (not purchased/unlocked/public)!', Plugin_Common_Chapter_InvalidError: 'Failed to extract the pages from the chapter content!', From 3617c3ba31e63f099e1399344daa5a0ad5b0bc10 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Tue, 7 May 2024 11:56:48 +0200 Subject: [PATCH 13/25] update tests to use vitest --- web/src/engine/websites/KanMan_e2e.ts | 5 +++-- web/src/engine/websites/ManhuaTai_e2e.ts | 5 +++-- web/src/engine/websites/SouDongMan_e2e.ts | 5 +++-- web/src/engine/websites/TaoManhua_e2e.ts | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/web/src/engine/websites/KanMan_e2e.ts b/web/src/engine/websites/KanMan_e2e.ts index 77e12f5c8d..9994e0871e 100644 --- a/web/src/engine/websites/KanMan_e2e.ts +++ b/web/src/engine/websites/KanMan_e2e.ts @@ -1,4 +1,5 @@ -import { TestFixture } from '../../../test/WebsitesFixture'; +import { describe } from 'vitest'; +import { TestFixture } from '../../../test/WebsitesFixture'; const config = { plugin: { @@ -22,4 +23,4 @@ const config = { }; const fixture = new TestFixture(config); -describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file +describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/ManhuaTai_e2e.ts b/web/src/engine/websites/ManhuaTai_e2e.ts index 61ff1e3658..8cf590fcdd 100644 --- a/web/src/engine/websites/ManhuaTai_e2e.ts +++ b/web/src/engine/websites/ManhuaTai_e2e.ts @@ -1,4 +1,5 @@ -import { TestFixture } from '../../../test/WebsitesFixture'; +import { describe } from 'vitest'; +import { TestFixture } from '../../../test/WebsitesFixture'; const config = { plugin: { @@ -22,4 +23,4 @@ const config = { }; const fixture = new TestFixture(config); -describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file +describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/SouDongMan_e2e.ts b/web/src/engine/websites/SouDongMan_e2e.ts index ea1d6f93ce..2cd815243e 100644 --- a/web/src/engine/websites/SouDongMan_e2e.ts +++ b/web/src/engine/websites/SouDongMan_e2e.ts @@ -1,4 +1,5 @@ -import { TestFixture } from '../../../test/WebsitesFixture'; +import { describe } from 'vitest'; +import { TestFixture } from '../../../test/WebsitesFixture'; const config = { plugin: { @@ -22,4 +23,4 @@ const config = { }; const fixture = new TestFixture(config); -describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file +describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/TaoManhua_e2e.ts b/web/src/engine/websites/TaoManhua_e2e.ts index 8803b2d6da..f0e66e84d0 100644 --- a/web/src/engine/websites/TaoManhua_e2e.ts +++ b/web/src/engine/websites/TaoManhua_e2e.ts @@ -1,4 +1,5 @@ -import { TestFixture } from '../../../test/WebsitesFixture'; +import { describe } from 'vitest'; +import { TestFixture } from '../../../test/WebsitesFixture'; const config = { plugin: { @@ -22,4 +23,4 @@ const config = { }; const fixture = new TestFixture(config); -describe(fixture.Name, () => fixture.AssertWebsite()); \ No newline at end of file +describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file From df71121f05d63b92912f2636af08291ecb6fd1df Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Thu, 9 May 2024 11:09:10 +0200 Subject: [PATCH 14/25] MHKX -> MHXK --- web/src/engine/websites/KanMan.ts | 4 ++-- web/src/engine/websites/ManhuaTai.ts | 4 ++-- web/src/engine/websites/SouDongMan.ts | 4 ++-- web/src/engine/websites/TaoManhua.ts | 4 ++-- web/src/engine/websites/decorators/{MHKX.ts => MHXK.ts} | 6 +++--- web/src/i18n/locales/zu_ZA.ts | 5 ----- 6 files changed, 11 insertions(+), 16 deletions(-) rename web/src/engine/websites/decorators/{MHKX.ts => MHXK.ts} (97%) diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index 0ff9e01405..a19bfaa1e4 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -1,6 +1,6 @@ import { Tags } from '../Tags'; import icon from './KanMan.webp'; -import MHKX, { type MhkxInfos } from './decorators/MHKX'; +import MHKX, { type MhxkInfos } from './decorators/MHXK'; import * as Common from './decorators/Common'; import { FetchCSS } from '../platform/FetchProvider'; import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; @@ -8,7 +8,7 @@ import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MhkxInfos = { + const product: MhxkInfos = { id: '1', name: 'kmh', platform: 'pc' diff --git a/web/src/engine/websites/ManhuaTai.ts b/web/src/engine/websites/ManhuaTai.ts index 86b185058e..60144f98b1 100644 --- a/web/src/engine/websites/ManhuaTai.ts +++ b/web/src/engine/websites/ManhuaTai.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './ManhuaTai.webp'; -import MHKX, { type MhkxInfos } from './decorators/MHKX'; +import MHKX, { type MhxkInfos } from './decorators/MHXK'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MhkxInfos = { + const product: MhxkInfos = { id: '2', name: 'mht', platform: 'pc' diff --git a/web/src/engine/websites/SouDongMan.ts b/web/src/engine/websites/SouDongMan.ts index b78ae04423..d3625486b2 100644 --- a/web/src/engine/websites/SouDongMan.ts +++ b/web/src/engine/websites/SouDongMan.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './SouDongMan.webp'; -import MHKX, { type MhkxInfos } from './decorators/MHKX'; +import MHKX, { type MhxkInfos } from './decorators/MHXK'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MhkxInfos = { + const product: MhxkInfos = { id: '9', name: 'soudm', platform: 'pc' diff --git a/web/src/engine/websites/TaoManhua.ts b/web/src/engine/websites/TaoManhua.ts index 0848d1a7ed..4db400375a 100644 --- a/web/src/engine/websites/TaoManhua.ts +++ b/web/src/engine/websites/TaoManhua.ts @@ -1,12 +1,12 @@ import { Tags } from '../Tags'; import icon from './TaoManhua.webp'; -import MHKX, { type MhkxInfos } from './decorators/MHKX'; +import MHKX, { type MhxkInfos } from './decorators/MHXK'; import * as Common from './decorators/Common'; @Common.ImageAjax(true) export default class extends MHKX { public constructor() { - const product: MhkxInfos = { + const product: MhxkInfos = { id: '3', name: 'smh', platform: 'pc' diff --git a/web/src/engine/websites/decorators/MHKX.ts b/web/src/engine/websites/decorators/MHXK.ts similarity index 97% rename from web/src/engine/websites/decorators/MHKX.ts rename to web/src/engine/websites/decorators/MHXK.ts index fc60c07a1c..a929ad63b0 100644 --- a/web/src/engine/websites/decorators/MHKX.ts +++ b/web/src/engine/websites/decorators/MHXK.ts @@ -4,7 +4,7 @@ import { EngineResourceKey as E, WebsiteResourceKey as W } from '../../../i18n/I import { Chapter, DecoratableMangaScraper, Manga, Page, type MangaPlugin } from '../../providers/MangaPlugin'; import { FetchCSS, FetchJSON } from '../../platform/FetchProvider'; -export type MhkxInfos = { +export type MhxkInfos = { id: string, name: string, platform: string @@ -30,9 +30,9 @@ type APIChapter = { } export default class extends DecoratableMangaScraper { - protected product: MhkxInfos; + protected product: MhxkInfos; - public constructor(id: string, title: string, url: string, product: MhkxInfos, ...tags: Tag[]) { + public constructor(id: string, title: string, url: string, product: MhxkInfos, ...tags: Tag[]) { super(id, title, url, ...tags); this.product = product; diff --git a/web/src/i18n/locales/zu_ZA.ts b/web/src/i18n/locales/zu_ZA.ts index 9d665fe299..273d16ef49 100644 --- a/web/src/i18n/locales/zu_ZA.ts +++ b/web/src/i18n/locales/zu_ZA.ts @@ -250,11 +250,6 @@ const translations: VariantResource = { // NOTE: Use defaults for missing transl Plugin_Settings_UrlOverrideInfo: "crwdns2086:0crwdne2086:0", Plugin_Settings_ImageFormat: "crwdns2094:0crwdne2094:0", Plugin_Settings_ImageFormatInfo: "crwdns2096:0crwdne2096:0", - Plugin_Settings_ImageQuality: "", - Plugin_Settings_ImageQualityInfo: "", - Plugin_Settings_ImageQuality_High: "", - Plugin_Settings_ImageQuality_Medium: "", - Plugin_Settings_ImageQuality_Low: "", Plugin_Common_MangaIndex_NotSupported: "crwdns1606:0crwdne1606:0", Plugin_Common_Chapter_UnavailableError: "crwdns1608:0crwdne1608:0", Plugin_Common_Chapter_InvalidError: "crwdns1610:0crwdne1610:0", From 2e66c1f98735f23714cada779edd7b193ea86aaf Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Thu, 9 May 2024 11:15:54 +0200 Subject: [PATCH 15/25] Update zu_ZA.ts --- web/src/i18n/locales/zu_ZA.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/i18n/locales/zu_ZA.ts b/web/src/i18n/locales/zu_ZA.ts index 273d16ef49..9d665fe299 100644 --- a/web/src/i18n/locales/zu_ZA.ts +++ b/web/src/i18n/locales/zu_ZA.ts @@ -250,6 +250,11 @@ const translations: VariantResource = { // NOTE: Use defaults for missing transl Plugin_Settings_UrlOverrideInfo: "crwdns2086:0crwdne2086:0", Plugin_Settings_ImageFormat: "crwdns2094:0crwdne2094:0", Plugin_Settings_ImageFormatInfo: "crwdns2096:0crwdne2096:0", + Plugin_Settings_ImageQuality: "", + Plugin_Settings_ImageQualityInfo: "", + Plugin_Settings_ImageQuality_High: "", + Plugin_Settings_ImageQuality_Medium: "", + Plugin_Settings_ImageQuality_Low: "", Plugin_Common_MangaIndex_NotSupported: "crwdns1606:0crwdne1606:0", Plugin_Common_Chapter_UnavailableError: "crwdns1608:0crwdne1608:0", Plugin_Common_Chapter_InvalidError: "crwdns1610:0crwdne1610:0", From 2d50b02f0abb19af3e1d37c49c56f65fd4750d1f Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Thu, 9 May 2024 11:23:21 +0200 Subject: [PATCH 16/25] update decorator for new request implementation --- web/src/engine/websites/decorators/MHXK.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/engine/websites/decorators/MHXK.ts b/web/src/engine/websites/decorators/MHXK.ts index a929ad63b0..365468e6b3 100644 --- a/web/src/engine/websites/decorators/MHXK.ts +++ b/web/src/engine/websites/decorators/MHXK.ts @@ -67,14 +67,14 @@ export default class extends DecoratableMangaScraper { public override async FetchMangas(provider: MangaPlugin): Promise { const uri = this.CreateCustomerURI('/getComicList/'); - const { data } = await FetchJSON>(new Request(uri.href)); + const { data } = await FetchJSON>(new Request(uri)); return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); } public override async FetchChapters(manga: Manga): Promise { const uri = this.CreateCustomerURI('/getComicInfoBody/'); uri.searchParams.set('comic_id', manga.Identifier); - const { data } = await FetchJSON>(new Request(uri.href)); + const { data } = await FetchJSON>(new Request(uri)); return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); } @@ -89,7 +89,7 @@ export default class extends DecoratableMangaScraper { isWebp: this.Settings.format.Value as string, quality: this.Settings.quality.Value as string }).toString(); - const { data } = await FetchJSON>(new Request(uri.href)); + const { data } = await FetchJSON>(new Request(uri)); return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); } From 7c5fffb39c5a1f2d159f02d947e7e76d785ddd23 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sun, 28 Jul 2024 20:25:39 +0200 Subject: [PATCH 17/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index fa795067d1..112fa8453a 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -228,6 +228,7 @@ export { default as KaiScans } from './KaiScans'; export { default as Kakaopage } from './Kakaopage'; export { default as KaliScan } from './KaliScan'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -448,6 +449,7 @@ export { default as ManhuaPlus } from './ManhuaPlus'; export { default as Manhuaren } from './Manhuaren'; export { default as Manhuass } from './Manhuass'; export { default as ManhuaSY } from './ManhuaSY'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -647,6 +649,7 @@ export { default as SixParkbbsClub } from './SixParkbbsClub'; export { default as SixParkbbsWeb } from './SixParkbbsWeb'; export { default as SkyMangas } from './SkyMangas'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as SpoilerPlus } from './SpoilerPlus'; export { default as SSSScanlator } from './SSSScanlator'; @@ -661,6 +664,7 @@ export { default as Summertoon } from './Summertoon'; export { default as SundayWebry } from './SundayWebry'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapas } from './Tapas'; export { default as Tapread } from './Tapread'; export { default as TarotScans } from './TarotScans'; @@ -795,7 +799,6 @@ export { default as HoduComics } from './legacy/HoduComics'; export { default as HolyManga } from './legacy/HolyManga'; export { default as ImiTui } from './legacy/ImiTui'; export { default as JokerFansub } from './legacy/JokerFansub'; -export { default as KanMan } from './legacy/KanMan'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; export { default as LectorManga } from './legacy/LectorManga'; @@ -833,7 +836,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as Manmankan } from './legacy/Manmankan'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; @@ -871,10 +873,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; export { default as ToomicsDE } from './legacy/ToomicsDE'; From beae5f6b436ffaedf84fab5885eb1f8ea3f3f341 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Wed, 14 Aug 2024 15:06:15 +0200 Subject: [PATCH 18/25] Update _index.ts --- web/src/engine/websites/_index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index d2870126a8..c89a83033d 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -216,6 +216,7 @@ export { default as KadoComi } from './KadoComi'; export { default as Kakaopage } from './Kakaopage'; export { default as KaliScan } from './KaliScan'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -422,6 +423,7 @@ export { default as ManhuaPlus } from './ManhuaPlus'; export { default as Manhuaren } from './Manhuaren'; export { default as Manhuass } from './Manhuass'; export { default as ManhuaSY } from './ManhuaSY'; +export { default as ManhuaTai } from './ManhuaTai'; export { default as ManhuaUs } from './ManhuaUs'; export { default as Manhwa18 } from './Manhwa18'; export { default as Manhwa18cc } from './Manhwa18cc'; @@ -614,6 +616,7 @@ export { default as SixParkbbsClub } from './SixParkbbsClub'; export { default as SixParkbbsWeb } from './SixParkbbsWeb'; export { default as SkyMangas } from './SkyMangas'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as SpoilerPlus } from './SpoilerPlus'; export { default as SSSScanlator } from './SSSScanlator'; @@ -627,6 +630,7 @@ export { default as Summertoon } from './Summertoon'; export { default as SundayWebry } from './SundayWebry'; export { default as SushiScans } from './SushiScans'; export { default as SweetTimeScan } from './SweetTimeScan'; +export { default as TaoManhua } from './TaoManhua'; export { default as Tapas } from './Tapas'; export { default as Tapread } from './Tapread'; export { default as TarotScans } from './TarotScans'; @@ -755,7 +759,6 @@ export { default as Guoman8 } from './legacy/Guoman8'; export { default as HeavenManga } from './legacy/HeavenManga'; export { default as HoduComics } from './legacy/HoduComics'; export { default as HolyManga } from './legacy/HolyManga'; -export { default as KanMan } from './legacy/KanMan'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; export { default as LectorManga } from './legacy/LectorManga'; @@ -791,7 +794,6 @@ export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; export { default as ManHuaFen } from './legacy/ManHuaFen'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; export { default as MoreNovel } from './legacy/MoreNovel'; @@ -827,10 +829,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; export { default as ToomicsDE } from './legacy/ToomicsDE'; From 75df80391916cc72856e3efc12a7a3ea6cf9a8af Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Fri, 16 Aug 2024 20:23:19 +0200 Subject: [PATCH 19/25] Remove TaoManhua and Manhuatai both redirect to kanman --- web/src/engine/websites/ManhuaTai.ts | 21 ------------------ web/src/engine/websites/ManhuaTai.webp | Bin 1484 -> 0 bytes web/src/engine/websites/ManhuaTai_e2e.ts | 26 ----------------------- web/src/engine/websites/TaoManhua.ts | 21 ------------------ web/src/engine/websites/TaoManhua.webp | Bin 580 -> 0 bytes web/src/engine/websites/TaoManhua_e2e.ts | 26 ----------------------- web/src/engine/websites/_index.ts | 6 ++---- 7 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 web/src/engine/websites/ManhuaTai.ts delete mode 100644 web/src/engine/websites/ManhuaTai.webp delete mode 100644 web/src/engine/websites/ManhuaTai_e2e.ts delete mode 100644 web/src/engine/websites/TaoManhua.ts delete mode 100644 web/src/engine/websites/TaoManhua.webp delete mode 100644 web/src/engine/websites/TaoManhua_e2e.ts diff --git a/web/src/engine/websites/ManhuaTai.ts b/web/src/engine/websites/ManhuaTai.ts deleted file mode 100644 index 60144f98b1..0000000000 --- a/web/src/engine/websites/ManhuaTai.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Tags } from '../Tags'; -import icon from './ManhuaTai.webp'; -import MHKX, { type MhxkInfos } from './decorators/MHXK'; -import * as Common from './decorators/Common'; - -@Common.ImageAjax(true) -export default class extends MHKX { - public constructor() { - const product: MhxkInfos = { - id: '2', - name: 'mht', - platform: 'pc' - }; - - super('manhuatai', `ManhuaTai`, 'https://www.manhuatai.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); - } - - public override get Icon() { - return icon; - } -} \ No newline at end of file diff --git a/web/src/engine/websites/ManhuaTai.webp b/web/src/engine/websites/ManhuaTai.webp deleted file mode 100644 index 98184600c2952024a20e1855c0818d414943be2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1484 zcmV;-1vC0mNk&G*1pok7MM6+kP&il$0000G0000#002J#06|PpNN)lF01croMD#yE zTaqM2wi8)BGfNi*ud@69-z8>RobF1&Vy{>)5fd;0#NSIXv4@$MJOD)__81c+F}aHr zvS2fa;IU$rZ0#Ij0=aEatYOE*#2#USl=jj>(G<8bOk^c}2Qw3xh~3L1STLz%tJ#yP zkn0x0%E|YTwi<{exmPeLY|Y+>k2O_#3)f09m^7bBSQ7v+!M!aY$%)MHmVKj|9W}+J z5Jr=&&uvTuk2b(6oXC5^(m{2!g3GdG->N1X=rv)d*r%;fo>b@$;L<; zGm|r7O{&(=bAnZ)1xW$F7s0Hlq_d_NEFj^$Sd$8LUWp8FQN)_2yP1eICTGmhAoOM_ zBoUl%L~PU>ki@xVGl&J4{0=7Q4=@0N^Co7}-Hj%Ab_>r2d%FMsTd?P{V0da1 z!Bd;S#Gc3i2)Z}9WMV0FXAmpQ&Y(%KrKU5$V1lz|Fbjju%tF8gkyK5Jrn4$74RBe| zn21GOl(6&Fhdd;M9i)bg9r+Q6wsuv z8SW|o3@{kX05M!G2@nZQFlk`8zZgVJOvDT~29pH9V0f$m5C|Z+S@1^<09H^qAT9#{ z0I(1ModGI906+jf(O9NWC?umICK{~i02&Ew0H;SsNVJ+OU3mjZ3180p$NAnpDDOk> zIodGKj?poeaY_9Lghe>DHGZs#s3#=PUte5ir&D?;KfH0na<&tUkOKLFo-jeYm$8h8 z)fCf;a2X@xeoK3L>uDGoM=^Iaj99XUK!NoiLqH-CI&rw$S^@w7{>u=jcpFLJYt{x$ zA*s&>*^AErB+rYHB-^+7wudR_e#1N7D8~rzKk)xG1fB+5)wG;z`o=tx< z=kJA{VTcnR9S&s`d&H?M`a{d^JdztV3e(z>n-g>YlmnT6?e&{d)MTaJ2>>4k%gaR>_PVisxynF?jy!}pJ&-`-}_2(Dl(aF2Ko~lCS z^?cVsWY=MWP8HBmw=x(^+om~fDV*)KulHHkqm0g9BW4oj;^D9oQM55^rj(wkK&?$> zubnUXZrL~|YMYxV(o^r`-r4aBxE4;`2JX)_as-BuvfXj^FrZ1yoD{nE-uDgcPdBoc zAiZ)SqWeoAa?hwbAZl#lfD&_}=R;_8e9TCF5Z>blHuYVUwFQ683>iUr5s;<%&42hA zL|cSHz{+#0@I`*qxdLV$kv_Mf;lqZxugYH?C8TZWWB8;#ML`jq03XqDq0+GA$d<+7 zK3!5(F1WXoU#i9OFsuC{d(r-0Gvgmx#WP^pbX|Swi}l}y>w+^ZV%XG$Adw6R3}p&X zcaQ7=C|-h7lYZ**zWdwEdbF%+2x@KjcSHS;5GzrrW~vt~U zj7m8Dncxv(pIb3yrts3Fy}X~h`t|qz==blhyPZ0H94@SvH (await fixture.Connect()).AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/TaoManhua.ts b/web/src/engine/websites/TaoManhua.ts deleted file mode 100644 index 4db400375a..0000000000 --- a/web/src/engine/websites/TaoManhua.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Tags } from '../Tags'; -import icon from './TaoManhua.webp'; -import MHKX, { type MhxkInfos } from './decorators/MHXK'; -import * as Common from './decorators/Common'; - -@Common.ImageAjax(true) -export default class extends MHKX { - public constructor() { - const product: MhxkInfos = { - id: '3', - name: 'smh', - platform: 'pc' - }; - - super('taomanhua', `神漫画 (Tao Manhua)`, 'https://www.taomanhua.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); - } - - public override get Icon() { - return icon; - } -} \ No newline at end of file diff --git a/web/src/engine/websites/TaoManhua.webp b/web/src/engine/websites/TaoManhua.webp deleted file mode 100644 index ce85d65085fc566fa03002c868d13dc2abfc2b99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 580 zcmV-K0=xZENk&FI0ssJ4MM6+kP&gnk0ssJT4gj42DnI~006x)PrcbCOqarF3Ixzqm z31k4h{X^EBa*nAZP4;;x~=V!cZTN!pRdjppnaA+XphXi!&YoGE23R0~m3kGx{N@siv6Q zo7Ilo-jw7tKpN6a_AAAj+n^bEgMC^9>n14bD^!Ts+}@faRpR#iqyb!*VXojmEs0Pv z(!y33@VN}6p2=N*B_ftcx0tSO>V_Tr&OLTC2@n84eR?9|a4lKuJ3FO~5+H{}9;5e`_aI1#3h{-X_HYkm_ SL+LJHU)Gi(e;V*I0001oKM`^O diff --git a/web/src/engine/websites/TaoManhua_e2e.ts b/web/src/engine/websites/TaoManhua_e2e.ts deleted file mode 100644 index f0e66e84d0..0000000000 --- a/web/src/engine/websites/TaoManhua_e2e.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { describe } from 'vitest'; -import { TestFixture } from '../../../test/WebsitesFixture'; - -const config = { - plugin: { - id: 'taomanhua', - title: '神漫画 (Tao Manhua)' - }, - container: { - url: 'https://www.taomanhua.com/bosschaoqiangdansongdeyaosi/', - id: '108924', - title: '离谱,你管这叫骷髅兵?' - }, - child: { - id: 'renshedangan-1663207710', - title: '人设档案' - }, - entry: { - index: 0, - size: 217_488, - type: 'image/webp' - } -}; - -const fixture = new TestFixture(config); -describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 03fdf40e7b..7dfa83785e 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -215,6 +215,7 @@ export { default as KadoComi } from './KadoComi'; export { default as Kakaopage } from './Kakaopage'; export { default as KaliScan } from './KaliScan'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -612,6 +613,7 @@ export { default as SixParkbbsClub } from './SixParkbbsClub'; export { default as SixParkbbsWeb } from './SixParkbbsWeb'; export { default as SkyMangas } from './SkyMangas'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as SpoilerPlus } from './SpoilerPlus'; export { default as SSSScanlator } from './SSSScanlator'; @@ -754,7 +756,6 @@ export { default as Guoman8 } from './legacy/Guoman8'; export { default as HeavenManga } from './legacy/HeavenManga'; export { default as HoduComics } from './legacy/HoduComics'; export { default as HolyManga } from './legacy/HolyManga'; -export { default as KanMan } from './legacy/KanMan'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; export { default as LectorManga } from './legacy/LectorManga'; @@ -788,7 +789,6 @@ export { default as MangaToonVI } from './legacy/MangaToonVI'; export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; export { default as ManHua1359 } from './legacy/ManHua1359'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; export { default as MoreNovel } from './legacy/MoreNovel'; @@ -824,10 +824,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; export { default as ToomicsDE } from './legacy/ToomicsDE'; From 4bce8f395c125463e44fd32067c57d05c99531d3 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sun, 8 Sep 2024 15:21:34 +0200 Subject: [PATCH 20/25] Update _index.ts --- web/src/engine/websites/_index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/engine/websites/_index.ts b/web/src/engine/websites/_index.ts index 6498050082..edd7d4d062 100755 --- a/web/src/engine/websites/_index.ts +++ b/web/src/engine/websites/_index.ts @@ -219,6 +219,7 @@ export { default as KadoComi } from './KadoComi'; export { default as Kakaopage } from './Kakaopage'; export { default as KaliScan } from './KaliScan'; export { default as Kanjiku } from './Kanjiku'; +export { default as KanMan } from './KanMan'; export { default as Kanzenin } from './Kanzenin'; export { default as Katakomik } from './Katakomik'; export { default as KingOfManga } from './KingOfManga'; @@ -620,6 +621,7 @@ export { default as SixParkbbsClub } from './SixParkbbsClub'; export { default as SixParkbbsWeb } from './SixParkbbsWeb'; export { default as SkyMangas } from './SkyMangas'; export { default as SoftKomik } from './SoftKomik'; +export { default as SouDongMan } from './SouDongMan'; export { default as SoulScans } from './SoulScans'; export { default as SpoilerPlus } from './SpoilerPlus'; export { default as SSSScanlator } from './SSSScanlator'; @@ -762,7 +764,6 @@ export { default as Guoman8 } from './legacy/Guoman8'; export { default as HeavenManga } from './legacy/HeavenManga'; export { default as HoduComics } from './legacy/HoduComics'; export { default as HolyManga } from './legacy/HolyManga'; -export { default as KanMan } from './legacy/KanMan'; export { default as KissAway } from './legacy/KissAway'; export { default as kuman5 } from './legacy/kuman5'; export { default as LectorManga } from './legacy/LectorManga'; @@ -795,7 +796,6 @@ export { default as MangaToonTH } from './legacy/MangaToonTH'; export { default as MangaToonVI } from './legacy/MangaToonVI'; export { default as MangaTR } from './legacy/MangaTR'; export { default as MangaZukiRAWS } from './legacy/MangaZukiRAWS'; -export { default as ManhuaTai } from './legacy/ManhuaTai'; export { default as MeioNovel } from './legacy/MeioNovel'; export { default as MintManga } from './legacy/MintManga'; export { default as MoreNovel } from './legacy/MoreNovel'; @@ -830,10 +830,8 @@ export { default as SelfManga } from './legacy/SelfManga'; export { default as ShinobiScans } from './legacy/ShinobiScans'; export { default as SixMH7 } from './legacy/SixMH7'; export { default as SleepyTranslations } from './legacy/SleepyTranslations'; -export { default as SouDongMan } from './legacy/SouDongMan'; export { default as StoriaDash } from './legacy/StoriaDash'; export { default as TAADD } from './legacy/TAADD'; -export { default as TaoManhua } from './legacy/TaoManhua'; export { default as TencentComic } from './legacy/TencentComic'; export { default as TenManga } from './legacy/TenManga'; export { default as ToomicsDE } from './legacy/ToomicsDE'; From 2afacb78fecd8483b358532aa02c83dd17b3e2a5 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sun, 8 Sep 2024 15:22:53 +0200 Subject: [PATCH 21/25] Update zu_ZA.ts --- web/src/i18n/locales/zu_ZA.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web/src/i18n/locales/zu_ZA.ts b/web/src/i18n/locales/zu_ZA.ts index dcad33c6f5..8063d32d09 100644 --- a/web/src/i18n/locales/zu_ZA.ts +++ b/web/src/i18n/locales/zu_ZA.ts @@ -277,11 +277,6 @@ const translations: VariantResource = { // NOTE: Use defaults for missing transl Plugin_Settings_UrlOverrideInfo: "crwdns2086:0crwdne2086:0", Plugin_Settings_ImageFormat: "crwdns2094:0crwdne2094:0", Plugin_Settings_ImageFormatInfo: "crwdns2096:0crwdne2096:0", - Plugin_Settings_ImageQuality: "", - Plugin_Settings_ImageQualityInfo: "", - Plugin_Settings_ImageQuality_High: "", - Plugin_Settings_ImageQuality_Medium: "", - Plugin_Settings_ImageQuality_Low: "", Plugin_Common_MangaIndex_NotSupported: "crwdns1606:0crwdne1606:0", Plugin_Common_Chapter_UnavailableError: "crwdns1608:0crwdne1608:0", Plugin_Common_Chapter_InvalidError: "crwdns1610:0crwdne1610:0", From dfdc70b107e41e73074a3c71d5bb0207e9c48285 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sun, 27 Oct 2024 10:48:39 +0100 Subject: [PATCH 22/25] update tests --- web/src/engine/websites/KanMan_e2e.ts | 4 +--- web/src/engine/websites/SouDongMan_e2e.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/web/src/engine/websites/KanMan_e2e.ts b/web/src/engine/websites/KanMan_e2e.ts index 9994e0871e..b310a3b33c 100644 --- a/web/src/engine/websites/KanMan_e2e.ts +++ b/web/src/engine/websites/KanMan_e2e.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { TestFixture } from '../../../test/WebsitesFixture'; const config = { @@ -22,5 +21,4 @@ const config = { } }; -const fixture = new TestFixture(config); -describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file +new TestFixture(config).AssertWebsite(); \ No newline at end of file diff --git a/web/src/engine/websites/SouDongMan_e2e.ts b/web/src/engine/websites/SouDongMan_e2e.ts index 2cd815243e..0a33b31ce6 100644 --- a/web/src/engine/websites/SouDongMan_e2e.ts +++ b/web/src/engine/websites/SouDongMan_e2e.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { TestFixture } from '../../../test/WebsitesFixture'; const config = { @@ -22,5 +21,4 @@ const config = { } }; -const fixture = new TestFixture(config); -describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); \ No newline at end of file +new TestFixture(config).AssertWebsite(); \ No newline at end of file From f1a07dbbbed6207b6cefd91d5386bb2e63811e14 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Sat, 2 Nov 2024 15:14:55 +0100 Subject: [PATCH 23/25] remove soudongman and only add Kanman soudongman mangas redirect to kanman. --- web/src/engine/websites/KanMan.ts | 90 ++++++++++++++++--- web/src/engine/websites/KanMan_e2e.ts | 14 +-- web/src/engine/websites/SouDongMan.ts | 21 ----- web/src/engine/websites/SouDongMan.webp | Bin 624 -> 0 bytes web/src/engine/websites/SouDongMan_e2e.ts | 24 ----- web/src/engine/websites/_index.ts | 1 - web/src/engine/websites/decorators/MHXK.ts | 100 --------------------- 7 files changed, 87 insertions(+), 163 deletions(-) delete mode 100644 web/src/engine/websites/SouDongMan.ts delete mode 100644 web/src/engine/websites/SouDongMan.webp delete mode 100644 web/src/engine/websites/SouDongMan_e2e.ts delete mode 100644 web/src/engine/websites/decorators/MHXK.ts diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index a19bfaa1e4..d748bfa835 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -1,20 +1,56 @@ import { Tags } from '../Tags'; import icon from './KanMan.webp'; -import MHKX, { type MhxkInfos } from './decorators/MHXK'; import * as Common from './decorators/Common'; -import { FetchCSS } from '../platform/FetchProvider'; -import { Manga, type MangaPlugin } from '../providers/MangaPlugin'; +import { FetchCSS, FetchJSON } from '../platform/FetchProvider'; +import { Chapter, DecoratableMangaScraper, Manga, Page, type MangaPlugin } from '../providers/MangaPlugin'; +import { Choice } from '../SettingsManager'; +import { EngineResourceKey as E, WebsiteResourceKey as W } from '../../i18n/ILocale'; + +type APIResult = { + data: T, + status: number, + message: string; +} + +type APIManga = { + comic_id: number, + comic_name: string + comic_chapter: APIChapter[] + current_chapter: APIChapter +} + +type APIChapter = { + chapter_name: string, + chapter_newid: string + chapter_img_list: string[] +} @Common.ImageAjax(true) -export default class extends MHKX { +export default class extends DecoratableMangaScraper { + private readonly product = { + id: '1', + name: 'kmh', + platform: 'pc' + }; public constructor() { - const product: MhxkInfos = { - id: '1', - name: 'kmh', - platform: 'pc' - }; + super('kanman', `看漫画 (KanMan)`, 'https://www.kanman.com', Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + + this.Settings.format = new Choice('image.format', + W.Plugin_Settings_ImageFormat, + W.Plugin_Settings_ImageFormatInfo, + '1', + { key: '0', label: E.Settings_Global_Format_JPEG }, + { key: '1', label: E.Settings_Global_Format_WEBP }, + ); - super('kanman', `看漫画 (KanMan)`, 'https://www.kanman.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); + this.Settings.quality = new Choice('image.quality', + W.Plugin_Settings_ImageQuality, + W.Plugin_Settings_ImageQualityInfo, + 'high', + { key: 'high', label: W.Plugin_Settings_ImageQuality_High }, + { key: 'middle', label: W.Plugin_Settings_ImageQuality_Medium }, + { key: 'low', label: W.Plugin_Settings_ImageQuality_Low }, + ); } public override get Icon() { return icon; @@ -26,4 +62,38 @@ export default class extends MHKX { const title = data.textContent.trim(); return new Manga(this, provider, id, title); } + public override ValidateMangaURL(url: string): boolean { + return new RegExp(`^${this.URI.origin}/[^/]+/$`).test(url); + } + + public override async FetchMangas(provider: MangaPlugin): Promise { + const { data } = await FetchJSON>(new Request(this.CreateCustomerURI('/getComicList/'))); + return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); + } + + public override async FetchChapters(manga: Manga): Promise { + const uri = this.CreateCustomerURI('/getComicInfoBody/'); + uri.searchParams.set('comic_id', manga.Identifier); + const { data } = await FetchJSON>(new Request(uri)); + return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); + } + + public override async FetchPages(chapter: Chapter): Promise { + const uri = this.CreateCustomerURI('/getchapterinfov2'); + uri.search = new URLSearchParams({ + product_id: this.product.id, + productname: this.product.name, + platformname: this.product.platform, + comic_id: chapter.Parent.Identifier, + chapter_newid: chapter.Identifier, + isWebp: this.Settings.format.Value as string, + quality: this.Settings.quality.Value as string + }).toString(); + const { data } = await FetchJSON>(new Request(uri)); + return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); + } + + private CreateCustomerURI(endpoint: string) { + return new URL('/api' + endpoint, this.URI); + } } \ No newline at end of file diff --git a/web/src/engine/websites/KanMan_e2e.ts b/web/src/engine/websites/KanMan_e2e.ts index b310a3b33c..a33dfb4735 100644 --- a/web/src/engine/websites/KanMan_e2e.ts +++ b/web/src/engine/websites/KanMan_e2e.ts @@ -6,17 +6,17 @@ const config = { title: '看漫画 (KanMan)' }, container: { - url: 'https://www.kanman.com/108632/', - id: '108632', - title: '龙腾战尊' + url: 'https://www.kanman.com/17745/', + id: '17745', + title: '凤逆天下' }, child: { - id: 'yugao-1624325650020', - title: '预告' + id: '1004', + title: '第1话 神秘的黑玉1' }, entry: { - index: 0, - size: 185_594, + index: 3, + size: 246_994, type: 'image/webp' } }; diff --git a/web/src/engine/websites/SouDongMan.ts b/web/src/engine/websites/SouDongMan.ts deleted file mode 100644 index d3625486b2..0000000000 --- a/web/src/engine/websites/SouDongMan.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Tags } from '../Tags'; -import icon from './SouDongMan.webp'; -import MHKX, { type MhxkInfos } from './decorators/MHXK'; -import * as Common from './decorators/Common'; - -@Common.ImageAjax(true) -export default class extends MHKX { - public constructor() { - const product: MhxkInfos = { - id: '9', - name: 'soudm', - platform: 'pc' - }; - - super('soudongman', `斗罗大陆 (SouDongMan)`, 'https://www.soudongman.com', product, Tags.Media.Manhua, Tags.Language.Chinese, Tags.Source.Official); - } - - public override get Icon() { - return icon; - } -} \ No newline at end of file diff --git a/web/src/engine/websites/SouDongMan.webp b/web/src/engine/websites/SouDongMan.webp deleted file mode 100644 index 976e8aa456afd4be3e654ad2216c706e1289566c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 624 zcmV-$0+0PtNk&F!0ssJ4MM6+kP&go50ssII5CEM4DnI~006xi1pi8HuBO$Z+4N&kI z32XqZp#V9)v>%Z3C%SgP3HINQFc|Jli!H=(=DtF4GO^IcrR%jAuUZV%k6+LC#<6z$ zEVP#>W=(|@tCW9>5h2P88xh<;rKNB$p_Urmh`RSR2YNjn&GJ1qd4w#NVaq))UrFXi|2&!=3HFM&bRUR4K_Qd zFA2k5c4qq&eJVLoC69h)0_;B(HWYGT8yUCMG=MACbA-5_)qm;r{P$?Kw6OhQGh~x6 ziK|IhnpY+~#&MrnUJNbL%6AUK9Aku>Sx2Su-@dSldNH8D7^fF}dj(u+^PD@x1LJVk z>68Wp0{SK?h`(2vX^i%^2>?r7mvE-!(uFLu3~v4noJB5YNSR>WW5SztcCrC+9IbaJ zb)p^VGgX!jrm4+qtmq}?Rwm&bo55GDo#Ue-#h`b7sf1%6yXpeEUB}KmrV^)|V+_#y zQ16Dlff2p4>{-O@$Z$<4Z53PVNR?Yn0kWuKti=K5AuN3cmHQ&FaQLVu)kTyJjavD* z=3y9g4V6kmlX1+!&8+pdFGD%ym0`P1fJ4{^r}5_YT0c%z>=}`WPitX!$=wi+cnu_B za%qcGbgpa3iZ%Sf)qF>6&M6BOfiQ&sl!L7B = { - data: T, - status: number, - message: string; -} - -type APIManga = { - comic_id: number, - comic_name: string - comic_chapter: APIChapter[] - current_chapter: APIChapter -} - -type APIChapter = { - chapter_name: string, - chapter_newid: string - chapter_img_list: string[] -} - -export default class extends DecoratableMangaScraper { - protected product: MhxkInfos; - - public constructor(id: string, title: string, url: string, product: MhxkInfos, ...tags: Tag[]) { - super(id, title, url, ...tags); - this.product = product; - - this.Settings.format = new Choice('image.format', - W.Plugin_Settings_ImageFormat, - W.Plugin_Settings_ImageFormatInfo, - '1', - { key: '0', label: E.Settings_Global_Format_JPEG }, - { key: '1', label: E.Settings_Global_Format_WEBP }, - ); - - this.Settings.quality = new Choice('image.quality', - W.Plugin_Settings_ImageQuality, - W.Plugin_Settings_ImageQualityInfo, - 'high', - { key: 'high', label: W.Plugin_Settings_ImageQuality_High }, - { key: 'middle', label: W.Plugin_Settings_ImageQuality_Medium }, - { key: 'low', label: W.Plugin_Settings_ImageQuality_Low }, - ); - } - - public override ValidateMangaURL(url: string): boolean { - return new RegExp(`^${this.URI.origin}/[^/]+/$`).test(url); - } - - public override async FetchManga(provider: MangaPlugin, url: string): Promise { - const [data] = await FetchCSS(new Request(url), '[data-comic-id], [data-comic_id]'); - const id: string = data.dataset.comicId || data.dataset.comic_id; - const title = data.textContent.trim(); - return new Manga(this, provider, id, title); - } - - public override async FetchMangas(provider: MangaPlugin): Promise { - const uri = this.CreateCustomerURI('/getComicList/'); - const { data } = await FetchJSON>(new Request(uri)); - return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); - } - - public override async FetchChapters(manga: Manga): Promise { - const uri = this.CreateCustomerURI('/getComicInfoBody/'); - uri.searchParams.set('comic_id', manga.Identifier); - const { data } = await FetchJSON>(new Request(uri)); - return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); - } - - public override async FetchPages(chapter: Chapter): Promise { - const uri = this.CreateCustomerURI('/getchapterinfov2'); - uri.search = new URLSearchParams({ - product_id: this.product.id, - productname: this.product.name, - platformname: this.product.platform, - comic_id: chapter.Parent.Identifier, - chapter_newid: chapter.Identifier, - isWebp: this.Settings.format.Value as string, - quality: this.Settings.quality.Value as string - }).toString(); - const { data } = await FetchJSON>(new Request(uri)); - return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); - } - - private CreateCustomerURI(endpoint: string) { - return new URL('/api' + endpoint, this.URI); - } - -} From ccf5c47a9e0e1343235929c871314a6a15ef88ea Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Thu, 7 Nov 2024 10:52:10 +0100 Subject: [PATCH 24/25] Update KanMan.ts --- web/src/engine/websites/KanMan.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index d748bfa835..8f7be689a9 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -58,9 +58,7 @@ export default class extends DecoratableMangaScraper { public override async FetchManga(provider: MangaPlugin, url: string): Promise { const [data] = await FetchCSS(new Request(url), 'h1.title'); - const id: string = url.match(/(\d+)\/$/)[1]; - const title = data.textContent.trim(); - return new Manga(this, provider, id, title); + return new Manga(this, provider, url.match(/(\d+)\/$/)[1], data.textContent.trim()); } public override ValidateMangaURL(url: string): boolean { return new RegExp(`^${this.URI.origin}/[^/]+/$`).test(url); @@ -74,8 +72,8 @@ export default class extends DecoratableMangaScraper { public override async FetchChapters(manga: Manga): Promise { const uri = this.CreateCustomerURI('/getComicInfoBody/'); uri.searchParams.set('comic_id', manga.Identifier); - const { data } = await FetchJSON>(new Request(uri)); - return data.comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); + const { data: { comic_chapter } } = await FetchJSON>(new Request(uri)); + return comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); } public override async FetchPages(chapter: Chapter): Promise { @@ -89,8 +87,8 @@ export default class extends DecoratableMangaScraper { isWebp: this.Settings.format.Value as string, quality: this.Settings.quality.Value as string }).toString(); - const { data } = await FetchJSON>(new Request(uri)); - return data.current_chapter.chapter_img_list.map(page => new Page(this, chapter, new URL(page))); + const { data: { current_chapter: { chapter_img_list } } } = await FetchJSON>(new Request(uri)); + return chapter_img_list.map(page => new Page(this, chapter, new URL(page))); } private CreateCustomerURI(endpoint: string) { From d666128bed0b2543329e52b19adcce7bf2aabe62 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Mon, 9 Dec 2024 14:05:33 +0100 Subject: [PATCH 25/25] Update KanMan.ts --- web/src/engine/websites/KanMan.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web/src/engine/websites/KanMan.ts b/web/src/engine/websites/KanMan.ts index 8f7be689a9..95cda509b0 100644 --- a/web/src/engine/websites/KanMan.ts +++ b/web/src/engine/websites/KanMan.ts @@ -27,6 +27,7 @@ type APIChapter = { @Common.ImageAjax(true) export default class extends DecoratableMangaScraper { + private readonly apiUrl = 'https://www.kanman.com/api/'; private readonly product = { id: '1', name: 'kmh', @@ -65,19 +66,18 @@ export default class extends DecoratableMangaScraper { } public override async FetchMangas(provider: MangaPlugin): Promise { - const { data } = await FetchJSON>(new Request(this.CreateCustomerURI('/getComicList/'))); + const { data } = await FetchJSON>(new Request(new URL('getComicList', this.apiUrl))); return data.map(manga => new Manga(this, provider, manga.comic_id.toString(), manga.comic_name.trim())); } public override async FetchChapters(manga: Manga): Promise { - const uri = this.CreateCustomerURI('/getComicInfoBody/'); - uri.searchParams.set('comic_id', manga.Identifier); + const uri = new URL(`getComicInfoBody?comic_id=${manga.Identifier}`, this.apiUrl); const { data: { comic_chapter } } = await FetchJSON>(new Request(uri)); return comic_chapter.map(chapter => new Chapter(this, manga, chapter.chapter_newid, chapter.chapter_name.trim())); } public override async FetchPages(chapter: Chapter): Promise { - const uri = this.CreateCustomerURI('/getchapterinfov2'); + const uri = new URL('getchapterinfov2', this.apiUrl); uri.search = new URLSearchParams({ product_id: this.product.id, productname: this.product.name, @@ -90,8 +90,4 @@ export default class extends DecoratableMangaScraper { const { data: { current_chapter: { chapter_img_list } } } = await FetchJSON>(new Request(uri)); return chapter_img_list.map(page => new Page(this, chapter, new URL(page))); } - - private CreateCustomerURI(endpoint: string) { - return new URL('/api' + endpoint, this.URI); - } } \ No newline at end of file