1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 04:14:39 -05:00
poke/html/video-error.ejs
2024-09-15 12:10:55 +00:00

23 lines
457 B
Text

<%
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 >~<";
} else {
reason = "youtube probably blocked poke or the api server is down :<";
}
%>
<%- include('./layouts/error-video.ejs', {
error: "oops - loading failed :c",
description: `${reason}`
}) %>