This commit is contained in:
@@ -147,7 +147,7 @@ async function searchResults(keyword) {
|
|||||||
|
|
||||||
async function extractDetails(url) {
|
async function extractDetails(url) {
|
||||||
try {
|
try {
|
||||||
const slug = url.split('/').pop();
|
const slug = url.split('/').filter(Boolean).pop();
|
||||||
const response = await fetchSigned(`/api/v1/anime/${slug}`);
|
const response = await fetchSigned(`/api/v1/anime/${slug}`);
|
||||||
const text = typeof response.text === 'function' ? await response.text() : response;
|
const text = typeof response.text === 'function' ? await response.text() : response;
|
||||||
const data = JSON.parse(text);
|
const data = JSON.parse(text);
|
||||||
@@ -155,7 +155,7 @@ async function extractDetails(url) {
|
|||||||
return JSON.stringify([{
|
return JSON.stringify([{
|
||||||
description: data.synopsis || "N/A",
|
description: data.synopsis || "N/A",
|
||||||
aliases: data.alternativeTitle || "N/A",
|
aliases: data.alternativeTitle || "N/A",
|
||||||
airdate: data.premiered || "N/A"
|
airdate: data.premiered || data.ratingLabel || "N/A"
|
||||||
}]);
|
}]);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return JSON.stringify([{
|
return JSON.stringify([{
|
||||||
@@ -168,7 +168,7 @@ async function extractDetails(url) {
|
|||||||
|
|
||||||
async function extractEpisodes(url) {
|
async function extractEpisodes(url) {
|
||||||
try {
|
try {
|
||||||
const slug = url.split('/').pop();
|
const slug = url.split('/').filter(Boolean).pop();
|
||||||
const response = await fetchSigned(`/api/v1/anime/${slug}`);
|
const response = await fetchSigned(`/api/v1/anime/${slug}`);
|
||||||
const text = typeof response.text === 'function' ? await response.text() : response;
|
const text = typeof response.text === 'function' ? await response.text() : response;
|
||||||
const data = JSON.parse(text);
|
const data = JSON.parse(text);
|
||||||
@@ -189,7 +189,7 @@ async function extractEpisodes(url) {
|
|||||||
|
|
||||||
async function extractStreamUrl(url) {
|
async function extractStreamUrl(url) {
|
||||||
try {
|
try {
|
||||||
const parts = url.split('/');
|
const parts = url.split('/').filter(Boolean);
|
||||||
const episodeNumber = parts.pop();
|
const episodeNumber = parts.pop();
|
||||||
const slug = parts.pop();
|
const slug = parts.pop();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user