From 7f881b89a5698d8fe69133bb554bfced282e6840 Mon Sep 17 00:00:00 2001 From: Rajarshee Chatterjee Date: Wed, 28 Apr 2021 10:29:13 +0530 Subject: [PATCH] novelhall: fix novel chapters --- src/en/novelhall/novelhall.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/en/novelhall/novelhall.js b/src/en/novelhall/novelhall.js index 3b334aa..7141795 100644 --- a/src/en/novelhall/novelhall.js +++ b/src/en/novelhall/novelhall.js @@ -80,23 +80,25 @@ router.get("/novel/:novelUrl", (req, res) => { let novelChapters = []; - $("li.post-11").each(function (result) { - let chapterName = $(this).find("a").text(); + $("div.book-catalog.hidden-xs#morelist") + .find("li.post-11") + .each(function (result) { + let chapterName = $(this).find("a").text(); - let releaseDate = null; + let releaseDate = null; - let chapterUrl = $(this).find("a").attr("href"); + let chapterUrl = $(this).find("a").attr("href"); - if (chapterUrl) { - chapterUrl = chapterUrl.replace(`/${novelUrl}/`, ""); - } + if (chapterUrl) { + chapterUrl = chapterUrl.replace(`/${novelUrl}/`, ""); + } - novelChapters.push({ - chapterName, - releaseDate, - chapterUrl, + novelChapters.push({ + chapterName, + releaseDate, + chapterUrl, + }); }); - }); novel.novelChapters = novelChapters;