\s*Chapter \2<\/strong>/g;
let match;
while ((match = regex.exec(html)) !== null) {
const chapterUrl = "https://kaliscan.io" + match[1];
const chapterNum = match[2];
results.push([
String(chapterNum),
[{
id: chapterUrl,
chapter: parseInt(chapterNum),
scanlation_group: `Chapter ${chapterNum}`
}]
]);
}
results.reverse();
return { en: results };
} catch (err) {
return { en: [] };
}
}
async function getChapterImages(url) {
const results = [];
try {
const response = await fetch(url);
const html = await response.text();
const regex = /var chapImages = "([^"]*)"/;
const match = regex.exec(html);
if (match) {
const imagesString = match[1];
const images = imagesString.split(',');
results.push(...images);
}
return results;
} catch (err) {
return [];
}
}