mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-01-01 22:29:15 +03:00
Don't allow dots in videoID
This commit is contained in:
@@ -19,6 +19,11 @@ if (config.mode === "test") {
|
|||||||
|
|
||||||
// YouTubeAPI.videos.list wrapper with cacheing
|
// YouTubeAPI.videos.list wrapper with cacheing
|
||||||
exportObject.listVideos = (videoID, part, callback) => {
|
exportObject.listVideos = (videoID, part, callback) => {
|
||||||
|
if (videoID.length !== 11 || videoID.includes(".")) {
|
||||||
|
callback("Invalid video ID");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let redisKey = "youtube.video." + videoID + "." + part;
|
let redisKey = "youtube.video." + videoID + "." + part;
|
||||||
redis.get(redisKey, (getErr, result) => {
|
redis.get(redisKey, (getErr, result) => {
|
||||||
if (getErr || !result) {
|
if (getErr || !result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user