mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-16 23:14:39 -05:00
25 lines
457 B
Text
25 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 = "This helps protect our community. Learn more (TRYING AGAIN....)";
|
|
}
|
|
%>
|
|
|
|
<%- include('./layouts/error-video.ejs', {
|
|
error: "loading failed :c",
|
|
description: `${reason}`
|
|
}) %>
|
|
|
|
|