Skip to content

Commit

Permalink
Requested websites (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev authored Dec 19, 2024
1 parent 9b43245 commit daccb4a
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 0 deletions.
21 changes: 21 additions & 0 deletions web/src/engine/websites/AsuraScansFree.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Tags } from '../Tags';
import icon from './AsuraScans.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as MangaStream from './decorators/WordPressMangaStream';
import * as Common from './decorators/Common';

@MangaStream.MangaCSS(/^{origin}\/serie\/[^/]+\/$/)
@MangaStream.MangasSinglePageCSS(undefined, '/serie/list-mode/')
@MangaStream.ChaptersSinglePageCSS()
@MangaStream.PagesSinglePageJS()
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('arurascansfree', 'Asura Scans Free', 'https://asurascansfree.com', Tags.Media.Manhwa, Tags.Media.Manhua, Tags.Language.English, Tags.Source.Aggregator);
}

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

const config: Config = {
plugin: {
id: 'arurascansfree',
title: 'Asura Scans Free',
},
container: {
url: 'https://asurascansfree.com/serie/academys-genius-swordmaster/',
id: '/serie/academys-genius-swordmaster/',
title: 'Academy’s Genius Swordmaster',
},
child: {
id: '/academys-genius-swordmaster-chapter-1/',
title: 'Chapter 1',
},
entry: {
index: 1,
size: 822_646,
type: 'image/webp'
}
};

new TestFixture(config).AssertWebsite();
21 changes: 21 additions & 0 deletions web/src/engine/websites/BakaMH.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Tags } from '../Tags';
import icon from './BakaMH.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Madara from './decorators/WordPressMadara';
import * as Common from './decorators/Common';

@Madara.MangaCSS(/^{origin}\/manga\/[^/]+\/$/, 'ol.breadcrumb li:last-of-type a')
@Madara.MangasMultiPageAJAX()
@Madara.ChaptersSinglePageAJAXv2()
@Madara.PagesSinglePageCSS()
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('bakamh', 'BakaMH', 'https://bakamh.com', Tags.Media.Manhwa, Tags.Language.Chinese, Tags.Source.Aggregator);
}

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

const mangaName = encodeURI('秘密教学');

const config: Config = {
plugin: {
id: 'bakamh',
title: 'BakaMH',
},
container: {
url: 'https://bakamh.com/manga/秘密教学/',
id: JSON.stringify({ post: '3037', slug: `/manga/${mangaName}/`}),
title: '秘密教学',
},
child: {
id: `/manga/${mangaName.toLowerCase()}/c-244/`,
title: '第244话 对薇亚坦承',
},
entry: {
index: 2,
size: 452_647,
type: 'image/jpeg'
}
};

new TestFixture(config).AssertWebsite();
21 changes: 21 additions & 0 deletions web/src/engine/websites/RagnarScans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Tags } from '../Tags';
import icon from './RagnarScans.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Madara from './decorators/WordPressMadara';
import * as Common from './decorators/Common';

@Madara.MangaCSS(/^{origin}\/manga\/[^/]+\/$/, 'ol.breadcrumb li:last-of-type a')
@Madara.MangasMultiPageAJAX()
@Madara.ChaptersSinglePageAJAXv2()
@Common.PagesSinglePageJS(Madara.WPMangaProtectorPagesExtractorScript, 2000)
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('ragnarscans', 'Ragnar Scans', 'https://ragnarscans.com', Tags.Media.Manhwa, Tags.Media.Manhua, Tags.Language.Turkish, Tags.Source.Aggregator);
}

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

const config: Config = {
plugin: {
id: 'ragnarscans',
title: 'Ragnar Scans',
},
container: {
url: 'https://ragnarscans.com/manga/gosu/',
id: JSON.stringify({ post: '6377', slug: '/manga/gosu/'}),
title: 'Gosu',
},
child: {
id: '/manga/gosu/bolum-231/',
title: 'Bölüm 231',
},
entry: {
index: 2,
size: 132_826,
type: 'image/jpeg'
}
};

new TestFixture(config).AssertWebsite();
56 changes: 56 additions & 0 deletions web/src/engine/websites/UlasComic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Tags } from '../Tags';
import icon from './UlasComic.webp';
import { DecoratableMangaScraper, Manga, type MangaPlugin } from '../providers/MangaPlugin';
import * as MangaStream from './decorators/WordPressMangaStream';
import * as Common from './decorators/Common';
import { FetchJSON } from '../platform/FetchProvider';

type FeedResults = {
feed: {
entry: {
link: {
rel: string,
href: string,
title: string
}[],
}[]
}
}

const pageScript = `[...document.querySelectorAll('div#readerarea img')].map(page => page.src);`;

const chapterScript = `
new Promise(resolve => {
resolve ( [...document.querySelectorAll('div#chapterlist ul li a')].map(chapter => {
return {
id: chapter.pathname,
title: chapter.querySelector('.chapternum').textContent.trim()
}
}));
});
`;

@MangaStream.MangaCSS(/^{origin}\/\d+\/\d+\/[^.]+\.html$/)
@Common.ChaptersSinglePageJS(chapterScript, 2500)
@Common.PagesSinglePageJS(pageScript, 2500)
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('ulascomic', 'Ulas Comic', 'https://www.ulascomic.xyz', Tags.Media.Manga, Tags.Language.Indonesian);
}

public override get Icon() {
return icon;
}

public override async FetchMangas(provider: MangaPlugin): Promise<Manga[]> {
const request = new Request(new URL(`/feeds/posts/summary/-/Series?start-index=1&max-results=99999&alt=json`, this.URI));
const { feed: { entry } } = await FetchJSON<FeedResults>(request);
return entry.map(manga => {
const link = manga.link.find(value => value.rel == 'alternate');
return new Manga(this, provider, new URL(link.href).pathname, link.title);
});
}

}
Binary file added web/src/engine/websites/UlasComic.webp
Binary file not shown.
24 changes: 24 additions & 0 deletions web/src/engine/websites/UlasComic_e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { TestFixture, type Config } from '../../../test/WebsitesFixture';

const config: Config = {
plugin: {
id: 'ulascomic',
title: 'Ulas Comic',
},
container: {
url: 'https://www.ulascomic.xyz/2024/05/god-of-blackfield.html',
id: '/2024/05/god-of-blackfield.html',
title: 'God Of Blackfield',
},
child: {
id: `/2024/05/chapter-01.html`,
title: 'Chapter 01',
},
entry: {
index: 0,
size: 747_486,
type: 'image/webp'
}
};

new TestFixture(config).AssertWebsite();
4 changes: 4 additions & 0 deletions web/src/engine/websites/_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export { default as AsmHentai } from './AsmHentai';
export { default as AstralManga } from './AstralManga';
export { default as AstraScans } from './AstraScans';
export { default as AsuraScans } from './AsuraScans';
export { default as AsuraScansFree } from './AsuraScansFree';
export { default as AsuraScansTR } from './AsuraScansTR';
export { default as Atikrost } from './Atikrost';
export { default as AyaToon } from './AyaToon';
export { default as AzoraWorld } from './AzoraWorld';
export { default as BacaKomik } from './BacaKomik';
export { default as BacaManga } from './BacaManga';
export { default as BakaMH } from './BakaMH';
export { default as Baozimh } from './Baozimh';
export { default as BarManga } from './BarManga';
export { default as Batoto } from './Batoto';
Expand Down Expand Up @@ -528,6 +530,7 @@ export { default as Qimeitj } from './Qimeitj';
export { default as QuantumScans } from './QuantumScans';
export { default as Rackus } from './Rackus';
export { default as RadiantScans } from './RadiantScans';
export { default as RagnarScans } from './RagnarScans';
export { default as RaijinScans } from './RaijinScans';
export { default as RaikiScan } from './RaikiScan';
export { default as RainDropFansub } from './RainDropFansub';
Expand Down Expand Up @@ -678,6 +681,7 @@ export { default as TurkManga } from './TurkManga';
export { default as Turktoon } from './Turktoon';
export { default as Tuttoanimemanga } from './Tuttoanimemanga';
export { default as TwoAnimx } from './TwoAnimx';
export { default as UlasComic } from './UlasComic';
export { default as UmeTruyen } from './UmeTruyen';
export { default as UngTyComic } from './UngTyComic';
export { default as UraSunday } from './UraSunday';
Expand Down

0 comments on commit daccb4a

Please sign in to comment.