+ // Video is unlisted, check we used the uuid to fetch it
+ if (video.privacy === VideoPrivacy.UNLISTED) {
+ if (isUUIDValid(req.params.id)) return next()
+
+ // Don't leak this unlisted video
+ return res.status(404).end()
+ }
+
+ // Video is private, check the user