-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Tags } from '../Tags'; | ||
import icon from './Zhuzhumh.webp'; | ||
import { DecoratableMangaScraper } from '../providers/MangaPlugin'; | ||
import * as Common from './decorators/Common'; | ||
|
||
const queryChaptersScript = ` | ||
new Promise((resolve, reject) => { | ||
const interval = setInterval(() => { | ||
let morebtn = document.querySelector('a#zhankai:not([style*="display"])'); | ||
if (morebtn) morebtn.click() | ||
else { | ||
clearInterval(interval); | ||
const chapters = [...document.querySelectorAll('ul#mh-chapter-list-ol-0 li a')]; | ||
resolve( chapters.map(chapter => { | ||
return { id : chapter.pathname, title : chapter.textContent.trim()} | ||
})); | ||
} | ||
}, 500); | ||
}); | ||
`; | ||
|
||
@Common.MangaCSS(/^{origin}\/book\/[^/]+\.html$/, 'div.cy_title h1') | ||
@Common.MangasMultiPageCSS('/sort/1-{page}.html', 'div.cy_list_mh ul li.title a') | ||
@Common.ChaptersSinglePageJS(queryChaptersScript) | ||
@Common.PagesSinglePageJS('newImgs', 1500) | ||
@Common.ImageAjax() | ||
export default class extends DecoratableMangaScraper { | ||
|
||
public constructor() { | ||
super('zhuzhumh', `Zhuzhumh`, 'https://www.zhuzhumh.com', Tags.Language.Chinese, Tags.Media.Manga, Tags.Media.Manhua, Tags.Media.Manhwa, Tags.Source.Aggregator); | ||
} | ||
|
||
public override get Icon() { | ||
return icon; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { describe } from 'vitest'; | ||
import { TestFixture } from '../../../test/WebsitesFixture'; | ||
|
||
const config = { | ||
plugin: { | ||
id: 'zhuzhumh', | ||
title: 'Zhuzhumh' | ||
}, | ||
container: { | ||
url: 'https://www.zhuzhumh.com/book/shisiruguiweijunzi.html', | ||
id: '/book/shisiruguiweijunzi.html', | ||
title: '视死如归魏君子' | ||
}, | ||
child: { | ||
id: '/chapter-redirect/shisiruguiweijunzi/1364147.html', | ||
title: '93 四大纨绔之三' | ||
}, | ||
entry: { | ||
index: 0, | ||
size: 863_947, | ||
type: 'image/jpeg' | ||
} | ||
}; | ||
|
||
const fixture = new TestFixture(config); | ||
describe(fixture.Name, async () => (await fixture.Connect()).AssertWebsite()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters