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

Commit

Permalink
some code organization
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Apr 26, 2014
1 parent 2322709 commit 085b9f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function call(video, args, options, callback) {
* @param {Array.<String>} data
*/
function filterData(data) {

var format = data[data.length - 1].split(' - ');

return {
Expand All @@ -136,6 +135,8 @@ function filterData(data) {
}


var resolutionRegex = /([0-9]+ - [0-9]+x[0-9]+)/;

/**
* Gets info from a video.
*
Expand All @@ -158,8 +159,6 @@ ytdl.getInfo = function(url, options, callback) {
'--get-description'
];

var resolutionRegex = /([0-9]+ - [0-9]+x[0-9]+)/g;

call(url, args, options, function(err, data) {
if (err) return callback(err);

Expand All @@ -169,7 +168,7 @@ ytdl.getInfo = function(url, options, callback) {
data.forEach(function(row) {
track.push(row);

if (row.match(resolutionRegex)) {
if (resolutionRegex.test(row)) {
playlist.push(filterData(track));
track = [];
}
Expand All @@ -183,6 +182,7 @@ ytdl.getInfo = function(url, options, callback) {
});
};


var formatsRegex = /^(\d+)\s+([a-z0-9]+)\s+(\d+x\d+|d+p|audio only)/;

/**
Expand Down

0 comments on commit 085b9f7

Please sign in to comment.