Skip to content

Commit

Permalink
lirescan : recoding + tests (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev authored Oct 14, 2023
1 parent 3e2ec1d commit c660ebd
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 89 deletions.
28 changes: 28 additions & 0 deletions web/src/engine/websites/LireScan.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Tags } from '../Tags';
import icon from './LireScan.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Common from './decorators/Common';

function ChapterExtractor(anchor: HTMLAnchorElement) {
return {
id: anchor.pathname,
title: anchor.text.replace(/Scan/i, '').replace(/VF/i, '').trim()
};
}

@Common.MangaCSS(/^https?:\/\/lire-scan\.me\/manga\/\S+\.html$/, 'div.pmovie__header div.pmovie__header-main h1')
@Common.MangasMultiPageCSS('/manga/page/{page}', 'div.sect__content div.item a:first-of-type', 1, 1, 0, Common.AnchorInfoExtractor(false, 'div.item-poster__img'))
@Common.ChaptersSinglePageCSS('ul li div.chapter a', ChapterExtractor)
@Common.PagesSinglePageJS('manga[currentChapter]')
@Common.ImageAjax()

export default class extends DecoratableMangaScraper {

public constructor() {
super('lirescan', `LireScan`, 'https://lire-scan.me', Tags.Media.Manga, Tags.Media.Manhwa, Tags.Media.Manhua, Tags.Language.French);
}

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

const config: Config = {
plugin: {
id: 'lirescan',
title: 'LireScan'
},
container: {
url: 'https://lire-scan.me/manga/51-kingdom.html',
id: '/manga/51-kingdom.html',
title: 'Kingdom'
},
child: {
id: '/manga/51-kingdom/chapitre-774.html',
title: '774'
},
entry: {
index: 0,
size: 3_538_686,
type: 'image/webp'
}
};

const fixture = new TestFixture(config);
describe(fixture.Name, () => fixture.AssertWebsite());
2 changes: 1 addition & 1 deletion web/src/engine/websites/_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export { default as LHTranslation } from './LHTranslation';
export { default as LianScans } from './LianScans';
export { default as LilyManga } from './LilyManga';
export { default as LimaScans } from './LimaScans';
export { default as LireScan } from './LireScan';
export { default as LittleGarden } from './LittleGarden';
export { default as LSHiver } from './LSHiver';
export { default as LuminousScans } from './LuminousScans';
Expand Down Expand Up @@ -577,7 +578,6 @@ export { default as LineWebtoonID } from './legacy/LineWebtoonID';
export { default as LineWebtoonTH } from './legacy/LineWebtoonTH';
export { default as LineWebtoonTranslate } from './legacy/LineWebtoonTranslate';
export { default as LineWebtoonZH } from './legacy/LineWebtoonZH';
export { default as LireScan } from './legacy/LireScan';
export { default as LoliVault } from './legacy/LoliVault';
export { default as LupiTeam } from './legacy/LupiTeam';
export { default as LxHentai } from './legacy/LxHentai';
Expand Down
88 changes: 0 additions & 88 deletions web/src/engine/websites/legacy/LireScan.ts

This file was deleted.

Binary file removed web/src/engine/websites/legacy/LireScan.webp
Binary file not shown.

0 comments on commit c660ebd

Please sign in to comment.