youtube-scrapper
v1.4.0
Published
Download videos and get info on them aswell as searching and other features.
Downloads
432
Maintainers
Readme
youtube-scrapper
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()