This commit is contained in:
Flummi 2018-05-26 00:00:48 +00:00
parent b8b5265168
commit 4e9a5f54a9

View File

@ -93,18 +93,18 @@ module.exports = (lib) => {
else {
res.destroy();
dat.end();
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(res.headers['content-length'])+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
return cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(res.headers['content-length'])+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
}
})
.on('error', (err) => {
dat.end();
cb({ success: false, file: tmpdest, msg: err.message });
return cb({ success: false, file: tmpdest, msg: err.message });
})
.pipe(dat);
}
catch(ex) {
dat.end();
cb({ success: false, file: tmpdest, msg: ex.message });
return cb({ success: false, file: tmpdest, msg: ex.message });
}
}
});
@ -125,7 +125,7 @@ module.exports = (lib) => {
}
else {
dat.end();
cb({ success: false, file: tmpdest, msg: 'f0ck sc-api' });
return cb({ success: false, file: tmpdest, msg: 'f0ck sc-api' });
}
});
}
@ -155,17 +155,17 @@ module.exports = (lib) => {
}
else {
dat.end();
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(data.length)+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
return cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(data.length)+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
}
}
else {
dat.end();
cb({ success: false, file: tmpdest, msg: '' });
return cb({ success: false, file: tmpdest, msg: '' });
}
}
else {
dat.end();
cb({ success: false, file: tmpdest, msg: 'nope.' });
return cb({ success: false, file: tmpdest, msg: 'nope.' });
}
});
}
@ -185,27 +185,27 @@ module.exports = (lib) => {
info.ext = mime.ext;
info.mime = mime.mime;
if(lib.cfg.main.allowedMimes.hasOwnProperty(mime.mime) || info.type === 'soundcloud')
cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs });
return cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs });
else
cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+mime.mime+')' });
return cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+mime.mime+')' });
}
else
cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs });
return cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs });
});
});
}
});
}
else {
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
return cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize( ( userlevel >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
}
})
.on('error', (err) => {
cb({ success: false, file: tmpdest, msg: err });
return cb({ success: false, file: tmpdest, msg: err });
});
}
else
cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcr });
return cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcr });
});
};
};