diff --git a/examples/index.js b/examples/index.js index bf82de5d..685733d3 100644 --- a/examples/index.js +++ b/examples/index.js @@ -9,7 +9,10 @@ async function start() { // Searching, getting details about videos & making interactions: const search = await youtube.search('Looking for life on Mars - documentary'); console.info('Search results:', search); - + + if (search.videos.length === 0) + return console.info('[INFO]', 'Could not find any video about that on YouTube.'); + const video = await youtube.getDetails(search.videos[0].id); console.info('Video details:', video); if (video.error) return;