1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2025-06-08 13:33:03 -04:00
poke/html/video-error.ejs
2025-04-07 14:38:31 +00:00

24 lines
502 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 = "Error while communicating with Invidious companion: Error connecting to 'companion:8282': Connection refused";
}
%>
<%- include('./layouts/error-video.ejs', {
error: "loading failed :c",
description: `${reason}`
}) %>