poke/html/video-error.ejs

23 lines
431 B
Text
Raw Normal View History

2024-09-11 22:24:49 +02:00
<%
function isValidYouTubeID(v) {
return /^[a-zA-Z0-9_-]{11}$/.test(v);
}
function isLetterSpam(v) {
return /^(.)\1+$/.test(v);
}
let reason;
if (!isValidYouTubeID(v) || isLetterSpam(v)) {
reason = "Video not found :c";
} else {
reason = "this helps protect our community.";
}
%>
<%- include('./layouts/error-video.ejs', {
error: "oops - loading failed :c",
description: `${reason}`
2024-09-11 17:47:36 +02:00
}) %>