1.1.0-beta • Published 12 months ago

youtube-s-dl v1.1.0-beta

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

YOUTUBE SEARCH & DOWNLOAD

ytvanced

A YouTube Video downloader.

HOW TO INSTALL?

npm i youtube-s-dl

Require to export function

//CommonJS
const {download, search, getStreamFormats, getVideoInfo} = require("youtube-s-dl");

SIMPLE USAGE

search and download videos

const {download, search, getVideoInfo} = require("youtube-s-dl");

let result = await search("Senpai (feat. Hentai Dude)")
console.log(result)
let info = getVideoInfo(result[0].videoId)
console.log(info)
try{
    //download have 2 params. first is videoId required
    //2nd Format object is optional param. 
    format = {
        mimeType: 'video',
        qualityLabel: '480p',
        fps: 30
        //etc.
    }
    stream = await download(result[0].videoId, format)
    path = "./tmp/videoplayback.mp4"
    file = fs.createWriteStream(path)
    stream.pipe(file).on('finish',()=>{
	    console.log("Video Downloaded")
    }).on('close',()=>{
	    console.log("Request Finished")
    }).on('error',()=>{
	    console.log("Seems there's an error happened while writing the file.")
    })
}
catch(e){
    console.log(e)
}
1.1.0-beta

12 months ago

1.0.9-beta

12 months ago

1.0.8-beta

12 months ago

1.0.7-beta

12 months ago

1.0.6-beta

12 months ago

1.0.5-beta

12 months ago

1.0.4-beta

12 months ago

1.0.2-beta

12 months ago

1.0.1-beta

12 months ago

1.0.0-beta

12 months ago