This commit is contained in:
@@ -89,6 +89,17 @@ export default async bot => {
|
|||||||
// imghure
|
// imghure
|
||||||
ext = link.split('.').pop();
|
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)) {
|
else if(link.match(regex.fourchan)) {
|
||||||
//4chan - fuck cloudflare :)
|
//4chan - fuck cloudflare :)
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user