Merge pull request #163 from thignus/reject-80percent-total-submissions

reject submissions if total length is more than 80 precent of the video
This commit is contained in:
Ajay Ramachandran
2020-10-14 19:43:16 -04:00
committed by GitHub
5 changed files with 212 additions and 7 deletions

View File

@@ -18,13 +18,14 @@ if (config.mode === "test") {
exportObject = YouTubeAPI;
// YouTubeAPI.videos.list wrapper with cacheing
exportObject.listVideos = (videoID, part, callback) => {
exportObject.listVideos = (videoID, callback) => {
let part = 'contentDetails,snippet';
if (videoID.length !== 11 || videoID.includes(".")) {
callback("Invalid video ID");
return;
}
let redisKey = "youtube.video." + videoID + "." + part;
let redisKey = "youtube.video." + videoID;
redis.get(redisKey, (getErr, result) => {
if (getErr || !result) {
logger.debug("redis: no cache for video information: " + videoID);