Created
October 19, 2014 01:45
-
-
Save boycaught/807dbb21075a99280069 to your computer and use it in GitHub Desktop.
Youtube-DL node function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /////////////////////////////////////////////////////////////////////////// | |
Simple YOUTUBE-DL function | |
AUTHOR: .LAG (@boycaught) | |
VERSION: 0.0.1 | |
DATE: 2014-10-18 | |
/////////////////////////////////////////////////////////////////////////// */ | |
var exec = require('child_process').exec; | |
var getVideo = function (_name, _videoUrl) { | |
exec('youtube-dl -o' + _name + ' ' + _videoUrl, function (error, stdout, stderr) { | |
// output is in stdout | |
console.log(stdout); | |
}); | |
}; | |
var ytName = 'FHITRP.mp4'; | |
var ytUrl = 'https://www.youtube.com/watch?v=CdIT74L8hGI'; | |
getVideo(ytName, ytUrl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment