lacymorrow / movie-trailer

📽 Fetch movie trailers: "Crash" ➔ http://path/to/trailer
https://www.npmjs.com/package/movie-trailer
MIT License
33 stars 8 forks source link

Giving error while fetching trailer of movie from YouTube #7

Closed chaudhariyash10 closed 3 years ago

chaudhariyash10 commented 3 years ago

Error: JSON - The resource you requested could not be found. at 0.chunk.js:572

lacymorrow commented 3 years ago

Thank you for posting the error log! Will look into this

lacymorrow commented 3 years ago

@chaudhariyash10 Do you know what the search term was?

chaudhariyash10 commented 3 years ago

I am not sure what search term are you asking for, but I was trying to fetch the trailer of "Fate: the Winx Saga" .

chaudhariyash10 commented 3 years ago

Here's the url that is being generated while fetching the trailer. And I am not sure why it contains Error: API No results found .https://api.themoviedb.org/3/movie/Error:%20API%20-%20No%20results%20found/videos?api_key=API_KEY

lacymorrow commented 3 years ago

@chaudhariyash10 Thank you! I really appreciate you posting steps to reproduce, I think I know what the issue is. There are two calls to TMDB, one to fetch the ID using the provided search term and another to fetch the trailers. It looks like the error handling isn't working on the first fetch and the error is getting passed to the second request as if it was the ID.

I'll try to get this fixed tonight

lacymorrow commented 3 years ago

Fixed in the latest version, 2.1.0: https://github.com/lacymorrow/movie-trailer/releases/latest

Thank you for reporting!