Skip to content

Commit 0b455ca

Browse files
authored
Merge pull request #68 from HanaDigital/version-2.0.0
Fixed empty chapters on NovelFull
2 parents a037a9d + 9e9a99a commit 0b455ca

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@
2828

2929
## ABOUT
3030

31+
3132
Download and update translated web/light novels from a list of sites.
3233
List of supported sites:
33-
- [NovelFull](https://novelfull.com/)
34+
- [NovelFull](https://novelfull.com/)
35+
3436
- [BoxNovel](https://boxnovel.com/)
3537
- [ReadLightNovel](https://www.readlightnovel.org/)
3638
- [~~NovelPlanet~~](https://novelplanet.com/) _offline_
3739

3840
Author: [@dr-nyt](https://github.com/dr-nyt)
3941
Contributors: [@webdagger](https://github.com/webdagger), [@jiskim](https://github.com/jiskim)
40-
Version: 2.0.6
42+
Version: 2.0.7
4143

4244
## FEATURES
4345

package.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NovelScraper",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "App for downloading novels from pirate sites.",
55
"homepage": "https://github.com/HanaDigital/NovelScraper",
66
"author": {
@@ -17,6 +17,23 @@
1717
],
1818
"main": "main.js",
1919
"private": true,
20+
"build": {
21+
"productName": "NovelScraper",
22+
"buildVersion": "2.0.7",
23+
"files": ["**/*", "dist/**/*"],
24+
"directories": {
25+
"output": "release",
26+
"buildResources": "dist"
27+
},
28+
"win": {
29+
"icon": "dist/assets/icons/favicon.ico",
30+
"publish": ["github"],
31+
"target": ["nsis"]
32+
},
33+
"nsis": {
34+
"runAfterFinish": true
35+
}
36+
},
2037
"scripts": {
2138
"postinstall": "electron-builder install-app-deps",
2239
"ng": "ng",
@@ -104,4 +121,4 @@
104121
"rimraf": "3.0.2",
105122
"shelljs": "0.8.4"
106123
}
107-
}
124+
}

src/app/services/sources/novelfull.service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,16 @@ export class NovelfullService extends sourceService {
318318
/\(adsbygoogle = window.adsbygoogle \|\| \[\]\).push\({}\);/g,
319319
""
320320
);
321-
chapterBody = chapterBody.replace(/<script.*><\/script>/g, "");
322-
chapterBody = chapterBody.replace(/<ins.*<\/ins>/g, "");
321+
chapterBody = chapterBody.replace(/<script.*?<\/script>/g, "");
322+
chapterBody = chapterBody.replace(/<ins.*?<\/ins>/g, "");
323+
chapterBody = chapterBody.replace(/id=".*?"/g, "");
324+
chapterBody = chapterBody.replace(/class=".*?"/g, "");
325+
chapterBody = chapterBody.replace(/style=".*?"/g, "");
326+
chapterBody = chapterBody.replace(/data-.*?=".*?"/g, "");
323327

324328
const chapter = this.prepChapter(novel, downloadID, chapterTitle, chapterBody, downloadedChapters.length, totalLength);
325329
downloadedChapters.push(chapter);
330+
return;
326331
}
327332

328333
if (!canceled) this.novelFactory.generateEpub(novel, downloadedChapters, downloadID);

src/app/services/sources/sourceService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export class sourceService {
7777
currentPos: number,
7878
destPos: number
7979
): chapterObj {
80-
chapterBody = chapterBody.replace(/<script.*<\/script>/gi, ""); // Remove any script tags usually used with ads (Security+)
81-
chapterBody = chapterBody.replace(/<iframe.*<\/iframe>/gi, ""); // Remove any iframes usually used with ads
80+
chapterBody = chapterBody.replace(/<script.*?<\/script>/gi, ""); // Remove any script tags usually used with ads (Security+)
81+
chapterBody = chapterBody.replace(/<iframe.*?<\/iframe>/gi, ""); // Remove any iframes usually used with ads
8282
chapterBody = chapterBody.replace(/< *br *>/gi, "<br/>"); // Make sure all <br/> tags end correctly for xhtml
8383
chapterBody = chapterBody.replace(/<br *\/ *br *>/gi, ""); // Remove any useless </br> tags
8484
chapterBody = chapterBody.replace(

0 commit comments

Comments
 (0)