Merge pull request #459 from Xaekai/3.0

Fix rare error where only unsupported qualities of video are present in ...
This commit is contained in:
Calvin Montgomery 2015-03-25 20:19:56 -07:00
commit 7539dc1544
1 changed files with 10 additions and 7 deletions

View File

@ -845,11 +845,14 @@ var Getters = {
var videos = {}; var videos = {};
$('media\\:content[medium="video"]').each(function(index, element){ $('media\\:content[medium="video"]').each(function(index, element){
var url = $(this).attr("url") var url = $(this).attr("url")
var type = url.match(/itag=(\d\d)/)[1] var type = url.match(/itag=(\d\d)/)
videos[type] = { if(type && type[1]){
format: type, type = type[1]
link: url videos[type] = {
}; format: type,
link: url
};
}
}); });
$ = null; $ = null;
@ -870,8 +873,8 @@ var Getters = {
} }
if (Object.keys(direct).length === 0) { if (Object.keys(direct).length === 0) {
return cb("Unable to retrieve video data from Google+. Check that " + return cb("Unable to retrieve video data from Google+. The videos " +
"the album exists and is shared publicly."); "may have not finished processing yet.");
} else if (!title) { } else if (!title) {
return cb("Unable to retrieve title from Google+. Check that " + return cb("Unable to retrieve title from Google+. Check that " +
"the album exists and is shared publicly."); "the album exists and is shared publicly.");