切换系统

This commit is contained in:
pplokijuhyg 2020-01-13 11:00:58 +08:00
parent 4a018c3f3e
commit 9bc59c1310
13 changed files with 3735 additions and 3735 deletions

View File

@ -1,4 +1,4 @@
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表

View File

@ -1,63 +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(/<em>/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('<em>1.0</em>','')
// 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("隐之王")
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(/<em>/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('<em>1.0</em>','')
// 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

View File

@ -1,75 +1,75 @@
const cheerio = require('cheerio');
const axios = require('axios')
let getscript = async (url) => {
let text;
url = "https://www.177mh.net" + url
// console.log(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(webpshow)
if(webpshow == 1){
chapterImages = chapterImages.map(x => x + ".webp")
}
list = { chapterImages , imghost:qianzso ,chapterPath:"",fanpa:{head:{"Referer": "https://www.177mh.net"}} }
console.log(list)
return list;
}
// getscript('/201008/167494.html')
module.exports = getscript
const cheerio = require('cheerio');
const axios = require('axios')
let getscript = async (url) => {
let text;
url = "https://www.177mh.net" + url
// console.log(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(webpshow)
if(webpshow == 1){
chapterImages = chapterImages.map(x => x + ".webp")
}
list = { chapterImages , imghost:qianzso ,chapterPath:"",fanpa:{head:{"Referer": "https://www.177mh.net"}} }
console.log(list)
return list;
}
// getscript('/201008/167494.html')
module.exports = getscript

View File

@ -1,57 +1,57 @@
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('<span>','').replace('</span>','')
// 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('<span>','').replace('</span>','').replace(/\s+/g,"").replace('\\n','')
// obj.list.push(con)
// })
// // console.log(obj)
// list.push(obj)
// })
// console.log(list)
list = [{
title:"列表",
list: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')
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('<span>','').replace('</span>','')
// 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('<span>','').replace('</span>','').replace(/\s+/g,"").replace('\\n','')
// obj.list.push(con)
// })
// // console.log(obj)
// list.push(obj)
// })
// console.log(list)
list = [{
title:"列表",
list: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

View File

@ -1,4 +1,4 @@
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表

View File

@ -1,121 +1,121 @@
const puppeteer = require('puppeteer');
const cheerio = require('cheerio')
let mainurl = "http://www.pufei.net/"
let gethtml = (name) => {
return new Promise(async (res, rej) => {
puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
}).then(async (browser) => {
const page = await browser.newPage();
await page.goto(mainurl);
await page.click(".searchtext1")
await page.type(".searchtext1", name);
// const usernameValue = await page.$eval(".searchtext1", el => el.value);
await page.click("#btnSend1")
let openpages = []
let num = 0;
let set = setInterval(async () => {
await browser.pages().then((res) => {
// console.log(res.length)
openpages = res
})
try {
await openpages[2].content().then((r) => {
// console.log(r)
if(r.indexOf("没有搜索到相关的内容") != -1 || r.indexOf("您当前的位置") != -1){
// console.log(r)
res(r)
clearInterval(set)
browser.close()
}else{
throw error;
}
})
} catch (error) {
num++
// console.log(num)
if(num > 10){
res([])
clearInterval(set)
browser.close()
}
// console.log(err)
// res([])
}
}, 500);
// setTimeout(async () => {
// await browser.pages().then((res) => {
// // console.log(res.length)
// openpages = res
// })
// try {
// await openpages[2].content().then((r) => {
// // console.log(r)
// res(r)
// })
// browser.close()
// } catch (error) {
// res([])
// browser.close()
// }
// // console.log(a)
// // await page.content().then((r)=>{
// // res(r)
// // })
// }, 2000);
})
})
}
let get = (name) => {
return new Promise(async (res, rej) => {
let html;
await gethtml(name).then((res) => {
html = res
})
// console.log(html)
let $ = cheerio.load(html)
let list = []
await $("#dmList ul li").each((index, ele) => {
// console.log(index,123)
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let name = item("dl dt a").html()
let date = item("dl dd p").eq(0).html()
let url = mainurl + item("dl dt a").attr("href")
let update = item("dl dd p").eq(1).html().replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
date = date.replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
// console.log({
// date,
// name,
// url,
// update
// })
let l = {
date,
name,
url,
update
}
list.push(l)
})
// console.log(list)
list = { name: "扑飞漫画", list }
res(list);
})
}
const puppeteer = require('puppeteer');
const cheerio = require('cheerio')
let mainurl = "http://www.pufei.net/"
let gethtml = (name) => {
return new Promise(async (res, rej) => {
puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
}).then(async (browser) => {
const page = await browser.newPage();
await page.goto(mainurl);
await page.click(".searchtext1")
await page.type(".searchtext1", name);
// const usernameValue = await page.$eval(".searchtext1", el => el.value);
await page.click("#btnSend1")
let openpages = []
let num = 0;
let set = setInterval(async () => {
await browser.pages().then((res) => {
// console.log(res.length)
openpages = res
})
try {
await openpages[2].content().then((r) => {
// console.log(r)
if(r.indexOf("没有搜索到相关的内容") != -1 || r.indexOf("您当前的位置") != -1){
// console.log(r)
res(r)
clearInterval(set)
browser.close()
}else{
throw error;
}
})
} catch (error) {
num++
// console.log(num)
if(num > 10){
res([])
clearInterval(set)
browser.close()
}
// console.log(err)
// res([])
}
}, 500);
// setTimeout(async () => {
// await browser.pages().then((res) => {
// // console.log(res.length)
// openpages = res
// })
// try {
// await openpages[2].content().then((r) => {
// // console.log(r)
// res(r)
// })
// browser.close()
// } catch (error) {
// res([])
// browser.close()
// }
// // console.log(a)
// // await page.content().then((r)=>{
// // res(r)
// // })
// }, 2000);
})
})
}
let get = (name) => {
return new Promise(async (res, rej) => {
let html;
await gethtml(name).then((res) => {
html = res
})
// console.log(html)
let $ = cheerio.load(html)
let list = []
await $("#dmList ul li").each((index, ele) => {
// console.log(index,123)
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let name = item("dl dt a").html()
let date = item("dl dd p").eq(0).html()
let url = mainurl + item("dl dt a").attr("href")
let update = item("dl dd p").eq(1).html().replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
date = date.replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
// console.log({
// date,
// name,
// url,
// update
// })
let l = {
date,
name,
url,
update
}
list.push(l)
})
// console.log(list)
list = { name: "扑飞漫画", list }
res(list);
})
}
module.exports = get

View File

@ -1,63 +1,63 @@
const cheerio = require('cheerio');
const axios = require('axios')
const iconv = require("iconv-lite")
let mainurl = "http://www.pufei.net/"
let getscript = async (url) => {
let text;
let imglist = [] // 图片列表
let scrurl = "" //图片域名
let baseurl = "" //图片基本url
url = mainurl + url
await axios({url,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
text = iconv.decode(res.data, 'gbk');
// console.log(text)
// text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
let href = $(ele).attr("src")
if (text.search('packed') != -1) {
eval(text)
// console.log(ret_classurl)
imglist = photosr
baseurl = ret_classurl
}
if(href && href.search('view.js') != -1){
// console.log(href)
scrurl = href
}
})
await axios({url : mainurl + scrurl,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
let scr = iconv.decode(res.data, 'gbk');
scr=scr.substring(scr.indexOf("//分割获取id"),scr.indexOf("console.log(mh[4]);"))
// scr=scr.substring(scr.indexOf("current_img_base = photosr[page];") + 33,scr.indexOf("if (current_img_base.indexOf('http://') != -1 ) {"))
// let WebimgServer = []
// let WebimgServerURL = []
console.log(scr)
eval(scr)
console.log(imgserver)
scrurl = imgserver
// text = res.data
})
for(let i in imglist){
imglist[i] = "/" + imglist[i]
}
return{
imghost:scrurl.substring(0,scrurl.length - 1),
chapterPath:"",
chapterImages:imglist
}
// return list;
}
// getscript('/manhua/984/92761.html').then((res)=>{
// console.log(res)
// })
const cheerio = require('cheerio');
const axios = require('axios')
const iconv = require("iconv-lite")
let mainurl = "http://www.pufei.net/"
let getscript = async (url) => {
let text;
let imglist = [] // 图片列表
let scrurl = "" //图片域名
let baseurl = "" //图片基本url
url = mainurl + url
await axios({url,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
text = iconv.decode(res.data, 'gbk');
// console.log(text)
// text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
let href = $(ele).attr("src")
if (text.search('packed') != -1) {
eval(text)
// console.log(ret_classurl)
imglist = photosr
baseurl = ret_classurl
}
if(href && href.search('view.js') != -1){
// console.log(href)
scrurl = href
}
})
await axios({url : mainurl + scrurl,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
let scr = iconv.decode(res.data, 'gbk');
scr=scr.substring(scr.indexOf("//分割获取id"),scr.indexOf("console.log(mh[4]);"))
// scr=scr.substring(scr.indexOf("current_img_base = photosr[page];") + 33,scr.indexOf("if (current_img_base.indexOf('http://') != -1 ) {"))
// let WebimgServer = []
// let WebimgServerURL = []
console.log(scr)
eval(scr)
console.log(imgserver)
scrurl = imgserver
// text = res.data
})
for(let i in imglist){
imglist[i] = "/" + imglist[i]
}
return{
imghost:scrurl.substring(0,scrurl.length - 1),
chapterPath:"",
chapterImages:imglist
}
// return list;
}
// getscript('/manhua/984/92761.html').then((res)=>{
// console.log(res)
// })
module.exports = getscript

View File

@ -1,41 +1,41 @@
let axios = require('axios')
const cheerio = require('cheerio');
let iconv = require('iconv-lite');
let getsection = async (text) => {
var text = iconv.decode(text, 'gbk');
let $ = cheerio.load(text, { decodeEntities: false })
let list = []
$("#play_0 ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let url = item("a").attr("href")
let title = item("a").html()
// console.log(title)
list.push({url,title})
})
list = list.reverse()
// console.log(list)
list = [{
title:"列表",
list:list
}]
return list
}
let gethtml = async (url) => {
let text;
await axios({url,responseType: 'arraybuffer'}).then((res) => {
text = res.data
})
// console.log(text)
let list = await getsection(text)
// list = [{
// title:"漫画列表",
// list
// }]
// console.log(list)
// console.log(JSON.stringify(list))
return list
}
// gethtml('http://www.taduo.net/manhua/984/')
let axios = require('axios')
const cheerio = require('cheerio');
let iconv = require('iconv-lite');
let getsection = async (text) => {
var text = iconv.decode(text, 'gbk');
let $ = cheerio.load(text, { decodeEntities: false })
let list = []
$("#play_0 ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let url = item("a").attr("href")
let title = item("a").html()
// console.log(title)
list.push({url,title})
})
list = list.reverse()
// console.log(list)
list = [{
title:"列表",
list:list
}]
return list
}
let gethtml = async (url) => {
let text;
await axios({url,responseType: 'arraybuffer'}).then((res) => {
text = res.data
})
// console.log(text)
let list = await getsection(text)
// list = [{
// title:"漫画列表",
// list
// }]
// console.log(list)
// console.log(JSON.stringify(list))
return list
}
// gethtml('http://www.taduo.net/manhua/984/')
module.exports = gethtml

View File

@ -1,4 +1,4 @@
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表
古风漫画网
www.gufengmh8.com
find.js 查找功能
section.js 获取章节列表

View File

@ -1,112 +1,112 @@
const puppeteer = require('puppeteer');
const cheerio = require('cheerio')
let mainurl = "http://www.taduo.net/"
let gethtml = (name) => {
return new Promise(async (res, rej) => {
puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
}).then(async (browser) => {
const page = await browser.newPage();
await page.goto(mainurl);
await page.type(".searchtext1", name);
// const usernameValue = await page.$eval(".searchtext1", el => el.value);
await page.click("#btnSend1")
let openpages = []
let num = 0;
let set = setInterval(async () => {
await browser.pages().then((res) => {
// console.log(res.length)
openpages = res
})
try {
await openpages[2].content().then((r) => {
// console.log(r)
if(r.indexOf("没有搜索到相关的内容") != -1 || r.indexOf("您当前的位置") !=-1){
res(r)
clearInterval(set)
browser.close()
}else{
throw error;
}
})
} catch (error) {
num++
// console.log(num)
if(num > 10){
res([])
clearInterval(set)
browser.close()
}
// console.log(err)
// res([])
}
}, 500);
// setTimeout(async () => {
// await browser.pages().then((res) => {
// // console.log(res.length)
// openpages = res
// })
// try {
// await openpages[2].content().then((r) => {
// res(r)
// })
// browser.close()
// } catch (error) {
// res([])
// browser.close()
// }
// }, 1500);
})
})
}
let get = (name) => {
return new Promise(async (res,rej)=>{
let html;
await gethtml(name).then((res) => {
html = res
})
// console.log(html)
let $ = cheerio.load(html)
let list = []
await $("#dmList ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let name = item("dl dt a").html()
let date = item("dl dd p").eq(0).html()
let url = mainurl + item("dl dt a").attr("href")
let update = item("dl dd p").eq(1).html().replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
date = date.replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
// console.log({
// date,
// name,
// url,
// update
// })
let l = {
date,
name,
url,
update
}
list.push(l)
})
// console.log(list)
list = {name:"塔多漫画",list}
res(list);
})
}
const puppeteer = require('puppeteer');
const cheerio = require('cheerio')
let mainurl = "http://www.taduo.net/"
let gethtml = (name) => {
return new Promise(async (res, rej) => {
puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
}).then(async (browser) => {
const page = await browser.newPage();
await page.goto(mainurl);
await page.type(".searchtext1", name);
// const usernameValue = await page.$eval(".searchtext1", el => el.value);
await page.click("#btnSend1")
let openpages = []
let num = 0;
let set = setInterval(async () => {
await browser.pages().then((res) => {
// console.log(res.length)
openpages = res
})
try {
await openpages[2].content().then((r) => {
// console.log(r)
if(r.indexOf("没有搜索到相关的内容") != -1 || r.indexOf("您当前的位置") !=-1){
res(r)
clearInterval(set)
browser.close()
}else{
throw error;
}
})
} catch (error) {
num++
// console.log(num)
if(num > 10){
res([])
clearInterval(set)
browser.close()
}
// console.log(err)
// res([])
}
}, 500);
// setTimeout(async () => {
// await browser.pages().then((res) => {
// // console.log(res.length)
// openpages = res
// })
// try {
// await openpages[2].content().then((r) => {
// res(r)
// })
// browser.close()
// } catch (error) {
// res([])
// browser.close()
// }
// }, 1500);
})
})
}
let get = (name) => {
return new Promise(async (res,rej)=>{
let html;
await gethtml(name).then((res) => {
html = res
})
// console.log(html)
let $ = cheerio.load(html)
let list = []
await $("#dmList ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let name = item("dl dt a").html()
let date = item("dl dd p").eq(0).html()
let url = mainurl + item("dl dt a").attr("href")
let update = item("dl dd p").eq(1).html().replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
date = date.replace("<em>", "").replace('</em><span class="red">', "").replace('</span></p>', "").replace("</span>", "")
// console.log({
// date,
// name,
// url,
// update
// })
let l = {
date,
name,
url,
update
}
list.push(l)
})
// console.log(list)
list = {name:"塔多漫画",list}
res(list);
})
}
module.exports = get

View File

@ -1,59 +1,59 @@
const cheerio = require('cheerio');
const axios = require('axios')
const iconv = require("iconv-lite")
let mainurl = "http://www.taduo.net/"
let getscript = async (url) => {
let text;
let imglist = [] // 图片列表
let scrurl = "" //图片域名
let baseurl = "" //图片基本url
url = mainurl + url
await axios({url,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
text = iconv.decode(res.data, 'gbk');
// console.log(text)
// text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
let href = $(ele).attr("src")
if (text.search('packed') != -1) {
eval(text)
// console.log(ret_classurl)
imglist = photosr
baseurl = ret_classurl
}
if(href && href.search('global.js') != -1){
// console.log(href)
scrurl = href
}
})
await axios({url : mainurl + scrurl,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
let scr = iconv.decode(res.data, 'gbk');
scr=scr.substring(scr.indexOf("//服务器切换") + 1,scr.indexOf("//屏蔽js错误"))
scr=scr.substring(scr.indexOf("current_img_base = photosr[page];") + 33,scr.indexOf("if (current_img_base.indexOf('http://') != -1 ) {"))
let WebimgServer = []
let WebimgServerURL = []
eval(scr)
// console.log(WebimgServerURL)
scrurl = WebimgServerURL[0]
// text = res.data
})
return{
imghost:scrurl.substring(0,scrurl.length - 1),
chapterPath:"",
chapterImages:imglist
}
// return list;
}
// getscript('/manhua/984/92761.html').then((res)=>{
// console.log(res)
// })
const cheerio = require('cheerio');
const axios = require('axios')
const iconv = require("iconv-lite")
let mainurl = "http://www.taduo.net/"
let getscript = async (url) => {
let text;
let imglist = [] // 图片列表
let scrurl = "" //图片域名
let baseurl = "" //图片基本url
url = mainurl + url
await axios({url,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
text = iconv.decode(res.data, 'gbk');
// console.log(text)
// text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
let href = $(ele).attr("src")
if (text.search('packed') != -1) {
eval(text)
// console.log(ret_classurl)
imglist = photosr
baseurl = ret_classurl
}
if(href && href.search('global.js') != -1){
// console.log(href)
scrurl = href
}
})
await axios({url : mainurl + scrurl,responseType: 'arraybuffer'}).then((res)=>{
// text = res.text
let scr = iconv.decode(res.data, 'gbk');
scr=scr.substring(scr.indexOf("//服务器切换") + 1,scr.indexOf("//屏蔽js错误"))
scr=scr.substring(scr.indexOf("current_img_base = photosr[page];") + 33,scr.indexOf("if (current_img_base.indexOf('http://') != -1 ) {"))
let WebimgServer = []
let WebimgServerURL = []
eval(scr)
// console.log(WebimgServerURL)
scrurl = WebimgServerURL[0]
// text = res.data
})
return{
imghost:scrurl.substring(0,scrurl.length - 1),
chapterPath:"",
chapterImages:imglist
}
// return list;
}
// getscript('/manhua/984/92761.html').then((res)=>{
// console.log(res)
// })
module.exports = getscript

View File

@ -1,41 +1,41 @@
let axios = require('axios')
const cheerio = require('cheerio');
let iconv = require('iconv-lite');
let getsection = async (text) => {
var text = iconv.decode(text, 'gbk');
let $ = cheerio.load(text, { decodeEntities: false })
let list = []
$("#play_0 ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let url = item("a").attr("href")
let title = item("a").html()
// console.log(title)
list.push({url,title})
})
list = list.reverse()
// console.log(list)
list = [{
title:"列表",
list:list
}]
return list
}
let gethtml = async (url) => {
let text;
await axios({url,responseType: 'arraybuffer'}).then((res) => {
text = res.data
})
// console.log(text)
let list = await getsection(text)
// list = [{
// title:"漫画列表",
// list
// }]
// console.log(list)
// console.log(JSON.stringify(list))
return list
}
// gethtml('http://www.taduo.net/manhua/984/')
let axios = require('axios')
const cheerio = require('cheerio');
let iconv = require('iconv-lite');
let getsection = async (text) => {
var text = iconv.decode(text, 'gbk');
let $ = cheerio.load(text, { decodeEntities: false })
let list = []
$("#play_0 ul li").each((index, ele) => {
let item = cheerio.load($(ele).html(), { decodeEntities: false })
let url = item("a").attr("href")
let title = item("a").html()
// console.log(title)
list.push({url,title})
})
list = list.reverse()
// console.log(list)
list = [{
title:"列表",
list:list
}]
return list
}
let gethtml = async (url) => {
let text;
await axios({url,responseType: 'arraybuffer'}).then((res) => {
text = res.data
})
// console.log(text)
let list = await getsection(text)
// list = [{
// title:"漫画列表",
// list
// }]
// console.log(list)
// console.log(JSON.stringify(list))
return list
}
// gethtml('http://www.taduo.net/manhua/984/')
module.exports = gethtml

File diff suppressed because it is too large Load Diff