diff --git a/src/inc/trigger/parser.mjs b/src/inc/trigger/parser.mjs index 364ecc6..79cb051 100644 --- a/src/inc/trigger/parser.mjs +++ b/src/inc/trigger/parser.mjs @@ -92,7 +92,7 @@ export default async bot => { 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); + const meta = JSON.parse((await queue.exec(`yt-dlp --proxy ${cfg.main.socks} -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' -I 1 --skip-download --dump-json "${link}"`)).stdout); ext = meta.ext; } catch(err) { const tmphead = (await fetch(link, { method: "HEAD" })).headers["content-type"]; @@ -161,7 +161,7 @@ export default async bot => { else if(link.match(regex.yt)) { try { // add --cookies on local instance if you want to avoid getting rate limited or optionally use a socks proxy from a network that is not being detected as a public network - source = (await queue.exec(`yt-dlp --proxy ${cfg.main.socks} -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' "${link}" --max-filesize ${maxfilesize / 1024}k --postprocessor-args "ffmpeg:-bitexact" -o "./tmp/${uuid}.%(ext)s" --print after_move:filepath --merge-output-format "mp4"`)).stdout.trim(); + source = (await queue.exec(`yt-dlp --proxy ${cfg.main.socks} -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' "${link}" -I 1 --max-filesize ${maxfilesize / 1024}k --postprocessor-args "ffmpeg:-bitexact" -o "./tmp/${uuid}.%(ext)s" --print after_move:filepath --merge-output-format "mp4"`)).stdout.trim(); } catch(err) { if(e.type == 'tg') return await e.editMessageText(msg.result.chat.id, msg.result.message_id, "yt dl error");