JustalK / ANIME-API

Api for searching page link, download link, streaming link of an anime and a precise episode on many website simultaneously. Only one search and you got the results from all animes websites.
MIT License
103 stars 23 forks source link

Cannot get property 'link' of undefined. #9

Open xaxa-0x3F opened 3 years ago

xaxa-0x3F commented 3 years ago
info: The url return a wrong status code. Maybe the website is down for the moment.
info: [object Object]
(node:1001) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'link' of undefined
    at Object.stream (/home/runner/ahega0/node_modules/@justalk/anime-api/src/animeland/search.js:32:74)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
    at async Object.stream (/home/runner/ahega0/node_modules/@justalk/anime-api/src/index.js:35:13)
    at async Command.callback [as _callback] (/home/runner/ahega0/commands/ani.js:30:18)
(node:1001) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1001) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info: The url return a wrong status code. Maybe the website is down for the moment.
info: [object Object]

Code I am calling:

const stream = await animeapi.stream('naruto shippuden', 387);

const embed = new MessageEmbed()
.setColor('#FFB6C1')
.setTitle(`Results for Naruto Shippuden | Episode 100`)
.setDescription(stream);
ABDERRAHMANE-OUALI commented 3 years ago

I has a sumilar issue

info: The url return a wrong status code. Maybe the website is down for the moment.
info: [object Object]
TypeError: Cannot read property 'link' of undefined
    at Object.stream (/home/andruxuis/Documents/Flutter/animecloud/functions/node_modules/@justalk/anime-api/src/chia-anime/search.js:28:63)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.download (/home/andruxuis/Documents/Flutter/animecloud/functions/node_modules/@justalk/anime-api/src/chia-anime/search.js:42:25)
    at async Promise.all (index 0)
    at async Object.download (/home/andruxuis/Documents/Flutter/animecloud/functions/node_modules/@justalk/anime-api/src/index.js:44:13)the code I'm using is:

const animeapi = require("@justalk/anime-api");

this is the code I wrote:


  const video = animeapi.download("black clover", 100);

  video
    .then((video) => console.log(video))
    .catch((error) => console.log(error));
JustalK commented 3 years ago

Welcome to this project,

I will look at it. The problem is some of those websites change quite often their dns origin, so it's a bit hard to keep up with them.