youtube-scrapper
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

youtube-scrapper

NPM Version NPM Downloads

Table Of Contents

Links

Installing

Simply use npm i youtube-scrapper.

Example

const scrapper = require("youtube-scrapper")
const { createWriteStream } = require("fs")

async function main() {
    // Getting videos through query.
    const result = await scrapper.search("best hits 2010")

    console.log(result.videos.map(vid => vid.details.title)) // Array of videos mapped by name.

    // Downloading first result and piping to a file.
    // We have to get the full song info first.
    const video = await scrapper.getVideoInfo(result.videos[0].id)

    // Write to file.
    scrapper
        .downloadFromVideo(video)
        .pipe(createWriteStream("./song.ogg"))
}

main()

Package Sidebar

Install

npm i youtube-scrapper

Weekly Downloads

164

Version

1.4.0

License

MIT

Unpacked Size

142 kB

Total Files

107

Last publish

Collaborators

  • ruben40000