From dad526822ccb5dec0f0ebfd76e8cb5dd3acaa602 Mon Sep 17 00:00:00 2001 From: x Date: Tue, 22 Jul 2025 17:35:51 +0200 Subject: [PATCH] uga aga --- src/inc/trigger/parser.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/inc/trigger/parser.mjs b/src/inc/trigger/parser.mjs index ef604db..a35a035 100644 --- a/src/inc/trigger/parser.mjs +++ b/src/inc/trigger/parser.mjs @@ -89,6 +89,17 @@ export default async bot => { // imghure ext = link.split('.').pop(); } + else if(link.match(regex.yt)) { + //yt - fuck anti bot protection + try { + const meta = JSON.parse((await queue.exec(`yt-dlp --proxy ${cfg.main.socks} -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' --skip-download --dump-json "${link}"`)).stdout); + ext = meta.ext; + } catch(err) { + const tmphead = (await fetch(link, { method: "HEAD" })).headers["content-type"]; + // this can be undefined for unsupported mime types, but will be caught in the general mime check below + ext = cfg.mimes[tmphead]; + } + } else if(link.match(regex.fourchan)) { //4chan - fuck cloudflare :) try {