From 21dd90f44d64536a2c74ec5c4077c674b497ee4b Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Sun, 12 Oct 2025 22:08:11 +0000 Subject: [PATCH] Update aniliberty/aniliberty.js --- aniliberty/aniliberty.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/aniliberty/aniliberty.js b/aniliberty/aniliberty.js index 62b190e..0aa7f7c 100644 --- a/aniliberty/aniliberty.js +++ b/aniliberty/aniliberty.js @@ -1,12 +1,11 @@ // AniLiberty module for Sora (AsyncJS) // Author: emp0ry -// Version: 1.0.3 -// Changes: add skip markers (opening/ending) and average_duration_of_episode -> "Duration: Xm". +// Version: 1.0.1 const IMAGE_HOST = "https://anilibria.top"; function fullImg(path) { - if (!path) return `${IMAGE_HOST}/favicon.ico`; + if (!path) return; return path.startsWith("http") ? path : `${IMAGE_HOST}${path}`; } @@ -47,7 +46,6 @@ async function searchResults(keyword) { const out = (Array.isArray(data) ? data : []).map(it => ({ title: it?.name?.main || "Unknown title", image: fullImg(it?.poster?.src), - // Pass a details endpoint as href (will be reused by details/episodes) href: `${base}anime/releases/${it.id}?` + [ @@ -61,16 +59,11 @@ async function searchResults(keyword) { })); if (!out.length) { - out.push({ - title: "No results from AniLiberty", - image: `${IMAGE_HOST}/favicon.ico`, - href: IMAGE_HOST - }); + return JSON.stringify([]);; } return JSON.stringify(out); } catch (e) { - console.log("AniLiberty search error:", e); - return JSON.stringify([{ title: "Error", image: `${IMAGE_HOST}/favicon.ico`, href: IMAGE_HOST }]); + return JSON.stringify([]);; } } @@ -94,12 +87,7 @@ async function extractDetails(url) { }]; return JSON.stringify(out); } catch (e) { - console.log("AniLiberty details error:", e); - return JSON.stringify([{ - description: "Error loading details", - aliases: "Duration: Unknown", - airdate: "Unknown" - }]); + return JSON.stringify([]);; } } @@ -151,7 +139,6 @@ async function extractEpisodes(url) { return JSON.stringify(out); } catch (e) { - console.log("AniLiberty episodes error:", e); return JSON.stringify([]); } } @@ -163,7 +150,6 @@ async function extractStreamUrl(url) { try { return url; // direct HLS } catch (e) { - console.log("AniLiberty stream error:", e); return null; } -} +} \ No newline at end of file