forked from GitHub/dbot
LAME
This commit is contained in:
parent
e4b46452e5
commit
6ded78bb5e
@ -59,7 +59,11 @@ var youtube = function(dbot) {
|
|||||||
'json': true
|
'json': true
|
||||||
}, function(error, response, body) {
|
}, function(error, response, body) {
|
||||||
if(_.isObject(body) && _.has(body, 'entry')) {
|
if(_.isObject(body) && _.has(body, 'entry')) {
|
||||||
var v = body.entry;
|
var v = body.entry
|
||||||
|
seconds = v['media$group']['yt$duration'].seconds
|
||||||
|
minutes = Math.floor(seconds / 60),
|
||||||
|
seconds = seconds - minutes * 60;
|
||||||
|
|
||||||
if(!_.has(v, 'yt$rating')) {
|
if(!_.has(v, 'yt$rating')) {
|
||||||
v['yt$rating'] = {
|
v['yt$rating'] = {
|
||||||
'numLikes': 0,
|
'numLikes': 0,
|
||||||
@ -75,7 +79,9 @@ var youtube = function(dbot) {
|
|||||||
'plays': v['yt$statistics'].viewCount,
|
'plays': v['yt$statistics'].viewCount,
|
||||||
'author': v.author[0].name['$t'],
|
'author': v.author[0].name['$t'],
|
||||||
'likes': v['yt$rating'].numLikes,
|
'likes': v['yt$rating'].numLikes,
|
||||||
'dislikes': v['yt$rating'].numDislikes
|
'dislikes': v['yt$rating'].numDislikes,
|
||||||
|
'minutes': minutes,
|
||||||
|
'seconds': seconds
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user