@vreden/youtube_scraper

1.2.0 • Public • Published

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);
        }
    });

Package Sidebar

Install

npm i @vreden/youtube_scraper

Weekly Downloads

1,033

Version

1.2.0

License

MIT

Unpacked Size

9.02 kB

Total Files

3

Last publish

Collaborators

  • vredenofficiall