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

Commit

Permalink
take into account multi line descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Aug 27, 2013
1 parent e4a1b2f commit 63ad7c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ exports.info = function(url, callback, args) {
, '--get-url'
, '--get-title'
, '--get-thumbnail'
, '--get-description'
, '--get-filename'
, '--get-format'
, '--get-description'
].concat(args);
args.push(url);

Expand All @@ -239,15 +239,15 @@ exports.info = function(url, callback, args) {
if (err) return callback(err);
if (stderr) return callback(new Error(stderr.slice(7)));

var data = stdout.split('\n');
var format = data[6].split(' - ');
var data = stdout.trim().split('\n');
var format = data[data.length - 1].split(' - ');
var info = {
title : data[0]
, id : data[1]
, url : data[2]
, thumbnail : data[3]
, description : data[4]
, filename : data[5]
, description : data.slice(4, data.length - 2).join('\n')
, filename : data[data.length - 2]
, itag : format[0]
, resolution : format[1]
};
Expand Down

0 comments on commit 63ad7c2

Please sign in to comment.