This commit is contained in:
Lea 2023-11-08 21:21:27 +01:00
parent 9986d8c410
commit 9bceeb6060
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -546,10 +546,10 @@ async function wordFilters(message: Message) {
const content = message.content.replace(/\u200b/g, "");
try {
const RE_POKETUBE_VIDEO = /https?:\/\/(poketube.fun|poketube.sudovanilla.com)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi;
const RE_YOUTUBE_PROXY = /https?:\/\/(\w+\.)?(poketube\.fun|poketube\.sudovanilla\.com|piped\.video)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi;
const results: string[] = [];
for (const result of content.matchAll(RE_POKETUBE_VIDEO)) {
for (const result of content.matchAll(RE_YOUTUBE_PROXY)) {
var id = result.groups?.videoid;
if (id) results.push(`https://youtu.be/${id}`);
}