The options, including the YouTube URL and desired format.
A promise that resolves to the download data.
import { ytmp3mobi } from 'nb-scraper';
async function downloadAudio() {
const result = await ytmp3mobi({
youtubeUrl: '[https://www.youtube.com/watch?v=WK-PlNz52FM&t=208s](https://www.youtube.com/watch?v=WK-PlNz52FM&t=208s)',
format: 'mp3'
});
if (result.status) {
console.log('Title:', result.data.title);
console.log('Download URL:', result.data.downloadUrl);
}
}
downloadAudio();
Downloads a YouTube video as an MP3 or MP4 file using ytmp3.mobi.