Merge pull request #162 from ajayyy/experimental

Don't allow dots in videoID
This commit is contained in:
Ajay Ramachandran
2020-10-11 14:13:19 -04:00
committed by GitHub

View File

@@ -19,6 +19,11 @@ if (config.mode === "test") {
// YouTubeAPI.videos.list wrapper with cacheing
exportObject.listVideos = (videoID, part, callback) => {
if (videoID.length !== 11 || videoID.includes(".")) {
callback("Invalid video ID");
return;
}
let redisKey = "youtube.video." + videoID + "." + part;
redis.get(redisKey, (getErr, result) => {
if (getErr || !result) {