mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 00:54:39 -05:00
add new stuff :3
This commit is contained in:
parent
2f0da0e6cc
commit
ba73e43725
1 changed files with 21 additions and 3 deletions
|
@ -1,4 +1,22 @@
|
||||||
<%- include('./layouts/error.ejs', {
|
<%
|
||||||
error: "Video Error",
|
function isValidYouTubeID(v) {
|
||||||
description: `${err_reason}`
|
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 :c";
|
||||||
|
} else {
|
||||||
|
reason = "this helps protect our community.";
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%- include('./layouts/error-video.ejs', {
|
||||||
|
error: "oops - loading failed :c",
|
||||||
|
description: `${reason}`
|
||||||
}) %>
|
}) %>
|
||||||
|
|
Loading…
Reference in a new issue