Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Fix - win handling getInfo & getFormats
Browse files Browse the repository at this point in the history
handle properly
- newline character win/*nix
- win execFile
  • Loading branch information
przemyslawpluta committed Feb 14, 2014
1 parent 954df15 commit 7655ea1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,20 @@ function call(url, args, options, callback) {
args = args.concat(util.parseOpts(options));
args.push(url);

var target = file;
var opt = args;

if (isWin) {
target = 'python';
opt = args;
}

// Call youtube-dl.
execFile(file, args, function(err, stdout, stderr) {
execFile(target, opt, function(err, stdout, stderr) {
if (err) return callback(err);
if (stderr) return callback(new Error(stderr.slice(7)));

var data = stdout.trim().split('\n');
var data = stdout.trim().split('\r\n');
callback(null, data);
});
}
Expand Down

0 comments on commit 7655ea1

Please sign in to comment.