]*>\s*\s*Chapter (\d+)<\/strong>/g;
let match;
while ((match = regex.exec(chapHtml)) !== null) {
const chapterUrl = "https://mangabuddy.com" + 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 images = match[1].split(',');
const processedImages = images.map(img => "https://passthrough-worker.simplepostrequest.workers.dev/?simple=" + img.trim() + "?referrer=https://mangabuddy.com");
results.push(...processedImages);
}
return results;
} catch (err) {
return [];
}
}