poke/html/video-error.ejs
2025-08-31 19:47:00 +02:00

24 lines
527 B
Plaintext

<%
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 = "there could be few reasons why this could happen. see https://codeberg.org/ashley/poke/src/branch/main/why-error.md for info ";
}
%>
<%- include('./layouts/error-video.ejs', {
error: "WHOOPS! LOADING FAILED :C",
description: `${reason}`
}) %>