fuck
This commit is contained in:
parent
0f64a25ae7
commit
02d4c60d8d
|
@ -81,7 +81,7 @@ module.exports = (lib) => {
|
||||||
dlformat = { filter: (format) => { return format.container === 'webm'; } };
|
dlformat = { filter: (format) => { return format.container === 'webm'; } };
|
||||||
ytdl.downloadFromInfo(inf, dlformat)
|
ytdl.downloadFromInfo(inf, dlformat)
|
||||||
.on('response', (res) => {
|
.on('response', (res) => {
|
||||||
if( ( res.headers['content-length'] <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && res.headers['content-length'] >= (lib.cfg.main.maxFileSize * 2) ) ) {
|
if( ( res.headers['content-length'] <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && res.headers['content-length'] <= (lib.cfg.main.maxFileSize * 2) ) ) {
|
||||||
info = {
|
info = {
|
||||||
type: 'youtube',
|
type: 'youtube',
|
||||||
title: title,
|
title: title,
|
||||||
|
@ -93,7 +93,7 @@ module.exports = (lib) => {
|
||||||
else {
|
else {
|
||||||
res.destroy();
|
res.destroy();
|
||||||
dat.end();
|
dat.end();
|
||||||
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(res.headers['content-length'])+'), max '+lib.formatSize(lib.cfg.main.maxFileSize)+' allowed' });
|
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(res.headers['content-length'])+'), max '+lib.formatSize( ( userlevel >= 70?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
|
@ -140,8 +140,8 @@ module.exports = (lib) => {
|
||||||
var type = res.headers['content-type'];
|
var type = res.headers['content-type'];
|
||||||
lib.log('MimeType: '+type);
|
lib.log('MimeType: '+type);
|
||||||
if(lib.cfg.main.allowedMimes.hasOwnProperty(type)) {
|
if(lib.cfg.main.allowedMimes.hasOwnProperty(type)) {
|
||||||
if( ( data.length <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && data.length >= (lib.cfg.main.maxFileSize * 2) ) ) {
|
if( ( data.length <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && data.length <= (lib.cfg.main.maxFileSize * 2) ) ) {
|
||||||
var s = new Readable
|
var s = new Readable;
|
||||||
s.push(data);
|
s.push(data);
|
||||||
s.push(null);
|
s.push(null);
|
||||||
s.pipe(dat);
|
s.pipe(dat);
|
||||||
|
@ -155,7 +155,7 @@ module.exports = (lib) => {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dat.end();
|
dat.end();
|
||||||
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(data.length)+'), max '+lib.formatSize(lib.cfg.main.maxFileSize)+' allowed' });
|
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(data.length)+'), max '+lib.formatSize( ( userlevel >= 70?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -197,7 +197,7 @@ module.exports = (lib) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize(lib.cfg.main.maxFileSize)+' allowed' });
|
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize( ( userlevel >= 70?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user