diff --git a/src/sources/en/noveltrench.js b/src/sources/en/noveltrench.js index 530a2399..f1516a6f 100644 --- a/src/sources/en/noveltrench.js +++ b/src/sources/en/noveltrench.js @@ -1,9 +1,9 @@ import * as cheerio from 'cheerio'; -const baseUrl = 'https://noveltrench.com/'; +const baseUrl = 'https://novelhard.com/'; const popularNovels = async page => { let totalPages = 270; - let url = baseUrl + 'manga/page/' + page; + let url = baseUrl + 'novel/page/' + page; const result = await fetch(url); const body = await result.text(); @@ -17,7 +17,7 @@ const popularNovels = async page => { const novelCover = loadedCheerio(this).find('img').attr('data-src'); let novelUrl = loadedCheerio(this).find('.h5 > a').attr('href'); - novelUrl = novelUrl.replace(`${baseUrl}manga/`, ''); + novelUrl = novelUrl.replace(`${baseUrl}novel/`, ''); const novel = { sourceId: 9, @@ -33,7 +33,7 @@ const popularNovels = async page => { }; const parseNovelAndChapters = async novelUrl => { - const url = `${baseUrl}manga/${novelUrl}`; + const url = `${baseUrl}novel/${novelUrl}`; const result = await fetch(url); const body = await result.text(); @@ -123,7 +123,7 @@ const parseNovelAndChapters = async novelUrl => { }; const parseChapter = async (novelUrl, chapterUrl) => { - const url = `${baseUrl}manga/${novelUrl}${chapterUrl}`; + const url = `${baseUrl}novel/${novelUrl}${chapterUrl}`; const result = await fetch(url); const body = await result.text(); @@ -158,7 +158,7 @@ const searchNovels = async searchTerm => { const novelCover = loadedCheerio(this).find('img').attr('data-src'); let novelUrl = loadedCheerio(this).find('.h4 > a').attr('href'); - novelUrl = novelUrl.replace(`${baseUrl}manga/`, ''); + novelUrl = novelUrl.replace(`${baseUrl}novel/`, ''); const novel = { sourceId: 9, diff --git a/src/sources/en/readlightnovel.ts b/src/sources/en/readlightnovel.ts index 5ac62065..10b59062 100644 --- a/src/sources/en/readlightnovel.ts +++ b/src/sources/en/readlightnovel.ts @@ -34,7 +34,7 @@ const popularNovels = async (page: number, options?: SourceOptions) => { ?.split('/') .pop(); - totalPages = isNumber(totalPages) ? totalPages : 1; + totalPages = Number(totalPages) || 1; loadedCheerio('.top-novel-block').each(function () { const novelUrl = loadedCheerio(this)