UNPKG

video-to-gif

Version:

A Node.js module that searches YouTube videos by song name and converts clips to animated GIFs

28 lines (21 loc) 790 B
const { searchVideos } = require('./ytgif'); async function testModule() { console.log('Testing YouTube to GIF Module'); console.log('=============================\n'); try { console.log('Searching for "Despacito"...'); const videos = await searchVideos('Despacito', 3); console.log(`Found ${videos.length} videos:\n`); videos.forEach((video, index) => { console.log(`${index + 1}. ${video.title}`); console.log(` Channel: ${video.channelTitle}`); console.log(` Duration: ${video.duration}`); console.log(` Video ID: ${video.videoId}`); console.log(''); }); console.log('Module is working correctly!'); } catch (error) { console.log('Error testing module:', error.message); } } testModule();