Skip to content

Commit

Permalink
Add Pururin back
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev committed Dec 16, 2024
1 parent 950a84e commit 782e578
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
42 changes: 42 additions & 0 deletions web/src/engine/websites/Pururin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Tags } from '../Tags';
import icon from './Pururin.webp';
import { DecoratableMangaScraper } from '../providers/MangaPlugin';
import * as Common from './decorators/Common';

const pageScript = `
new Promise (resolve => {
const element = document.querySelector('.img-viewer');
const imgdata = JSON.parse(element.dataset['img']);
resolve( imgdata.images.map( image => new URL( [imgdata.directory, image.filename].join('/'), element.dataset.svr).href));
})
`;

function MangaInfoExTractor(anchor: HTMLAnchorElement) {
return {
id: anchor.pathname,
title: anchor.querySelector<HTMLImageElement>('img.card-img-top').getAttribute('alt').trim()
};
}

function ChapterExtractor(element: HTMLDivElement) {
return {
id: element.querySelector<HTMLAnchorElement>('div.cover-wrapper a').pathname,
title: element.querySelector<HTMLSpanElement>('div.title h1 span').textContent.trim()
};
}

@Common.MangaCSS(/^{origin}\/gallery\/\d+\//, 'div.title h1 span')
@Common.MangasMultiPageCSS('/?page={page}', 'a.card.card-gallery', 1, 1, 0, MangaInfoExTractor)
@Common.ChaptersSinglePageCSS('div.gallery-wrapper', ChapterExtractor)
@Common.PagesSinglePageJS(pageScript, 1500)
@Common.ImageAjax()
export default class extends DecoratableMangaScraper {

public constructor() {
super('pururin', `Pururin`, 'https://pururin.me', Tags.Language.English, Tags.Media.Manga, Tags.Source.Aggregator, Tags.Rating.Pornographic);
}

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

new TestFixture({
plugin: {
id: 'pururin',
title: 'Pururin'
},
container: {
url: 'https://pururin.me/gallery/65780/the-rough-tempered-big-breasted-pirate-whos-addicted-to-sex',
id: '/gallery/65780/the-rough-tempered-big-breasted-pirate-whos-addicted-to-sex',
title: 'The Rough Tempered Big Breasted Pirate Who\'s Addicted To Sex / 気性が荒い爆乳海賊はえっちにハマる'
},
child: {
id: '/read/65780/01/the-rough-tempered-big-breasted-pirate-whos-addicted-to-sex',
title: `The Rough Tempered Big Breasted Pirate Who's Addicted To Sex / 気性が荒い爆乳海賊はえっちにハマる`
},
entry: {
index: 0,
size: 1_775_122,
type: 'image/jpeg'
}
}).AssertWebsite();
1 change: 1 addition & 0 deletions web/src/engine/websites/_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export { default as PornComix } from './PornComix';
export { default as PornComixOnline } from './PornComixOnline';
export { default as PortalYaoi } from './PortalYaoi';
export { default as ProjectSuki } from './ProjectSuki';
export { default as Pururin } from './Pururin';
export { default as Pzykosis666HFansub } from './Pzykosis666HFansub';
export { default as Qimeitj } from './Qimeitj';
export { default as QuantumScans } from './QuantumScans';
Expand Down

0 comments on commit 782e578

Please sign in to comment.