Skip to content

Commit 3cb6288

Browse files
committed
feat: 배포를 위해 ytdl 검증 제거
1 parent 32ae3a7 commit 3cb6288

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/routes/middleware/validation/uploadValidation.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ import createError from "http-errors";
44
import { MESSAGES, REQUIRED_FIELDS } from "../../../config/constants.js";
55
import { validateReqBody, validateFields } from "../../../utils/validation.js";
66

7-
const validateMetadata = (metaData) => {
8-
const { isLiveContent, isShortsEligible } = metaData;
9-
10-
if (isLiveContent || isShortsEligible) {
11-
const error = new createError.BadRequest(MESSAGES.ERROR.INVALID_VIDEO_TYPE);
12-
13-
throw error;
14-
}
15-
};
16-
177
const validateUploadUrl = async (req, res, next) => {
188
try {
199
validateReqBody(req.body);
@@ -30,21 +20,8 @@ const validateUploadUrl = async (req, res, next) => {
3020
throw error;
3121
}
3222

33-
const videoInfo = await ytdl.getBasicInfo(youtubeUrl);
34-
35-
validateMetadata(videoInfo.videoDetails);
36-
3723
next();
3824
} catch (error) {
39-
if (
40-
error.message.includes("Sign in to confirm your age") ||
41-
error.message.includes("Video unavailable")
42-
) {
43-
next(new createError.BadRequest(MESSAGES.ERROR.INVALID_VIDEO_TYPE));
44-
} else if (error.message.includes("This is a private video")) {
45-
next(new createError.Forbidden(MESSAGES.ERROR.INACCESSIBLE_VIDEO));
46-
}
47-
4825
next(error);
4926
}
5027
};

0 commit comments

Comments
 (0)