From 46ab5cd52ac7c7009e2f965c86e4dd7392d493b5 Mon Sep 17 00:00:00 2001 From: Shehryar Date: Tue, 5 Mar 2024 18:58:12 +0400 Subject: [PATCH] Fixed empty chapters on NovelFull --- README.md | 4 ++-- package.json | 21 +++++++++++++++++-- src/app/services/sources/novelfull.service.ts | 9 ++++++-- src/app/services/sources/sourceService.ts | 4 ++-- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 802ac1a..feb78f8 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ _Download translated web/light novels from a list of pirate sites._ List of supported sites: -- [NovelFull](https://novelfull.com/) +- [NovelFull](https://novelfull.com/) - [BoxNovel](https://boxnovel.com/) - [ReadLightNovel](https://www.readlightnovel.org/) - [~~NovelPlanet~~](https://novelplanet.com/) _offline_ Author: _dr-nyt_ -Version: _2.0.0_ +Version: _2.0.7_ ## FEATURES diff --git a/package.json b/package.json index ed58e27..820ccd0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NovelScraper", - "version": "2.0.6", + "version": "2.0.7", "description": "App for downloading novels from pirate sites.", "homepage": "https://github.com/HanaDigital/NovelScraper", "author": { @@ -17,6 +17,23 @@ ], "main": "main.js", "private": true, + "build": { + "productName": "NovelScraper", + "buildVersion": "2.0.7", + "files": ["**/*", "dist/**/*"], + "directories": { + "output": "release", + "buildResources": "dist" + }, + "win": { + "icon": "dist/assets/icons/favicon.ico", + "publish": ["github"], + "target": ["nsis"] + }, + "nsis": { + "runAfterFinish": true + } + }, "scripts": { "postinstall": "electron-builder install-app-deps", "ng": "ng", @@ -104,4 +121,4 @@ "rimraf": "3.0.2", "shelljs": "0.8.4" } -} +} \ No newline at end of file diff --git a/src/app/services/sources/novelfull.service.ts b/src/app/services/sources/novelfull.service.ts index 3f582e4..0ca94ae 100644 --- a/src/app/services/sources/novelfull.service.ts +++ b/src/app/services/sources/novelfull.service.ts @@ -318,11 +318,16 @@ export class NovelfullService extends sourceService { /\(adsbygoogle = window.adsbygoogle \|\| \[\]\).push\({}\);/g, "" ); - chapterBody = chapterBody.replace(/<\/script>/g, ""); - chapterBody = chapterBody.replace(//g, ""); + chapterBody = chapterBody.replace(//g, ""); + chapterBody = chapterBody.replace(//g, ""); + chapterBody = chapterBody.replace(/id=".*?"/g, ""); + chapterBody = chapterBody.replace(/class=".*?"/g, ""); + chapterBody = chapterBody.replace(/style=".*?"/g, ""); + chapterBody = chapterBody.replace(/data-.*?=".*?"/g, ""); const chapter = this.prepChapter(novel, downloadID, chapterTitle, chapterBody, downloadedChapters.length, totalLength); downloadedChapters.push(chapter); + return; } if (!canceled) this.novelFactory.generateEpub(novel, downloadedChapters, downloadID); diff --git a/src/app/services/sources/sourceService.ts b/src/app/services/sources/sourceService.ts index 4e36896..a2a8a92 100644 --- a/src/app/services/sources/sourceService.ts +++ b/src/app/services/sources/sourceService.ts @@ -77,8 +77,8 @@ export class sourceService { currentPos: number, destPos: number ): chapterObj { - chapterBody = chapterBody.replace(//gi, ""); // Remove any script tags usually used with ads (Security+) - chapterBody = chapterBody.replace(//gi, ""); // Remove any iframes usually used with ads + chapterBody = chapterBody.replace(//gi, ""); // Remove any script tags usually used with ads (Security+) + chapterBody = chapterBody.replace(//gi, ""); // Remove any iframes usually used with ads chapterBody = chapterBody.replace(/< *br *>/gi, "
"); // Make sure all
tags end correctly for xhtml chapterBody = chapterBody.replace(/
/gi, ""); // Remove any useless
tags chapterBody = chapterBody.replace(