chore: update examples

This commit is contained in:
LuanRT
2021-10-22 04:38:33 -03:00
parent d11d03bd92
commit 6ca6e22fea

View File

@@ -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;