diff --git a/package.json b/package.json index f5de22ce..159a6642 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "novelscraper", - "version": "1.0.7", + "version": "1.0.8", "description": "Educational app on how to web scrape novels from pirate sites.", "homepage": "https://github.com/dr-nyt/NovelScraper", "author": { diff --git a/src/app/boxnovel-source/boxnovel-source.component.html b/src/app/boxnovel-source/boxnovel-source.component.html index f94a2ae5..97abdc89 100644 --- a/src/app/boxnovel-source/boxnovel-source.component.html +++ b/src/app/boxnovel-source/boxnovel-source.component.html @@ -1,28 +1,76 @@
-

BoxNovel

- +

BoxNovel

+
- - -

LOADING

+ + +

+ LOADING +

-
-
- -
-

{{novel.info.name}}

-
+
+
+ +
+

{{ novel.info.name }}

+
diff --git a/src/app/boxnovel.service.ts b/src/app/boxnovel.service.ts index 66d59a48..e2e1fec6 100644 --- a/src/app/boxnovel.service.ts +++ b/src/app/boxnovel.service.ts @@ -93,8 +93,11 @@ export class BoxnovelService { let chapterBody = "

" + chapterTitle + "

"; chapterBody += chapterHtml.outerHTML; - chapterBody = chapterBody.replace(/
/g, "
"); - console.log(chapterBody); + chapterBody = chapterBody.replace(/< *br *>/gi, "
"); // Make sure all
tags end correctly for xhtml + chapterBody = chapterBody.replace(/
/gi, ""); // Remove any useless
tags + chapterBody = chapterBody.replace(/(])*)>/gi, "$1/>"); // Make sure img tag ends correctly for xhtml + + // Add propoganda chapterBody += "

" chapterBody += "

dr-nyt's NovelScraper scraped this novel from a pirate site.

" chapterBody += "

If you can, please support the author(s) of this novel: " + novel.info.author + "

" @@ -110,6 +113,7 @@ export class BoxnovelService { } catch (error) { console.log(error); + return false; } } diff --git a/src/app/novel/novel.component.ts b/src/app/novel/novel.component.ts index 51d46c7f..4138018c 100644 --- a/src/app/novel/novel.component.ts +++ b/src/app/novel/novel.component.ts @@ -128,6 +128,8 @@ export class NovelComponent implements OnInit { this.downloaded = true; this.novelplanetService.updateDownloaded(this.novel.info.link, true); }); + } else { + this.downloading = false; } }); } else if (this.novel.info.source == 'boxnovel') { @@ -141,6 +143,8 @@ export class NovelComponent implements OnInit { this.downloaded = true; this.boxnovelService.updateDownloaded(this.novel.info.link, true); }); + } else { + this.downloading = false; } }); } else if (this.novel.info.source == 'readlightnovel') { @@ -154,6 +158,8 @@ export class NovelComponent implements OnInit { this.downloaded = true; this.readlightnovelService.updateDownloaded(this.novel.info.link, true); }); + } else { + this.downloading = false; } }); } diff --git a/src/app/readlightnovel.service.ts b/src/app/readlightnovel.service.ts index 57dbc073..ef64d273 100644 --- a/src/app/readlightnovel.service.ts +++ b/src/app/readlightnovel.service.ts @@ -81,6 +81,7 @@ export class ReadlightnovelService { try { // let stringHtml = await this.getHtmlString("https://www.readlightnovel.org/overlord-ln/volume-8/chapter-"); let stringHtml = await this.getHtmlString(chapterLinks[i]); + stringHtml = stringHtml.replace(//i, ""); let pageHtml = new DOMParser().parseFromString(stringHtml, 'text/html'); let chapterHtml = pageHtml.getElementsByClassName('desc')[0].getElementsByClassName("hidden")[0]; @@ -88,8 +89,11 @@ export class ReadlightnovelService { let chapterBody = "

" + chapterTitle + "

"; chapterBody += chapterHtml.outerHTML; - chapterBody = chapterBody.replace(/
/g, "
"); - console.log(chapterBody); + chapterBody = chapterBody.replace(/< *br *>/gi, "
"); // Make sure all
tags end correctly for xhtml + chapterBody = chapterBody.replace(/
/gi, ""); // Remove any useless
tags + chapterBody = chapterBody.replace(/(])*)>/gi, "$1/>"); // Make sure img tag ends correctly for xhtml + + // Add propoganda chapterBody += "

" chapterBody += "

dr-nyt's NovelScraper scraped this novel from a pirate site.

" chapterBody += "

If you can, please support the author(s) of this novel: " + novel.info.author + "

" @@ -113,6 +117,7 @@ export class ReadlightnovelService { } catch (error) { console.log(error); + return false; } }