mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 13:16:21 +01:00
77 lines
1.6 KiB
JavaScript
77 lines
1.6 KiB
JavaScript
async function searchContent(keyword, page=0) {
|
|
const results = [];
|
|
try {
|
|
const regex = /REGEX_PATTERN/g;
|
|
|
|
let match;
|
|
while ((match = regex.exec(html)) !== null) {
|
|
results.push({
|
|
id: match[1].trim(),
|
|
imageURL: match[2].trim(),
|
|
title: match[3].trim()
|
|
});
|
|
}
|
|
|
|
return results;
|
|
} catch (err) {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
async function getContentData(url) {
|
|
try {
|
|
const regex = /REGEX_PATTERN/g;
|
|
|
|
return {
|
|
description: "",
|
|
tags: []
|
|
};
|
|
} catch (err) {
|
|
return {
|
|
description: "Error",
|
|
tags: []
|
|
};
|
|
}
|
|
}
|
|
|
|
async function getChapters(url) {
|
|
const results = [];
|
|
try {
|
|
const regex = /REGEX_PATTERN/g;
|
|
let match;
|
|
let index = 0;
|
|
|
|
while ((match = regex.exec(html)) !== null) {
|
|
results.push([
|
|
String(index),
|
|
[{
|
|
id: match[1].trim(),
|
|
title: match[2].trim(),
|
|
chapter: index,
|
|
scanlation_group: ""
|
|
}]
|
|
]);
|
|
index++;
|
|
}
|
|
|
|
return { en: results };
|
|
} catch (err) {
|
|
return { en: [] };
|
|
}
|
|
}
|
|
|
|
async function getChapterImages(url) {
|
|
const results = [];
|
|
try {
|
|
const regex = /REGEX_PATTERN/g;
|
|
|
|
let match;
|
|
while ((match = regex.exec(html)) !== null) {
|
|
results.push(match[1].trim());
|
|
}
|
|
|
|
return results;
|
|
} catch (err) {
|
|
return [];
|
|
}
|
|
}
|