From 8e9d01a24529bb76d64d19a7983fc3b1299437fb Mon Sep 17 00:00:00 2001 From: appdevelpo <56633229+appdevelpo@users.noreply.github.com> Date: Sat, 7 Oct 2023 02:16:00 +0800 Subject: [PATCH] Create manhuagui.com.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 漫畫櫃/manhuagui --- repo/manhuagui.com.js | 88 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 repo/manhuagui.com.js diff --git a/repo/manhuagui.com.js b/repo/manhuagui.com.js new file mode 100644 index 0000000..e18ed3c --- /dev/null +++ b/repo/manhuagui.com.js @@ -0,0 +1,88 @@ +// ==MiruExtension== +// @name 漫画柜 +// @version v0.0.1 +// @author appdevelpo +// @lang zh +// @license MIT +// @type manga +// @icon https://www.manhuagui.com/favicon.ico +// @package manhuagui.com +// @webSite https://api-manhuagui.aoihosizora.top/v1 +// @nsfw false +// ==/MiruExtension== +export default class Mangafx extends Extension { + async latest(page) { + const res = await this.request("", { + headers: { + "Miru-Url": "https://www.manhuagui.com/update/d30.html", + }, + }); + const bsxList = res.match(/
  • [\s\S]?/g); + const mangas = []; + bsxList.forEach((element) => { + const url = element.match(/src="\/\/cf.mhgui.com\/cpic\/m\/(\d+)/)[1]; + const title = element.match(/title="(.+?)"/)[1]; + const cover = "https:"+element.match(/src="(.+?)"/)[1]; + mangas.push({ + title, + url, + cover, + }); + }); + return mangas; + } + + async search(kw, page) { + const res = await this.request("", { + headers: { + "Miru-Url": `https://www.manhuagui.com/s/${kw}.html`, + }, + }); + const bsxList = res.match(/
  • [\s\S]+?<\/li>/g); + const mangas = []; + bsxList.forEach((element) => { + const url = element.match(/href="\/comic\/(\d+)/)[1]; + const title = element.match(/title="(.+?)"/)[1]; + const cover = "https:"+element.match(/src="(.+?)"/)[1]; + mangas.push({ + title, + url, + cover, + }); + }); + return mangas; + } + + async detail(url) { + const res = await this.request(`/manga/${url}`); + const dat = res.data; + return { + title: dat.title, + cover: dat.cover, + desc: dat.introduction, + episodes: [ + { + title: "Directory", + urls: dat.chapter_groups[0].chapters.map((item) => ({ + name: item.title, + url: `${dat.mid}/${item.cid}`, + })), + }, + ], + }; + } + + async watch(url) { + const res = await this.request(`/manga/${url}`); + // console.log(res); + // console.log(res.data.pages); + return { + urls: res.data.pages, + headers:{ + "Referer": "https://tw.manhuagui.com/", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.56" + } + }; + } + } + \ No newline at end of file