Don't allow dots in videoID

This commit is contained in:
Ajay Ramachandran
2020-10-11 14:11:20 -04:00
parent 11eb742540
commit e0df3d4208

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) {