Skip to content

Instantly share code, notes, and snippets.

@boycaught
Created October 19, 2014 01:45
Show Gist options
  • Save boycaught/807dbb21075a99280069 to your computer and use it in GitHub Desktop.
Save boycaught/807dbb21075a99280069 to your computer and use it in GitHub Desktop.
Youtube-DL node function
/* ///////////////////////////////////////////////////////////////////////////
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