Youtube plugin updated to follow api changes. Updated packages

This commit is contained in:
lanxu 2021-11-13 11:55:43 +02:00
parent 912ba3b711
commit cbb868251b
4 changed files with 4360 additions and 2683 deletions

View File

@ -13,3 +13,4 @@ backup/
config.js
.swp
.orig
log/

7018
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,14 @@
"cron": "=1.7.1",
"file-stream-rotator": "=0.4.1",
"finalhandler": "=1.1.2",
"googleapis": "=42.0.0",
"googleapis": "^91.0.0",
"html-to-text": "=5.1.1",
"irc": "=0.5.2",
"lokijs": "=1.5.7",
"mkdirp": "=0.5.1",
"mkdirp": "=0.5.5",
"morgan": "=1.9.1",
"node-cron": "^2.0.3",
"node-dev": "=4.0.0",
"node-dev": "^7.1.0",
"node-uuid": "=1.4.8",
"promise": "=8.0.3",
"request": "=2.88.0",
@ -36,6 +36,6 @@
"winston-daily-rotate-file": "^3.10.0"
},
"devDependencies": {
"nodemon": "^1.18.5"
"nodemon": "^2.0.15"
}
}

View File

@ -25,8 +25,8 @@ class Youtube extends BasePlugin {
resultString += result.title
resultString += ', esittäjänä ' + result.channelTitle
if (typeof result.statistics !== 'undefined') {
var rotten = (Number(result.statistics.likeCount) / (Number(result.statistics.likeCount) + Number(result.statistics.dislikeCount))).toFixed(2)
resultString += ' (' + result.duration + ', ' + result.statistics.viewCount + ' katselukertaa, ' + rotten * 100 + '% tykätty, ' + result.url + ' )'
var likeCount = Number(result.statistics.likeCount)
resultString += ' (' + result.duration + ', ' + result.statistics.viewCount + ' katselukertaa, ' + likeCount + ' 👍)'
}
resolve(resultString)
}, function (err) {