From 9fcc5ce8ed2666a7d95044db24be78e835be3a07 Mon Sep 17 00:00:00 2001 From: Ibrahim Ihusan Date: Thu, 8 Jun 2023 01:55:39 +0800 Subject: [PATCH 1/6] fix lnreader-sources --- src/sources/en/foxaholic.js | 5 +- src/sources/en/lightnovelpub.js | 13 +- src/sources/en/novelupdates.js | 19 ++- src/sources/id/indowebnovel.js | 113 ++++++++++-------- src/sources/id/sakuranovel.js | 12 +- src/sources/multisrc/madara/MadaraScraper.js | 5 +- .../wpmangastream/WPMangaStreamScraper.js | 19 +-- .../wqmangastream/WQMangaStreamGenerator.js | 1 + .../wqmangastream/WQMangaStreamScraper.js | 31 +++-- src/utils/fetch/fetch.ts | 5 +- 10 files changed, 131 insertions(+), 92 deletions(-) diff --git a/src/sources/en/foxaholic.js b/src/sources/en/foxaholic.js index 5daafda87..a8da70c65 100644 --- a/src/sources/en/foxaholic.js +++ b/src/sources/en/foxaholic.js @@ -85,10 +85,7 @@ const parseNovelAndChapters = async novelUrl => { } }); - loadedCheerio('.description-summary > div.summary__content') - .find('em') - .remove(); - + loadedCheerio('.description-summary > div.summary__content em').remove(); novel.summary = loadedCheerio('.description-summary > div.summary__content') .text() .trim(); diff --git a/src/sources/en/lightnovelpub.js b/src/sources/en/lightnovelpub.js index 1cf12ebb8..ecb20c87f 100644 --- a/src/sources/en/lightnovelpub.js +++ b/src/sources/en/lightnovelpub.js @@ -1,4 +1,4 @@ -import { fetchHtml } from '@utils/fetch/fetch'; +import { fetchApi, fetchHtml } from '@utils/fetch/fetch'; import * as cheerio from 'cheerio'; const sourceId = 15; const baseUrl = 'https://www.lightnovelpub.com/'; @@ -156,13 +156,22 @@ const parseChapter = async (novelUrl, chapterUrl) => { const searchNovels = async searchTerm => { const url = `${baseUrl}lnsearchlive`; + const link = `${baseUrl}search`; + const response = await fetchApi({ url: link, sourceId }).then(r => r.text()); + const token = cheerio.load(response); + let verifytoken = token('#novelSearchForm > input').attr('value'); let formData = new FormData(); formData.append('inputContent', searchTerm); const body = await fetchHtml({ url, - init: { method: 'POST', headers, body: formData }, + init: { + method: 'POST', + headers: { 'LNRequestVerifyToken': verifytoken }, + body: formData, + }, + sourceId, }); let loadedCheerio = cheerio.load(body); diff --git a/src/sources/en/novelupdates.js b/src/sources/en/novelupdates.js index cf49016e4..50ccb51ae 100644 --- a/src/sources/en/novelupdates.js +++ b/src/sources/en/novelupdates.js @@ -171,7 +171,7 @@ function getLocation(href) { const parseChapter = async (novelUrl, chapterUrl) => { const url = chapterUrl; - // console.log("Original URL: ", url); + // console.log('Original URL: ', url); let result, body; @@ -192,7 +192,7 @@ const parseChapter = async (novelUrl, chapterUrl) => { // console.log(result.url); - // console.log("Redirected URL: ", result.url); + // console.log('Redirected URL: ', result.url); const loadedCheerio = cheerio.load(body); @@ -204,12 +204,20 @@ const parseChapter = async (novelUrl, chapterUrl) => { let isWattpad = result.url.toLowerCase().includes('wattpad'); + let isLightNovelsTls = result.url + .toLowerCase() + .includes('lightnovelstranslations'); + + let isiNovelTranslation = result.url + .toLowerCase() + .includes('inoveltranslation'); + let isTravisTranslation = result.url .toLowerCase() .includes('travistranslations'); /** - * Checks if its a wwordpress site + * Checks if its a wordpress site */ let isWordPress = loadedCheerio('meta[name="generator"]').attr('content') || @@ -238,7 +246,6 @@ const parseChapter = async (novelUrl, chapterUrl) => { chapterText = loadedCheerio('.post').html(); } else if (isBlogspot) { loadedCheerio('.post-share-buttons').remove(); - chapterText = loadedCheerio('.entry-content').html(); } else if (isHostedNovel) { chapterText = loadedCheerio('.chapter').html(); @@ -248,6 +255,10 @@ const parseChapter = async (novelUrl, chapterUrl) => { chapterText = loadedCheerio('.container pre').html(); } else if (isTravisTranslation) { chapterText = loadedCheerio('.reader-content').html(); + } else if (isLightNovelsTls) { + chapterText = loadedCheerio('.text_story').html(); + } else if (isiNovelTranslation) { + chapterText = loadedCheerio('.chakra-skeleton').html(); } else if (isWordPress) { /** * Remove wordpress bloat tags diff --git a/src/sources/id/indowebnovel.js b/src/sources/id/indowebnovel.js index f5c3a7482..0409ed2bf 100644 --- a/src/sources/id/indowebnovel.js +++ b/src/sources/id/indowebnovel.js @@ -1,4 +1,5 @@ import * as cheerio from 'cheerio'; +import { fetchHtml } from '@utils/fetch/fetch'; const sourceId = 87; const sourceName = 'IndoWebNovel'; @@ -6,19 +7,23 @@ const sourceName = 'IndoWebNovel'; const baseUrl = 'http://indowebnovel.id/'; const popularNovels = async page => { - const url = `${baseUrl}daftar-novel/`; + const url = `${baseUrl}id/advanced-search/page/${page}/?title=&author=&yearx=&status=&type=&order=title&country[]=china&country[]=jepang&country[]=korea&country[]=unknown`; - const result = await fetch(url); - const body = await result.text(); + const body = await fetchHtml({ url, sourceId }); const loadedCheerio = cheerio.load(body); let novels = []; - loadedCheerio('.novellist-blc li').each(function () { - const novelName = loadedCheerio(this).find('a').text(); - const novelCover = null; - const novelUrl = loadedCheerio(this).find('a').attr('href'); + loadedCheerio('.flexbox2-item').each(function () { + const novelName = loadedCheerio(this) + .find('.flexbox2-title span') + .first() + .text(); + const novelCover = loadedCheerio(this).find('img').attr('src'); + const novelUrl = loadedCheerio(this) + .find('.flexbox2-content > a') + .attr('href'); const novel = { sourceId, @@ -34,48 +39,60 @@ const popularNovels = async page => { }; const parseNovelAndChapters = async novelUrl => { - const url = novelUrl; - - const result = await fetch(url); - const body = await result.text(); + const body = await fetchHtml({ url: novelUrl, sourceId }); let loadedCheerio = cheerio.load(body); let novel = { sourceId, sourceName, - url, + url: novelUrl, novelUrl, - novelName: '', - novelCover: '', - author: '', - status: '', - genre: '', - summary: '', - chapters: [], }; - novel.novelName = loadedCheerio('.series-title').text().trim(); + novel.novelName = loadedCheerio('.series-title h2').text().trim(); - novel.novelCover = loadedCheerio('.series-thumb > img').attr('src'); + novel.novelCover = loadedCheerio('.series-thumb img').attr('src'); - novel.summary = loadedCheerio('.series-synops').text().trim(); + loadedCheerio('.series-infolist > li').each(function () { + const detailName = loadedCheerio(this).find('b').text().trim(); + const detail = loadedCheerio(this).find('b').next().text().trim(); - novel.status = loadedCheerio('.status').text().trim(); + switch (detailName) { + case 'Author': + novel.author = detail; + break; + } + }); - novel.genre = []; + novel.status = loadedCheerio('.status').text().trim(); - loadedCheerio('.series-genres').each(function () { - novel.genre.push(loadedCheerio(this).find('a').text().trim()); - }); + novel.genre = loadedCheerio('.series-genres') + .children('a') + .map((i, el) => loadedCheerio(el).text()) + .toArray() + .join(','); - novel.genre = novel.genre.toString(); + loadedCheerio('.series-synops div').remove(); + novel.summary = loadedCheerio('.series-synops').text().trim(); let chapters = []; loadedCheerio('.series-chapterlist li').each(function () { - const chapterName = loadedCheerio(this).find('a').text().trim(); - const releaseDate = null; + const chapterName = loadedCheerio(this) + .find('a span') + .first() + .text() + .replace(/.*?(Chapter.|[0-9])/g, '$1') + .replace(/Bahasa Indonesia/g, '') + .replace(/\s+/g, ' ') + .trim(); + + const releaseDate = loadedCheerio(this) + .find('a span') + .first() + .next() + .text(); const chapterUrl = loadedCheerio(this).find('a').attr('href'); chapters.push({ chapterName, releaseDate, chapterUrl }); @@ -87,10 +104,7 @@ const parseNovelAndChapters = async novelUrl => { }; const parseChapter = async (novelUrl, chapterUrl) => { - const url = chapterUrl; - - const result = await fetch(url); - const body = await result.text(); + const body = await fetchHtml({ url: chapterUrl, sourceId }); let loadedCheerio = cheerio.load(body); @@ -109,30 +123,27 @@ const parseChapter = async (novelUrl, chapterUrl) => { }; const searchNovels = async searchTerm => { - const url = `${baseUrl}daftar-novel/`; + const url = `${baseUrl}id/?s=${searchTerm}`; - const result = await fetch(url); - const body = await result.text(); + const body = await fetchHtml({ url, sourceId }); - const loadedCheerio = cheerio.load(body); + let loadedCheerio = cheerio.load(body); let novels = []; - loadedCheerio('.novellist-blc li').each(function () { - const novelName = loadedCheerio(this).find('a').text(); - const novelCover = null; - const novelUrl = loadedCheerio(this).find('a').attr('href'); + loadedCheerio('.flexbox2-item').each(function () { + const novelName = loadedCheerio(this) + .find('.flexbox2-title span') + .first() + .text(); + const novelCover = loadedCheerio(this).find('img').attr('src'); + const novelUrl = loadedCheerio(this) + .find('.flexbox2-content > a') + .attr('href'); - const novel = { - sourceId, - novelName, - novelCover, - novelUrl, - }; + const novel = { sourceId, novelName, novelCover, novelUrl }; - if (novelName.toLowerCase().includes(searchTerm.toLowerCase())) { - novels.push(novel); - } + novels.push(novel); }); return novels; diff --git a/src/sources/id/sakuranovel.js b/src/sources/id/sakuranovel.js index bd4ca7d95..f8d476908 100644 --- a/src/sources/id/sakuranovel.js +++ b/src/sources/id/sakuranovel.js @@ -63,10 +63,12 @@ const parseNovelAndChapters = async novelUrl => { novel.status = loadedCheerio('.status').text().trim(); novel.genre = loadedCheerio('.series-genres') - .prop('innerHTML') - .replace(/<.*?>(.*?)<.*?>/g, '$1,') - .slice(0, -1); + .children('a') + .map((i, el) => loadedCheerio(el).text()) + .toArray() + .join(','); + loadedCheerio('.series-synops div').remove(); novel.summary = loadedCheerio('.series-synops').text().trim(); let chapters = []; @@ -76,8 +78,8 @@ const parseNovelAndChapters = async novelUrl => { .find('a span') .first() .text() - .replace(`${novel.novelName} – `, '') - .replace('Bahasa Indonesia', '') + .replace(/.*?(Chapter.|[0-9])/g, '$1') + .replace(/Bahasa Indonesia/g, '') .replace(/\s+/g, ' ') .trim(); diff --git a/src/sources/multisrc/madara/MadaraScraper.js b/src/sources/multisrc/madara/MadaraScraper.js index 223b10fb9..07079a43e 100644 --- a/src/sources/multisrc/madara/MadaraScraper.js +++ b/src/sources/multisrc/madara/MadaraScraper.js @@ -76,7 +76,7 @@ class MadaraScraper { loadedCheerio('.manga-title-badges').remove(); - novel.novelName = loadedCheerio('.post-title > h1').text().trim(); + novel.novelName = loadedCheerio('.post-title h1').text().trim(); novel.novelCover = loadedCheerio('.summary_image > a > img').attr('data-src') || @@ -109,6 +109,7 @@ class MadaraScraper { } }); + loadedCheerio('div.summary__content div').remove(); novel.summary = loadedCheerio('div.summary__content').text().trim(); let novelChapters = []; @@ -193,6 +194,8 @@ class MadaraScraper { loadedCheerio('.text-center').text() || loadedCheerio('#chapter-heading').text(); + loadedCheerio('.text-left div', '').remove(); + loadedCheerio('.text-right div').remove(); let chapterText = loadedCheerio('.text-left').html() || loadedCheerio('.text-right').html() || diff --git a/src/sources/multisrc/wpmangastream/WPMangaStreamScraper.js b/src/sources/multisrc/wpmangastream/WPMangaStreamScraper.js index 6adf49dc0..b9a9c637b 100644 --- a/src/sources/multisrc/wpmangastream/WPMangaStreamScraper.js +++ b/src/sources/multisrc/wpmangastream/WPMangaStreamScraper.js @@ -64,13 +64,7 @@ class WPMangaStreamScraper { loadedCheerio('div.spe > span').each(function () { const detailName = loadedCheerio(this).find('b').text().trim(); - const detail = loadedCheerio(this).find('b').next().text().trim(); - const status = loadedCheerio(this) - .children('b') //select all the children - .remove() //remove all the children - .end() //again go back to selected element - .text() - .trim(); + const detail = loadedCheerio(this).find('b').remove().end().text().trim(); switch (detailName) { case 'المؤلف:': @@ -81,20 +75,19 @@ class WPMangaStreamScraper { break; case 'Status:': case 'Seviye:': - novel.status = status; + novel.status = detail; break; } }); novel.genre = loadedCheerio('.genxed').text().trim().replace(/\s/g, ','); + loadedCheerio('div[itemprop="description"] h3,p.a,strong').remove(); novel.summary = loadedCheerio('div[itemprop="description"]') - .find('h3 , p.a') - .remove() + .find('br') + .replaceWith('\n') .end() - .prop('innerHTML') - .replace(/(<.*?>)/g, ' ') - .replace(/(&.*;)/g, '\n'); + .text(); let novelChapters = []; diff --git a/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js b/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js index 0f414a086..30b825c36 100644 --- a/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js +++ b/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js @@ -11,4 +11,5 @@ export const KolNovelScraper = new WQMangaStreamScraper( 53, 'https://kolnovel.com/', 'KolNovel', + { reverseChapters: true, ignoredStrings: true }, ); diff --git a/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js b/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js index d654c648f..22a6e1604 100644 --- a/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js +++ b/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js @@ -8,6 +8,7 @@ class WQMangaStreamScraper { this.sourceName = sourceName; this.language = options?.language; this.reverseChapters = options?.reverseChapters; + this.ignoredStrings = options?.ignoredStrings; } async popularNovels(page) { @@ -63,29 +64,31 @@ class WQMangaStreamScraper { loadedCheerio('img.wp-post-image').attr('data-src') || loadedCheerio('img.wp-post-image').attr('src'); - novel.status = loadedCheerio('div.sertostat > span').text().trim(); + novel.status = loadedCheerio('div.sertostat > span').attr('class'); loadedCheerio('div.serl:nth-child(3) > span').each(function () { const detailName = loadedCheerio(this).text().trim(); - const detail = loadedCheerio(this).next().prop('innerHTML'); + const detail = loadedCheerio(this).next().text().trim(); switch (detailName) { case 'الكاتب': case 'Author': - novel.author = detail.replace(/(.*?)<.*?>/g, '$1'); + novel.author = detail; break; } }); novel.genre = loadedCheerio('.sertogenre') - .prop('innerHTML') - .replace(/(.*?)<.*?>/g, '$1,') - .slice(0, -1); + .children('a') + .map((i, el) => loadedCheerio(el).text()) + .toArray() + .join(','); novel.summary = loadedCheerio('.sersys') - .prop('innerHTML') - .replace(/(<.*?>)/g, '') - .replace(/(&.*;)/g, '\n'); + .find('br') + .replaceWith('\n') + .end() + .text(); let novelChapters = []; @@ -123,7 +126,15 @@ class WQMangaStreamScraper { const loadedCheerio = cheerio.load(body); let chapterName = loadedCheerio('.entry-title').text(); - let chapterText = loadedCheerio('.epcontent').html(); + let chapterText = ''; + + if (this.ignoredStrings) { + let ignore = loadedCheerio('.epcontent > p').next().attr('class'); + loadedCheerio(`p.${ignore}`).remove(); + chapterText = loadedCheerio('.epcontent').html(); + } + + chapterText = loadedCheerio('.epcontent').html(); const chapter = { sourceId, diff --git a/src/utils/fetch/fetch.ts b/src/utils/fetch/fetch.ts index c5dcdf278..fa24ada92 100644 --- a/src/utils/fetch/fetch.ts +++ b/src/utils/fetch/fetch.ts @@ -14,10 +14,11 @@ export const cloudflareCheck = (text: string) => { if (text.length > 0) { if ( text.includes('Enable JavaScript and cookies to continue') || - text.includes('Checking if the site connection is secure') + text.includes('Checking if the site connection is secure') || + text.includes('Verify below to continue reading') ) { throw Error( - "The app couldn't bypass the source's Cloudflare protection.\n\nOpen the source in WebView to bypass the Cloudflare protection.", + "The app couldn't bypass the source's Cloudflare protection.\n\nOpen the source in WebView and complete the verification to bypass the Cloudflare protection.", ); } } From bdd1c3e8a97036c4e010d228a5d6ba53936c5e55 Mon Sep 17 00:00:00 2001 From: Ibrahim Ihusan Date: Thu, 8 Jun 2023 03:15:37 +0800 Subject: [PATCH 2/6] fix some novels with different summary paths --- src/sources/multisrc/madara/MadaraScraper.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sources/multisrc/madara/MadaraScraper.js b/src/sources/multisrc/madara/MadaraScraper.js index 07079a43e..ccb63aabb 100644 --- a/src/sources/multisrc/madara/MadaraScraper.js +++ b/src/sources/multisrc/madara/MadaraScraper.js @@ -84,10 +84,7 @@ class MadaraScraper { defaultCoverUri; loadedCheerio('.post-content_item').each(function () { - const detailName = loadedCheerio(this) - .find('.summary-heading > h5') - .text() - .trim(); + const detailName = loadedCheerio(this).find('h5').text().trim(); const detail = loadedCheerio(this).find('.summary-content').text().trim(); switch (detailName) { @@ -109,7 +106,7 @@ class MadaraScraper { } }); - loadedCheerio('div.summary__content div').remove(); + loadedCheerio('div.summary__content .code-block').remove(); novel.summary = loadedCheerio('div.summary__content').text().trim(); let novelChapters = []; @@ -194,8 +191,9 @@ class MadaraScraper { loadedCheerio('.text-center').text() || loadedCheerio('#chapter-heading').text(); - loadedCheerio('.text-left div', '').remove(); + loadedCheerio('.text-left div').remove(); loadedCheerio('.text-right div').remove(); + loadedCheerio('.entry-content .code-block').remove(); let chapterText = loadedCheerio('.text-left').html() || loadedCheerio('.text-right').html() || From 84855865644e14e75c0b85e6f8191677d7ddb901 Mon Sep 17 00:00:00 2001 From: K1ngfish3r Date: Thu, 8 Jun 2023 11:17:43 +0500 Subject: [PATCH 3/6] Update MadaraScraper.js Fix Riwyat and other Arabic sources --- src/sources/multisrc/madara/MadaraScraper.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sources/multisrc/madara/MadaraScraper.js b/src/sources/multisrc/madara/MadaraScraper.js index ccb63aabb..7b84d3d5d 100644 --- a/src/sources/multisrc/madara/MadaraScraper.js +++ b/src/sources/multisrc/madara/MadaraScraper.js @@ -191,9 +191,14 @@ class MadaraScraper { loadedCheerio('.text-center').text() || loadedCheerio('#chapter-heading').text(); - loadedCheerio('.text-left div').remove(); - loadedCheerio('.text-right div').remove(); - loadedCheerio('.entry-content .code-block').remove(); + if (loadedCheerio('.text-right')){ + loadedCheerio('.text-right div').remove(); + } else if (loadedCheerio('.text-left')){ + loadedCheerio('.text-left div').remove(); + } else if (loadedCheerio('.entry-content')){ + loadedCheerio('.entry-content div').remove(); + } + let chapterText = loadedCheerio('.text-left').html() || loadedCheerio('.text-right').html() || From fca51d92f31a1c66882b0c2fc835e73132d42cc8 Mon Sep 17 00:00:00 2001 From: Ibrahim Ihusan Date: Fri, 9 Jun 2023 03:06:54 +0800 Subject: [PATCH 4/6] eslint check --- src/sources/multisrc/madara/MadaraScraper.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sources/multisrc/madara/MadaraScraper.js b/src/sources/multisrc/madara/MadaraScraper.js index 7b84d3d5d..6370ba0cc 100644 --- a/src/sources/multisrc/madara/MadaraScraper.js +++ b/src/sources/multisrc/madara/MadaraScraper.js @@ -83,7 +83,7 @@ class MadaraScraper { loadedCheerio('.summary_image > a > img').attr('src') || defaultCoverUri; - loadedCheerio('.post-content_item').each(function () { + loadedCheerio('.post-content_item', '.post-content').each(function () { const detailName = loadedCheerio(this).find('h5').text().trim(); const detail = loadedCheerio(this).find('.summary-content').text().trim(); @@ -191,11 +191,11 @@ class MadaraScraper { loadedCheerio('.text-center').text() || loadedCheerio('#chapter-heading').text(); - if (loadedCheerio('.text-right')){ + if (loadedCheerio('.text-right')) { loadedCheerio('.text-right div').remove(); - } else if (loadedCheerio('.text-left')){ + } else if (loadedCheerio('.text-left')) { loadedCheerio('.text-left div').remove(); - } else if (loadedCheerio('.entry-content')){ + } else if (loadedCheerio('.entry-content')) { loadedCheerio('.entry-content div').remove(); } From 7491245ce8d955558514f6734a1b8a89dfd5afd8 Mon Sep 17 00:00:00 2001 From: Ibrahim Ihusan Date: Sun, 11 Jun 2023 01:25:09 +0800 Subject: [PATCH 5/6] remove ignoredStrings, target sourceid instead --- .../multisrc/wqmangastream/WQMangaStreamGenerator.js | 2 +- src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js b/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js index 30b825c36..967de93e8 100644 --- a/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js +++ b/src/sources/multisrc/wqmangastream/WQMangaStreamGenerator.js @@ -11,5 +11,5 @@ export const KolNovelScraper = new WQMangaStreamScraper( 53, 'https://kolnovel.com/', 'KolNovel', - { reverseChapters: true, ignoredStrings: true }, + { reverseChapters: true }, ); diff --git a/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js b/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js index 22a6e1604..fc2999800 100644 --- a/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js +++ b/src/sources/multisrc/wqmangastream/WQMangaStreamScraper.js @@ -8,7 +8,6 @@ class WQMangaStreamScraper { this.sourceName = sourceName; this.language = options?.language; this.reverseChapters = options?.reverseChapters; - this.ignoredStrings = options?.ignoredStrings; } async popularNovels(page) { @@ -126,16 +125,14 @@ class WQMangaStreamScraper { const loadedCheerio = cheerio.load(body); let chapterName = loadedCheerio('.entry-title').text(); - let chapterText = ''; + let chapterText = loadedCheerio('.epcontent').html(); - if (this.ignoredStrings) { + if (sourceId === 53) { let ignore = loadedCheerio('.epcontent > p').next().attr('class'); loadedCheerio(`p.${ignore}`).remove(); chapterText = loadedCheerio('.epcontent').html(); } - chapterText = loadedCheerio('.epcontent').html(); - const chapter = { sourceId, novelUrl, From 9524e9e891a4766825384bfca97c8c2e023b0820 Mon Sep 17 00:00:00 2001 From: Ibrahim Ihusan Date: Wed, 14 Jun 2023 21:16:45 +0800 Subject: [PATCH 6/6] fix fastnovel --- src/sources/en/fastnovel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sources/en/fastnovel.js b/src/sources/en/fastnovel.js index fa1724f2b..ba32cae53 100644 --- a/src/sources/en/fastnovel.js +++ b/src/sources/en/fastnovel.js @@ -78,7 +78,7 @@ const parseNovelAndChapters = async novelUrl => { const novelId = loadedCheerio('#rating').attr('data-novel-id'); const getChapters = async id => { - const chapterListUrl = baseUrl + '/ajax/chapter-option?novelId=' + id; + const chapterListUrl = baseUrl + '/ajax/chapter-archive?novelId=' + id; const data = await fetch(chapterListUrl); const chapters = await data.text();