Merge pull request #6631 from allencch/manhuagui

fix: manhuagui parse for the blocked comics
This commit is contained in:
NeverBehave 2021-01-10 19:59:38 -05:00 committed by GitHub
commit 2c0d14ecd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,7 @@
const { resolve } = require('url');
const cheerio = require('cheerio');
const got = require('@/utils/got');
const LZString = require('lz-string');
const getChapters = ($) =>
$('.chapter-list > ul')
@ -22,6 +23,14 @@ module.exports = async (ctx) => {
const { data } = await got.get(`https://www.manhuagui.com/comic/${id}/`);
const $ = cheerio.load(data);
if ($('#__VIEWSTATE').length > 0) {
const n = LZString.decompressFromBase64($('#__VIEWSTATE').val());
if (n) {
$('#erroraudit_show').replaceWith(n);
$('#__VIEWSTATE').remove();
}
}
const bookTitle = $('.book-title > h1').text();
const bookIntro = $('#intro-all').text();
const coverImgSrc = $('.book-cover img').attr('src');