换系统

This commit is contained in:
2019-12-26 17:37:51 +08:00
parent 1be20ea269
commit a3a4991dd1
13 changed files with 3472 additions and 3469 deletions

View File

@@ -1,32 +1,32 @@
const cheerio = require('cheerio');
const axios = require('axios')
let getscript = async (url) => {
let text;
await axios.get('https://www.gufengmh8.com/manhua/touxingjiuyuetian/1152122.html').then((res)=>{
// text = res.text
// console.log(res.data)
text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
if (text.search('chapterImages') != -1) {
eval(text)
var reg = /^http(s)?:\/\/(.*?)\//
imghost = reg.exec(pageImage)[2]
// imghost 图片域名
// chapterPath 图片基本链接path
// chapterImages 图片地址数组
// pageTitle 标题
// pageUrl 页面基础url
// prevChapterData 上一页信息
// nextChapterData 下一页信息
// 页面地址为 基础url + 页信息.id
console.log({ imghost, chapterPath, chapterImages, pageTitle, pageUrl, prevChapterData, nextChapterData, pageImage })
return { imghost, chapterPath, chapterImages, pageTitle, pageUrl, prevChapterData, nextChapterData, pageImage }
}
})
}
const cheerio = require('cheerio');
const axios = require('axios')
let getscript = async (url) => {
let text;
await axios.get('https://www.gufengmh8.com/manhua/touxingjiuyuetian/1152122.html').then((res)=>{
// text = res.text
// console.log(res.data)
text = res.data
})
let $ = cheerio.load(text);
$('script').each((index, ele) => {
// console.log(ele)
let text = $(ele).html()
if (text.search('chapterImages') != -1) {
eval(text)
var reg = /^http(s)?:\/\/(.*?)\//
imghost = reg.exec(pageImage)[2]
// imghost 图片域名
// chapterPath 图片基本链接path
// chapterImages 图片地址数组
// pageTitle 标题
// pageUrl 页面基础url
// prevChapterData 上一页信息
// nextChapterData 下一页信息
// 页面地址为 基础url + 页信息.id
console.log({ imghost, chapterPath, chapterImages, pageTitle, pageUrl, prevChapterData, nextChapterData, pageImage })
return { imghost, chapterPath, chapterImages, pageTitle, pageUrl, prevChapterData, nextChapterData, pageImage }
}
})
}
getscript('')