diff --git a/repo/netfapx.com.js b/repo/netfapx.com.js new file mode 100644 index 0000000..69f9859 --- /dev/null +++ b/repo/netfapx.com.js @@ -0,0 +1,100 @@ +// ==MiruExtension== +// @name NETFAPX +// @version v0.0.1 +// @author bachig26 +// @lang en +// @license MIT +// @package netfapx.com +// @type bangumi +// @icon https://netfapx.com/wp-content/uploads/2017/11/netfapx-lg-1_319381e1f227e13ae1201bfa30857622.png +// @webSite https://netfapx.com +// @nsfw true +// ==/MiruExtension== + +export default class extends Extension { + async latest(page) { + const res = await this.request(`/page/${page}/?orderby=newest`); + const bsxList = await this.querySelectorAll(res, "article.pinbox"); + const novel = []; + for (const element of bsxList) { + const html = await element.content; + const url = await this.getAttributeText(html, "a", "href"); + const title = await this.querySelector(html, "h3.title-2").text; + const cover = await this.querySelector(html, "img").getAttributeText("src"); + novel.push({ + title, + url, + cover, + }); + } + return novel; + } + + async search(kw) { + const kwstring = kw.replace(/ /g, '+'); + const res = await this.request(`/?s=${kwstring}`); + const bsxList = await this.querySelectorAll(res, "article.pinbox"); + const novel = []; + + for (const element of bsxList) { + const html = await element.content; + const url = await this.getAttributeText(html, "a", "href"); + const title = await this.querySelector(html, "h3.title-2").text; + const cover = await this.querySelector(html, "img").getAttributeText("src"); + novel.push({ + title, + url, + cover, + }); + } + return novel; + } + + async detail(url) { + const res = await this.request("", { + headers: { + "Miru-Url": url, + }, + }); + + const title = await this.querySelector(res, "h1").text; + const cover = res.match(/"posterImage": "(.+?)"/)[1]; + const desc = await this.querySelector(res, "div.su-expand-content > p").text; + + const urlPatterns = [/