From 53ee765f3067327f3821c3c39437216664e29ee4 Mon Sep 17 00:00:00 2001 From: Allen Date: Thu, 7 Jan 2021 14:34:07 +0800 Subject: [PATCH] fix: manhuagui parse for the blocked comics --- lib/routes/manhuagui/comic.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/routes/manhuagui/comic.js b/lib/routes/manhuagui/comic.js index 2ccefe675..5fef23310 100644 --- a/lib/routes/manhuagui/comic.js +++ b/lib/routes/manhuagui/comic.js @@ -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');