diff --git a/animeworld/animeworld.js b/animeworld/animeworld.js
index 0582d14..1914ddd 100644
--- a/animeworld/animeworld.js
+++ b/animeworld/animeworld.js
@@ -1,179 +1,166 @@
async function searchResults(keyword) {
- const results = [];
- const baseUrl = "https://animeworld.ac";
-
- try {
- const response = await soraFetch(
- `${baseUrl}/search?keyword=${encodeURIComponent(keyword)}`
- );
- const html = await response.text();
-
- const filmListRegex =
- /
([\s\S]*?)
<\/div>\s*<\/div>/;
- const filmListMatch = html.match(filmListRegex);
-
- if (!filmListMatch) {
- return JSON.stringify(results);
- }
-
- const filmListContent = filmListMatch[1];
- const itemRegex = /
[\s\S]*?<\/div>[\s]*<\/div>/g;
- const items = filmListContent.match(itemRegex) || [];
-
- items.forEach((itemHtml) => {
- const imgMatch = itemHtml.match(/src="([^"]+)"/);
- let imageUrl = imgMatch ? imgMatch[1] : "";
-
- const titleMatch = itemHtml.match(/class="name">([^<]+));
- const title = titleMatch ? titleMatch[1] : "";
-
- const hrefMatch = itemHtml.match(/href="([^"]+)"/);
- let href = hrefMatch ? hrefMatch[1] : "";
-
- if (imageUrl && title && href) {
- if (!imageUrl.startsWith("https")) {
- if (imageUrl.startsWith("/")) {
- imageUrl = baseUrl + imageUrl;
- } else {
- imageUrl = baseUrl + "/" + href;
- }
+ const results = [];
+ const baseUrl = "https://animeworld.ac";
+
+ try {
+ const response = await soraFetch(`${baseUrl}/search?keyword=${encodeURIComponent(keyword)}`);
+ const html = await response.text();
+
+ const filmListRegex =
+ /
([\s\S]*?)
<\/div>\s*<\/div>/;
+ const filmListMatch = html.match(filmListRegex);
+
+ if (!filmListMatch) {
+ return JSON.stringify(results);
}
- if (!href.startsWith("https")) {
- if (href.startsWith("/")) {
- href = baseUrl + href;
- } else {
- href = baseUrl + "/" + href;
- }
- }
- results.push({
- title: title.trim(),
- image: imageUrl,
- href: href,
+
+ const filmListContent = filmListMatch[1];
+ const itemRegex = /
[\s\S]*?<\/div>[\s]*<\/div>/g;
+ const items = filmListContent.match(itemRegex) || [];
+
+ items.forEach((itemHtml) => {
+ const imgMatch = itemHtml.match(/src="([^"]+)"/);
+ let imageUrl = imgMatch ? imgMatch[1] : "";
+
+ const titleMatch = itemHtml.match(/class="name">([^<]+));
+ const title = titleMatch ? titleMatch[1] : "";
+
+ const hrefMatch = itemHtml.match(/href="([^"]+)"/);
+ let href = hrefMatch ? hrefMatch[1] : "";
+
+ if (imageUrl && title && href) {
+ if (!imageUrl.startsWith("https")) {
+ if (imageUrl.startsWith("/")) {
+ imageUrl = baseUrl + imageUrl;
+ } else {
+ imageUrl = baseUrl + "/" + href;
+ }
+ }
+ if (!href.startsWith("https")) {
+ if (href.startsWith("/")) {
+ href = baseUrl + href;
+ } else {
+ href = baseUrl + "/" + href;
+ }
+ }
+ results.push({
+ title: title.trim(),
+ image: imageUrl,
+ href: href,
+ });
+ }
});
- }
- });
-
- console.log(JSON.stringify(results));
- return JSON.stringify(results);
- } catch (error) {
- console.log("Search error:", error);
- return JSON.stringify([]);
- }
+
+ console.log(JSON.stringify(results));
+ return JSON.stringify(results);
+ } catch (error) {
+ console.log("Search error:", error);
+ return JSON.stringify([]);
+ }
}
async function extractDetails(url) {
- try {
- const response = await soraFetch(url);
- const html = await response.text();
-
- const details = [];
-
- const descriptionMatch = html.match(/