Skip to content

Commit

Permalink
Merge pull request #68 from HanaDigital/version-2.0.0
Browse files Browse the repository at this point in the history
Fixed empty chapters on NovelFull
  • Loading branch information
dr-nyt authored Mar 5, 2024
2 parents a037a9d + 9e9a99a commit 0b455ca
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@

## ABOUT


Download and update translated web/light novels from a list of 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](https://github.com/dr-nyt)
Contributors: [@webdagger](https://github.com/webdagger), [@jiskim](https://github.com/jiskim)
Version: 2.0.6
Version: 2.0.7

## FEATURES

Expand Down
21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down Expand Up @@ -104,4 +121,4 @@
"rimraf": "3.0.2",
"shelljs": "0.8.4"
}
}
}
9 changes: 7 additions & 2 deletions src/app/services/sources/novelfull.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,16 @@ export class NovelfullService extends sourceService {
/\(adsbygoogle = window.adsbygoogle \|\| \[\]\).push\({}\);/g,
""
);
chapterBody = chapterBody.replace(/<script.*><\/script>/g, "");
chapterBody = chapterBody.replace(/<ins.*<\/ins>/g, "");
chapterBody = chapterBody.replace(/<script.*?<\/script>/g, "");
chapterBody = chapterBody.replace(/<ins.*?<\/ins>/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);
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/sources/sourceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export class sourceService {
currentPos: number,
destPos: number
): chapterObj {
chapterBody = chapterBody.replace(/<script.*<\/script>/gi, ""); // Remove any script tags usually used with ads (Security+)
chapterBody = chapterBody.replace(/<iframe.*<\/iframe>/gi, ""); // Remove any iframes usually used with ads
chapterBody = chapterBody.replace(/<script.*?<\/script>/gi, ""); // Remove any script tags usually used with ads (Security+)
chapterBody = chapterBody.replace(/<iframe.*?<\/iframe>/gi, ""); // Remove any iframes usually used with ads
chapterBody = chapterBody.replace(/< *br *>/gi, "<br/>"); // Make sure all <br/> tags end correctly for xhtml
chapterBody = chapterBody.replace(/<br *\/ *br *>/gi, ""); // Remove any useless </br> tags
chapterBody = chapterBody.replace(
Expand Down

0 comments on commit 0b455ca

Please sign in to comment.