ComradeMao: Fix chapterUrl (Closes #34)

This commit is contained in:
Rajarshee Chatterjee
2021-06-15 15:27:33 +05:30
parent cfeca542e6
commit f9a915778b
+12 -1
View File
@@ -84,6 +84,17 @@ const novelScraper = async (req, res) => {
let novelChapters = [];
let chapterUrlPrefix = $("tbody > tr")
.first()
.next()
.find("td > a")
.text()
.split(" ");
chapterUrlPrefix.pop();
chapterUrlPrefix = chapterUrlPrefix.join("-").toLowerCase();
const latestChapter = $("tbody > tr")
.first()
.next()
@@ -94,7 +105,7 @@ const novelScraper = async (req, res) => {
for (let i = 1; i <= latestChapter; i++) {
const chapterName = "Chapter " + i;
const releaseDate = null;
const chapterUrl = novelUrl + "-chapter-" + i + "/";
const chapterUrl = chapterUrlPrefix + "-" + i + "/";
const chapter = {
chapterName,