/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// Main Functions ////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// async function searchResults(keyword) { try { const encodedKeyword = encodeURIComponent(keyword); const searchApiUrl = `https://aniworld.to/ajax/seriesSearch?keyword=${encodedKeyword}`; const responseText = await fetch(searchApiUrl); const data = await JSON.parse(responseText); const transformedResults = data.map((anime) => ({ title: anime.name, image: `https://aniworld.to${anime.cover}`, href: `https://aniworld.to/anime/stream/${anime.link}`, })); return JSON.stringify(transformedResults); } catch (error) { console.log("Fetch error:" + error); return JSON.stringify([{ title: "Error", image: "", href: "" }]); } } async function extractDetails(url) { try { const fetchUrl = `${url}`; const text = await fetch(fetchUrl); const descriptionRegex = /
(.*?)<\/p>/s; const aliasesRegex = /