Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MojoPortalComic template & websites #470

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
06e3926
Add MoJoPortalcomic Decorators
MikeZeDev Oct 27, 2023
e48fc65
Merge branch 'master' into mojo
MikeZeDev Oct 29, 2023
60695d7
Merge branch 'master' into mojo
MikeZeDev Nov 2, 2023
2e19cfa
Update _index.ts
MikeZeDev Nov 2, 2023
46eeca2
url override for NetTruyen
MikeZeDev Nov 7, 2023
26b2e72
Merge branch 'master' into mojo
MikeZeDev Nov 7, 2023
904632d
Merge branch 'master' into mojo
MikeZeDev Nov 12, 2023
98eedd8
use origin placeholder
MikeZeDev Nov 12, 2023
e9a73cb
add ProTruyen (ex TruyenTranhOnline)
MikeZeDev Nov 14, 2023
522e9d8
setting to lowercase
MikeZeDev Nov 22, 2023
d9e8425
Update NetTruyen.ts
MikeZeDev Dec 9, 2023
a0a06f6
Update NhatTruyen.ts
MikeZeDev Dec 9, 2023
21417b8
Merge branch 'master' into mojo
MikeZeDev Dec 21, 2023
efc3981
update converter
MikeZeDev Dec 21, 2023
2882e3c
Protruyen : update icon & add test
MikeZeDev Dec 21, 2023
c3d8278
update from master
MikeZeDev Jan 5, 2024
d0c8a26
Merge branch 'master' into mojo
MikeZeDev Jan 16, 2024
8a4fb87
comment urloverride for now
MikeZeDev Jan 16, 2024
51c407d
add tests & change domains
MikeZeDev Jan 23, 2024
3349e12
remove protruyen
MikeZeDev Jan 23, 2024
a34f5fe
Update BookmarkConverter_test.ts
MikeZeDev Jan 23, 2024
cb616cb
Update _index.ts
MikeZeDev Jan 23, 2024
c195b16
Merge branch 'master' into mojo
MikeZeDev Feb 3, 2024
3b406db
Update _index.ts
MikeZeDev Feb 3, 2024
c490825
Merge branch 'master' into mojo
MikeZeDev Feb 5, 2024
9ee9588
Update _index.ts
MikeZeDev Feb 5, 2024
b265334
Nettruyen : change url
MikeZeDev Feb 26, 2024
db4ebe6
Merge branch 'master' into mojo
MikeZeDev Feb 26, 2024
5bcbfbf
Update _index.ts
MikeZeDev Feb 26, 2024
c1efe82
Update MojoPortalComic.ts
MikeZeDev Mar 9, 2024
92ffb7d
nettruyen change domain again
MikeZeDev Mar 17, 2024
4f966d8
Lxhentai : change domain
MikeZeDev Mar 21, 2024
edb2465
Merge branch 'master' into mojo
MikeZeDev Mar 21, 2024
953730b
Merge branch 'master' into mojo
MikeZeDev Mar 23, 2024
64cd881
Merge branch 'master' into mojo
MikeZeDev Apr 3, 2024
79062ff
lxhentai : domain change
MikeZeDev Apr 3, 2024
39f9bf6
Mangasect : now uses MojoPortal
MikeZeDev Apr 4, 2024
d7518ea
Merge branch 'master' into mojo
MikeZeDev Apr 23, 2024
a9f4d84
Merge branch 'master' into mojo
MikeZeDev Apr 27, 2024
7b1b8bd
remove empty lines
MikeZeDev Apr 27, 2024
95a60b1
NetTruyen change domain
MikeZeDev Apr 27, 2024
82e9a5b
lxhentai change domain
MikeZeDev May 2, 2024
2f114b7
chant Nhattruyen domain
MikeZeDev May 4, 2024
a73a79b
Merge branch 'master' into mojo
MikeZeDev May 7, 2024
0e3de57
update tests to use vitest
MikeZeDev May 7, 2024
7096868
Remove NetTruyen
MikeZeDev May 26, 2024
3121b95
LXHentai : change domain
MikeZeDev May 26, 2024
f39f926
Merge branch 'master' into mojo
MikeZeDev Jun 9, 2024
d09aa4d
LxHentai : change domain
MikeZeDev Jun 9, 2024
1399643
Merge branch 'master' into mojo
MikeZeDev Jul 11, 2024
e9253f5
Update _index.ts
MikeZeDev Jul 11, 2024
b0fb1af
Merge branch 'master' into mojo
MikeZeDev Jul 25, 2024
87bad91
Update _index.ts
MikeZeDev Jul 25, 2024
30cb7e3
Nhattruyen: change domain
MikeZeDev Jul 25, 2024
7d268ef
Merge branch 'master' into mojo
MikeZeDev Jul 28, 2024
74619d2
Merge branch 'master' into mojo
MikeZeDev Aug 14, 2024
3cc7b6e
Update _index.ts
MikeZeDev Aug 14, 2024
c1e197a
Merge branch 'master' into mojo
MikeZeDev Aug 16, 2024
e9d38aa
add TruyenTranhOnline back
MikeZeDev Aug 16, 2024
4f19234
Merge branch 'master' into mojo
MikeZeDev Aug 16, 2024
e8825a5
Merge branch 'master' into mojo
MikeZeDev Sep 9, 2024
fcedac3
Lxhentai : change domain and pages selector
MikeZeDev Sep 22, 2024
6b26d20
Merge branch 'master' into mojo
MikeZeDev Oct 6, 2024
3d41ab4
LxHentai : change domain
MikeZeDev Oct 6, 2024
8333f74
Merge branch 'master' into mojo
MikeZeDev Oct 7, 2024
190efc6
Merge branch 'master' into mojo
MikeZeDev Oct 13, 2024
bb78200
Merge branch 'master' into mojo
MikeZeDev Oct 27, 2024
3b64c4e
update tests
MikeZeDev Oct 27, 2024
7144a64
Merge branch 'master' into mojo
MikeZeDev Nov 3, 2024
91428b1
change from decorator to base class
MikeZeDev Nov 3, 2024
86e4551
remove useless constructor
MikeZeDev Nov 5, 2024
87543c4
update domain
MikeZeDev Nov 14, 2024
6bc758f
Merge branch 'master' into mojo
MikeZeDev Nov 22, 2024
2e81bab
update domain
MikeZeDev Nov 22, 2024
1d81f76
Merge branch 'master' into mojo
MikeZeDev Nov 22, 2024
2da4fb6
Merge branch 'master' into mojo
MikeZeDev Nov 23, 2024
25c9f8c
Merge branch 'master' into mojo
MikeZeDev Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions web/src/engine/websites/LxHentai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Tags } from '../Tags';
import icon from './LxHentai.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Common from './decorators/Common';
import { PageExtractor } from './templates/MojoPortalComic';

function ChapterExtractor(anchor: HTMLAnchorElement) {
return {
id: anchor.pathname,
title: anchor.querySelector('span.text-ellipsis').textContent.trim()
};
}

@Common.MangaCSS(/^{origin}\/truyen\/[^/]+/, 'ol li div.flex.items-center span')
@Common.MangasMultiPageCSS('/danh-sach?page={page}', 'div.w-full.relative div.p-2.w-full.truncate a.text-ellipsis')
@Common.ChaptersSinglePageCSS('div.justify-between ul.overflow-y-auto a', ChapterExtractor)
@Common.PagesSinglePageCSS('div#image-container.lazy', PageExtractor)
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('lxhentai', `LxHentai (Hentai LXX)`, 'https://lxmanga.store', Tags.Language.Vietnamese, Tags.Media.Manga, Tags.Rating.Pornographic, Tags.Source.Aggregator);
}

public override get Icon() {
return icon;
}
}
Binary file added web/src/engine/websites/LxHentai.webp
Binary file not shown.
25 changes: 25 additions & 0 deletions web/src/engine/websites/LxHentai_e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { TestFixture } from '../../../test/WebsitesFixture';

const config = {
plugin: {
id: 'lxhentai',
title: 'LxHentai (Hentai LXX)'
},
container: {
url: 'https://lxmanga.store/truyen/nu-than-ke-ben',
id: '/truyen/nu-than-ke-ben',
title: 'Nữ thần kế bên'
},
child: {
id: '/truyen/nu-than-ke-ben/chapter-65',
title: 'Chapter 65'
},
entry: {
index: 0,
size: 751_307,
type: 'image/jpeg',
timeout: 10000
}
};

new TestFixture(config).AssertWebsite();
22 changes: 22 additions & 0 deletions web/src/engine/websites/NhatTruyen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Tags } from '../Tags';
import icon from './NhatTruyen.webp';
import * as Common from './decorators/Common';
import { MojoPortalComic, queryMangaTitle } from './templates/MojoPortalComic';
//import { Text } from '../SettingsManager';
//import { WebsiteResourceKey as R } from '../../i18n/ILocale';

@Common.MangaCSS(/^{origin}\/truyen-tranh\/[^/]+/, queryMangaTitle)

export default class extends MojoPortalComic {
public constructor() {
super('nhattruyen', `NhatTruyen`, 'https://nhattruyenv.com', Tags.Language.Vietnamese, Tags.Media.Manga, Tags.Media.Manhua, Tags.Media.Manhwa, Tags.Source.Aggregator);
this.pagesExcludePatterns = [/638143969460448990.jpg$/];
//this.Settings.url = new Text('urloverride', R.Plugin_Settings_UrlOverride, R.Plugin_Settings_UrlOverrideInfo, this.URI.origin);
//this.Settings.url.ValueChanged.Subscribe((_, value: string) => this.URI.href = value);
//this.URI.href = this.Settings.url.Value as string;
}

public override get Icon() {
return icon;
}
}
24 changes: 24 additions & 0 deletions web/src/engine/websites/NhatTruyen_e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { TestFixture } from '../../../test/WebsitesFixture';

const config = {
plugin: {
id: 'nhattruyen',
title: 'NhatTruyen'
},
container: {
url: 'https://nhattruyenv.com/truyen-tranh/shy',
id: '/truyen-tranh/shy',
title: 'Shy'
},
child: {
id: '/truyen-tranh/shy/chuong-91',
title: 'Chapter 91'
},
entry: {
index: 0,
size: 136_128,
type: 'image/jpeg'
}
};

new TestFixture(config).AssertWebsite();
35 changes: 8 additions & 27 deletions web/src/engine/websites/TruyenTranhOnline.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
// Auto-Generated export from HakuNeko Legacy
import { Tags } from '../Tags';
import icon from './TruyenTranhOnline.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Madara from './decorators/WordPressMadara';
import * as Common from './decorators/Common';
import { MojoPortalComic, queryMangaTitle } from './templates/MojoPortalComic';

@Madara.MangaCSS(/^{origin}\/[^/]+\/$/)
@Madara.MangasMultiPageAJAX()
@Madara.ChaptersSinglePageAJAXv1()
@Madara.PagesSinglePageCSS()
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {
@Common.MangaCSS(/^{origin}\/truyen-[^.]+\.html$/, queryMangaTitle)

export default class extends MojoPortalComic {

public constructor() {
// TODO: Is tutientruyen5.xyz the correct new domain?
super('truyentranhaudioonline', 'Truyện tranh online', 'https://protruyen5.xyz', Tags.Media.Manhwa, Tags.Language.Vietnamese, Tags.Source.Aggregator);
super('truyentranhaudioonline', 'Truyện tranh online', 'https://protruyen4.xyz', Tags.Media.Manhwa, Tags.Language.Vietnamese, Tags.Source.Aggregator);
this.pagesExcludePatterns = [/pro5xyz\.jpg$/, /\/123.jpg$/];
this.queryPages = 'div.reading-detail img';
}

public override get Icon() {
return icon;
}
}

// Original Source
/*
class TruyenTranhAudioOnline extends WordPressMadara {

constructor() {
super();
super.id = 'truyentranhaudioonline';
super.label = 'Truyện tranh audio';
this.tags = [ 'webtoon', 'vietnamese' ];
this.url = 'https://truyentranhaudio.online';

this.queryPages = 'div.reading-content source';
}
}
*/
}
Binary file modified web/src/engine/websites/TruyenTranhOnline.webp
Binary file not shown.
18 changes: 9 additions & 9 deletions web/src/engine/websites/TruyenTranhOnline_e2e.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { TestFixture } from '../../../test/WebsitesFixture';
const config = {
plugin: {
id: 'truyentranhaudioonline',
title: 'Truyện tranh audio'
}/*,
title: 'Truyện tranh online'
},
container: {
url: 'https://truyentranhaudio.online/manga/.../',
id: JSON.stringify({ post: '0', slug: '/manga/.../' }),
title: 'Manga ?'
url: 'https://protruyen4.xyz/truyen-nguyen-ton.html',
id: '/truyen-nguyen-ton.html',
title: 'Nguyên Tôn'
},
child: {
id: '/manga/.../.../',
title: 'Chapter ?'
id: '/doc-nguyen-ton-chuong-899.html',
title: 'Chapter 899'
},
entry: {
index: 0,
size: -1,
size: 457_292,
type: 'image/jpeg'
}*/
}
};

new TestFixture(config).AssertWebsite();
3 changes: 2 additions & 1 deletion web/src/engine/websites/_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ export { default as LunarScans } from './LunarScans';
export { default as LunaScans } from './LunaScans';
export { default as LupiTeam } from './LupiTeam';
export { default as Luscious } from './Luscious';
export { default as LxHentai } from './LxHentai';
export { default as LynxScans } from './LynxScans';
export { default as MadaraDex } from './MadaraDex';
export { default as MagComi } from './MagComi';
Expand Down Expand Up @@ -472,6 +473,7 @@ export { default as NetComics } from './NetComics';
export { default as NeuManga } from './NeuManga';
export { default as NewManhua } from './NewManhua';
export { default as Ngomik } from './Ngomik';
export { default as NhatTruyen } from './NhatTruyen';
export { default as NHentai } from './NHentai';
export { default as NHentaiCom } from './NHentaiCom';
export { default as NiceOppai } from './NiceOppai';
Expand Down Expand Up @@ -784,7 +786,6 @@ export { default as MyAnimeListManga } from './legacy/MyAnimeListManga';
export { default as MyReadingManga } from './legacy/MyReadingManga';
export { default as Naver } from './legacy/Naver';
export { default as NewToki } from './legacy/NewToki';
export { default as NhatTruyen } from './legacy/NhatTruyen';
export { default as NineMangaBR } from './legacy/NineMangaBR';
export { default as NineMangaDE } from './legacy/NineMangaDE';
export { default as NineMangaEN } from './legacy/NineMangaEN';
Expand Down
Binary file removed web/src/engine/websites/legacy/MangaToroVI.webp
Binary file not shown.
34 changes: 0 additions & 34 deletions web/src/engine/websites/legacy/NhatTruyen.ts

This file was deleted.

27 changes: 27 additions & 0 deletions web/src/engine/websites/templates/MojoPortalComic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { DecoratableMangaScraper, type Chapter, type Page } from '../../providers/MangaPlugin';
import * as Common from '../decorators/Common';

export const queryMangaTitle = '#item-detail .title-detail';
export const queryChapter = 'div.list-chapter ul li.row div.chapter a';
export const queryPages = 'div.reading div.page-chapter img';
export const path = '/?page={page}';
export const queryMangas = 'div.ModuleContent div.items div.item figcaption a.jtip';

export function PageExtractor(element: HTMLImageElement): string {
return element.dataset.original || element.dataset.src || element.getAttribute('src');
}

@Common.MangasMultiPageCSS(path, queryMangas)
@Common.ChaptersSinglePageCSS(queryChapter)
@Common.ImageAjax(true)
export class MojoPortalComic extends DecoratableMangaScraper {
protected pagesExcludePatterns: RegExp[] = [];
protected queryPages = queryPages;
protected queryChapter = queryChapter;
protected pageExtractor = PageExtractor;

public override async FetchPages(chapter: Chapter): Promise<Page[]> {
const pages = await Common.FetchPagesSinglePageCSS.call(this, chapter, this.queryPages, this.pageExtractor);
return pages.filter(page => !this.pagesExcludePatterns.some(pattern => pattern.test(page.Link.pathname)));
}
}
3 changes: 3 additions & 0 deletions web/src/engine/websites/templates/MojoPortalComic_e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '../LxHentai_e2e';
import '../NhatTruyen_e2e';
import '../TruyenTranhOnline_e2e';