From e67a6246305854d26796bb0141dde9476f261f75 Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Mon, 6 Jan 2020 18:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=96=B0=E6=BC=AB?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/reptile/177mh_net/README.md | 4 ++ bin/reptile/177mh_net/config.js | 17 ++++++++ bin/reptile/177mh_net/find.js | 63 +++++++++++++++++++++++++++ bin/reptile/177mh_net/picture.js | 73 ++++++++++++++++++++++++++++++++ bin/reptile/177mh_net/section.js | 53 +++++++++++++++++++++++ 5 files changed, 210 insertions(+) create mode 100644 bin/reptile/177mh_net/README.md create mode 100644 bin/reptile/177mh_net/config.js create mode 100644 bin/reptile/177mh_net/find.js create mode 100644 bin/reptile/177mh_net/picture.js create mode 100644 bin/reptile/177mh_net/section.js diff --git a/bin/reptile/177mh_net/README.md b/bin/reptile/177mh_net/README.md new file mode 100644 index 0000000..d7f2ef7 --- /dev/null +++ b/bin/reptile/177mh_net/README.md @@ -0,0 +1,4 @@ +古风漫画网 +www.gufengmh8.com +find.js 查找功能 +section.js 获取章节列表 diff --git a/bin/reptile/177mh_net/config.js b/bin/reptile/177mh_net/config.js new file mode 100644 index 0000000..9fe923f --- /dev/null +++ b/bin/reptile/177mh_net/config.js @@ -0,0 +1,17 @@ +// import find from "./find" +// import imglist from "./picture" +// import section from "./section" +find = require("./find") +imglist = require("./picture") +section = require("./section") +let name = "新新漫画" +let version = "20.01.06" +let type = 1 +module.exports = { + name, + version, + type, + find, + imglist, + section +} \ No newline at end of file diff --git a/bin/reptile/177mh_net/find.js b/bin/reptile/177mh_net/find.js new file mode 100644 index 0000000..bdb2e79 --- /dev/null +++ b/bin/reptile/177mh_net/find.js @@ -0,0 +1,63 @@ +let axios = require('axios') +const cheerio = require('cheerio'); +const qs = require('querystring'); +let getcontlist = async (text) => { + let $ = cheerio.load(text) + let list = [] + // console.log($("ul").eq(1).html()) + $ = cheerio.load($("ul").eq(1).html()) + // console.log($("li").eq(0).html()) + $("dl").each((index,ele)=>{ + let j = cheerio.load($(ele).html(),{decodeEntities: false}) + let name= j("dd h1 a").html().replace(//g,"").replace(/<\/em>/g,"") + let url = j("dd h1 a").attr("href") + let data = "暂无数据" + let update = "暂无数据" + let obj = {name,url,data,update}; + + // console.log(name,url) + // console.log(unescape(j('.tt').eq(0).html())) + // obj.update = j('.tt').eq(0).html() + // obj.name = j(".ell a").eq(0).html() + // obj.date = j(".updateon").eq(0).html().replace(/\s+/g,"").replace('1.0','') + // obj.url = j(".cover").eq(0).attr('href') + // // console.log(obj) + list.push(obj) + }) + return list +} + +let gethtml = async (name) => { + name = qs.escape(name) + let url = `https://so.177mh.net/k.php?k=${name}` + // console.log(url) + let text = "" + await axios.get(url).then((a) => { + // console.log(a.text) + // res(a.text) + text = a.data + }) + let list = [] + try { + list = await getcontlist(text) + + } catch (error) { + // console.log(error) + } + list = {name:"新新漫画",list} + return list + + +} + +let getlist = (name) => { + return new Promise(async (res,rej)=>{ + let html; + html = await gethtml(name) + // console.log(JSON.stringify(html)) + res(html); + }) + +} +// getlist("隐之王") +module.exports = getlist \ No newline at end of file diff --git a/bin/reptile/177mh_net/picture.js b/bin/reptile/177mh_net/picture.js new file mode 100644 index 0000000..085d9e4 --- /dev/null +++ b/bin/reptile/177mh_net/picture.js @@ -0,0 +1,73 @@ +const cheerio = require('cheerio'); +const axios = require('axios') +let getscript = async (url) => { + let text; + url = "https://www.177mh.net" + url + await axios.get(url).then((res)=>{ + // text = res.text + // console.log(res.data) + text = res.data + }) + let $ = cheerio.load(text); + let list; + let chapterImages; + let cid,coid,ser,imgs; + $('script').each((index, ele) => { + // console.log(ele) + let text = $(ele).html() + if (text.search('eval') != -1) { + eval(text) + // imghost + // console.log(msg.split("|")) + chapterImages = msg.split("|") + // console.log(chapterImages) + cid = /\/colist_(\d+)\.html/.exec(link_z)[1]; + coid = /\/(\d+\/\d+)\.html/.exec(url); + coid = /\d+\/(\d+)/.exec(coid)[1]; + console.log(img_s) + ser = `https://css.gdbyhtl.net/img_v1/cn_svr.aspx?z=gn&s=${img_s}&cid=${cid}&coid=${coid}` + imgs = img_s + // let r = "" + + // eval(r) + // let qianzso = img_qianzso[img_s] + // console.log(qianzso) + // var reg = /^http(s)?:\/\/(.*?)\// + // imghost = reg.exec(pageImage)[2] + // imghost = "http://" + imghost + // imghost 图片域名 + // chapterPath 图片基本链接path + // chapterImages 图片地址数组 + // pageTitle 标题 + // pageUrl 页面基础url + // prevChapterData 上一页信息 + // nextChapterData 下一页信息 + // 页面地址为 基础url + 页信息.id + // console.log({ imghost, chapterPath, chapterImages, pageTitle, pageUrl, prevChapterData, nextChapterData, pageImage }) + // let down = pageUrl.replace("https://www.gufengmh8.com","") + nextChapterData.id + ".html" + // let upurl = pageUrl.replace("https://www.gufengmh8.com","") + prevChapterData.id + ".html" + // console.log(list) + } + }) + let r = ""; + console.log(ser) + await axios.get(ser).then((res)=>{ + r = res.data + // console.log(res) + }) + eval(r) + // console.log(img_qianzso) + + let qianzso = img_qianzso[imgs] + // console.log(qianzso) + if(webpshow == 1){ + chapterImages = chapterImages.map(x => x + ".webp") + } + list = { chapterImages , imghost:qianzso ,chapterPath:"" } + // console.log(list) + return list; + +} + +getscript('/201008/167494.html') +module.exports = getscript \ No newline at end of file diff --git a/bin/reptile/177mh_net/section.js b/bin/reptile/177mh_net/section.js new file mode 100644 index 0000000..9468d06 --- /dev/null +++ b/bin/reptile/177mh_net/section.js @@ -0,0 +1,53 @@ +let axios = require('axios') +const cheerio = require('cheerio'); + +let getsection = async (text)=>{ + let $ = cheerio.load(text) + // console.log(text) + let list = []; + let l = $(".ar_rlos_bor").eq(0).html() + $ = cheerio.load(l,{decodeEntities: false}) + $("li").each((index,ele)=>{ + let con = {} + let j = cheerio.load($(ele).html(),{decodeEntities: false}) + con.url = j("a").eq(0).attr("href") + con.title = j("a").eq(0).html() + // console.log(con) + // console.log($(ele).html()) + list.push(con) + + }) + // console.log(txt) + // console.log($(".comic-chapters ").eq(0).html()) + // $(".comic-chapters").each((index,ele)=>{ + // // $(ele) + // // console.log($(ele).html()) + // let obj = {} + // let j = cheerio.load($(ele).html(),{decodeEntities: false}) + // obj.title = j(".pull-left").eq(0).html().replace('','').replace('','') + // obj.list = [] + // j('li').each(function (index,ele){ + // let con = {} + // con.url = j(this).find("a").eq(0).attr('href') + // con.title = j(this).find("a").eq(0).html().replace('','').replace('','').replace(/\s+/g,"").replace('\\n','') + // obj.list.push(con) + // }) + // // console.log(obj) + // list.push(obj) + // }) + // console.log(list) + return list +} + +let gethtml = async (url)=>{ + let text; + await axios.get(url).then((res)=>{ + text = res.data + }) + let list = await getsection(text) + // console.log(JSON.stringify(list)) + return list +} + +gethtml('https://www.177mh.net/colist_111001.html') +module.exports = gethtml \ No newline at end of file