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

Commit

Permalink
Call getInfo from getFormats
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeMF committed Feb 11, 2015
1 parent ace1b11 commit 4ecda89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ ytdl.getFormats = function(url, args, callback) {
callback = args;
args = [];
}
call(url, ['--dump-json'], args, null, function(err, data) {
ytdl.getInfo(url, args, {}, function (err, video_info) {
if (err) return callback(err);

var video_info = JSON.parse(data);
var formats_info = video_info.formats || [video_info];
var formats = formats_info.map(function(format) {
return {
Expand Down

0 comments on commit 4ecda89

Please sign in to comment.