2024-09-11 16:24:49 -04: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)) {
|
2024-09-15 08:10:55 -04:00
|
|
|
reason = "Video not found >~<";
|
2024-09-11 16:24:49 -04:00
|
|
|
} else {
|
2024-10-12 09:52:48 -04:00
|
|
|
reason = "trying again...";
|
2024-09-11 16:24:49 -04:00
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<%- include('./layouts/error-video.ejs', {
|
|
|
|
error: "oops - loading failed :c",
|
|
|
|
description: `${reason}`
|
2024-09-11 11:47:36 -04:00
|
|
|
}) %>
|
2024-10-12 09:52:48 -04:00
|
|
|
|