diff --git a/lib/youtube-dl.js b/lib/youtube-dl.js index c215a41..71b972d 100644 --- a/lib/youtube-dl.js +++ b/lib/youtube-dl.js @@ -1,6 +1,9 @@ var spawn = require('child_process').spawn , EventEmitter = require('events').EventEmitter + , fs = require('fs') , path = require('path') + , exists = fs.exists || path.exists + ; // arguments we dont want users to use with youtube-dl @@ -33,11 +36,11 @@ var parseOpts = function(args) { // check that youtube-dl file exists var file = path.join(__dirname, '..', 'bin', 'youtube-dl'); -path.exists(file, function(exists) { +exists(file, function(exists) { if (exists) return; require(__dirname + '/../scripts/download'); - path.exists(file, function(exists) { + exists(file, function(exists) { if (!exists) { throw new Error('youtube-dl file does not exist. tried to download it but failed.'); }