From 065e1544b4c128724e855b753bbe7f8681d6c20e Mon Sep 17 00:00:00 2001 From: kanasimi Date: Fri, 18 Oct 2024 05:57:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=2069=E4=B9=A6=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- novel.cmn-Hans-CN/69shu.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/novel.cmn-Hans-CN/69shu.js b/novel.cmn-Hans-CN/69shu.js index 0f2e6929..184339c7 100644 --- a/novel.cmn-Hans-CN/69shu.js +++ b/novel.cmn-Hans-CN/69shu.js @@ -32,7 +32,8 @@ var crawler = new CeL.work_crawler({ // 2024/1/29前改: https://www.69xinshu.com/ // 2024/3/13前改: https://www.69shu.pro/ // 2024/5/5前改: https://www.69shu.top/ - base_URL : 'https://www.69shu.top/', + // 2024/8/1前改: https://69shuba.cx/ + base_URL : 'https://69shuba.cx/', charset : 'gbk', // 解析 作品名稱 → 作品id get_work() @@ -137,12 +138,18 @@ var crawler = new CeL.work_crawler({ eval('text = ' + text); // console.trace(text); Object.assign(work_data, text); - if (!work_data.site_name) + if (!work_data.site_name && work_data.siteName) work_data.site_name = work_data.siteName; // 由 meta data 取得作品資訊。 extract_work_data(work_data, html); + if (work_data.tags && work_data.tags.includes('|')) { + work_data.tags = work_data.tags.split('|').filter(function(tag) { + return !!tag; + }); + } + work_data.last_update = work_data.update_time; // console.log(html); @@ -168,8 +175,14 @@ var crawler = new CeL.work_crawler({ url : matched[1], title : get_label(matched[2]) }; + crawler.add_chapter(work_data, chapter_data); }); + + crawler.reverse_chapter_list_order(work_data); + + this.trim_chapter_NO_prefix(work_data); + // console.log(work_data.chapter_list); }, @@ -185,6 +198,7 @@ var crawler = new CeL.work_crawler({ chapter_data.title = get_label(html.between('') //

第733章 一个人的比赛有什么意思,人多才热闹

.between('>')) || chapter_data.title; + this.trim_chapter_NO_prefix(chapter_data, chapter_NO); /** * @@ -225,9 +239,19 @@ var crawler = new CeL.work_crawler({ */ text = text.replace(/]*>[\s\S]*?<\/script>/g, ''); - text = text.replace(/  
<\/div>/g, + /** + * + + // https://69shuba.cx/txt/47093/31443846 我为长生仙 > 第1章 山下少年 + 你觉得如何。”
那女子白了丈夫一眼, + +
+ */ + text = text.replace(/(?: )*
<\/div>/g, '

'); + text = text.replace(/(?:]*>)+<\/p>/ig, '

'); + // console.trace([ html, text ]); this.add_ebook_chapter(work_data, chapter_NO, text); }