@vreden/youtube_scraper
v1.1.9
Published
A simple YouTube video downloader for audio and video formats.
Downloads
2,432
Maintainers
Readme
youtube_scraper fixed
A simple YouTube video downloader for audio and video formats.
Installation
You can install the package using npm:
npm install youtube_scraper
Usage
const { search, ytmp3, ytmp4 } = require('youtube_scraper');
Download Audio (MP3) 🎧
const url = 'https://www.youtube.com/watch?v=YOUR_VIDEO_ID';
ytmp3(url)
.then(result => {
if (result.status) {
console.log('Download Link:', result.download);
console.log('Metadata:', result.metadata);
} else {
console.error('Error:', result.result);
}
});
Download Video (MP4) 🗃️
const url = 'https://www.youtube.com/watch?v=YOUR_VIDEO_ID';
ytmp4(url)
.then(result => {
if (result.status) {
console.log('Download Link:', result.download);
console.log('Metadata:', result.metadata);
} else {
console.error('Error:', result.result);
}
});
Search Video 🍟
const query = 'your search term';
search(query)
.then(result => {
if (result.status) {
console.log('Search Results:', result.results);
} else {
console.error('Error:', result.result);
}
});