remove !ignore and add !f
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
This commit is contained in:
parent
81e7d50a6b
commit
78a2524ce9
|
@ -21,7 +21,7 @@ export default async bot => {
|
||||||
call: regex.all,
|
call: regex.all,
|
||||||
active: true,
|
active: true,
|
||||||
f: e => {
|
f: e => {
|
||||||
const links = e.message.match(regex.all)?.filter(link => !link.includes(cfg.main.url)) || [];
|
const links = e.message.match(regex.all)?.filter(link => !link.includes(cfg.main.url.domain)) || [];
|
||||||
let repost;
|
let repost;
|
||||||
if(e.media)
|
if(e.media)
|
||||||
links.push(e.media);
|
links.push(e.media);
|
||||||
|
@ -29,10 +29,7 @@ export default async bot => {
|
||||||
if(links.length === 0)
|
if(links.length === 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(e.message.match(/(!|-)ignore/))
|
if(!e.message.match(/\!f(0ck)?/i))
|
||||||
return false;
|
|
||||||
|
|
||||||
if(!e.channel.includes("f0ck") && !e.message.match(/(!|-)f0ck/i))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
console.log(`parsing ${links.length} link${links.length > 1 ? "s" : ""}...`);
|
console.log(`parsing ${links.length} link${links.length > 1 ? "s" : ""}...`);
|
||||||
|
@ -52,12 +49,6 @@ export default async bot => {
|
||||||
const maxfilesize = (getLevel(e.user).level > 50 ? cfg.main.maxfilesize * cfg.main.adminmultiplier : cfg.main.maxfilesize);
|
const maxfilesize = (getLevel(e.user).level > 50 ? cfg.main.maxfilesize * cfg.main.adminmultiplier : cfg.main.maxfilesize);
|
||||||
|
|
||||||
// read metadata
|
// read metadata
|
||||||
/*if(!regex.yt.test(link)) {
|
|
||||||
const tmphead = (await fetch(link, { method: "HEAD" })).headers["content-type"];
|
|
||||||
if(!Object.keys(cfg.mimes).includes(tmphead))
|
|
||||||
return;
|
|
||||||
ext = cfg.mimes[tmphead];
|
|
||||||
}*/
|
|
||||||
let ext;
|
let ext;
|
||||||
try {
|
try {
|
||||||
const meta = JSON.parse((await queue.exec(`yt-dlp -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 -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' --skip-download --dump-json "${link}"`)).stdout);
|
||||||
|
@ -69,7 +60,7 @@ export default async bot => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Object.values(cfg.mimes).includes(ext?.toLowerCase())) {
|
if(!Object.values(cfg.mimes).includes(ext?.toLowerCase())) {
|
||||||
return 'mime schmime ' + ext;
|
return console.log('mime schmime ' + ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = await e.reply(`[charging the f0cker] downloading: ${uuid}`, {
|
const msg = await e.reply(`[charging the f0cker] downloading: ${uuid}`, {
|
||||||
|
@ -186,19 +177,19 @@ export default async bot => {
|
||||||
|
|
||||||
// autotagger
|
// autotagger
|
||||||
let tags = [];
|
let tags = [];
|
||||||
if(cfg.apis?.nsfw1 && mime.startsWith('image')) {
|
/*if(cfg.apis?.nsfw1 && mime.startsWith('image')) {
|
||||||
const nsfw = await autotagger.isNSFW(filename, size);
|
const nsfw = await autotagger.isNSFW(filename, size);
|
||||||
tags.push(nsfw ? 'nsfw' : 'sfw');
|
tags.push(nsfw ? 'nsfw' : 'sfw');
|
||||||
if(nsfw)
|
if(nsfw)
|
||||||
await queue.tagNSFW(itemid);
|
await queue.tagNSFW(itemid);
|
||||||
else
|
else
|
||||||
await queue.tagSFW(itemid);
|
await queue.tagSFW(itemid);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
let outputmsgirc = `[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}`;
|
let outputmsgirc = `[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}`;
|
||||||
let outputmsgtg = `[f0cked] size: ${lib.formatSize(size)} | speed: ${speed}`;
|
let outputmsgtg = `[f0cked] size: ${lib.formatSize(size)} | speed: ${speed}`;
|
||||||
|
|
||||||
if(tags.length > 0) {
|
if(tags?.length > 0) {
|
||||||
const tagstr = tags.join(', ');
|
const tagstr = tags.join(', ');
|
||||||
outputmsgirc += ` | tags: ${tagstr}`;
|
outputmsgirc += ` | tags: ${tagstr}`;
|
||||||
outputmsgtg += ` | tags: ${tagstr}`;
|
outputmsgtg += ` | tags: ${tagstr}`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user