async function searchResults(keyword) {
const results = [];
try {
const response = await fetchv2("https://www.tokyoinsider.com/anime/search?k=" + encodeURIComponent(keyword));
const html = await response.text();
const regex = /]*><\/a>[\s\S]*?([^<]*(?:]*>[^<]*<\/span>[^<]*)*)<\/a>/g;
let match;
while ((match = regex.exec(html)) !== null) {
const titleText = match[3].replace(/(.*?)<\/span>/g, '$1').replace(/ /g, ' ');
results.push({
title: titleText.trim(),
image: match[1].trim(),
href: match[2].trim()
});
}
return JSON.stringify(results);
} catch (err) {
return JSON.stringify([{
title: "Error",
image: "Error",
href: "Error"
}]);
}
}
async function extractDetails(slug) {
try {
const response = await fetchv2("https://www.tokyoinsider.com" + slug);
const html = await response.text();
let titles = "N/A";
let airdate = "N/A";
let description = "N/A";
const titlesMatch = html.match(/