From 4571f95c5411c43982ce12d58dede26dadd98a38 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 15 Mar 2017 11:56:54 +0100 Subject: [PATCH] blah --- src/trigger/parser.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/trigger/parser.js b/src/trigger/parser.js index 6fcee70..3e4cb0e 100644 --- a/src/trigger/parser.js +++ b/src/trigger/parser.js @@ -81,7 +81,7 @@ module.exports = (lib) => { dlformat = { filter: (format) => { return format.container === 'webm'; } }; ytdl.downloadFromInfo(inf, dlformat) .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 >= 60 && res.headers['content-length'] <= (lib.cfg.main.maxFileSize * 2) ) ) { info = { type: 'youtube', title: title, @@ -93,7 +93,7 @@ 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 >= 70?(lib.cfg.main.maxFileSize*2):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 >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' }); } }) .on('error', (err) => { @@ -140,7 +140,7 @@ module.exports = (lib) => { var type = res.headers['content-type']; lib.log('MimeType: '+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 >= 60 && data.length <= (lib.cfg.main.maxFileSize * 2) ) ) { var s = new Readable; s.push(data); s.push(null); @@ -155,7 +155,7 @@ 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 >= 70?(lib.cfg.main.maxFileSize*2):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 >= 60?(lib.cfg.main.maxFileSize*2):lib.cfg.main.maxFileSize ) )+' allowed' }); } } else { @@ -174,7 +174,7 @@ module.exports = (lib) => { .on('finish', () => { var size = dat.bytesWritten; dat.end(); - if( ( size <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && size <= (lib.cfg.main.maxFileSize * 2) ) ) { + if( ( size <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 60 && size <= (lib.cfg.main.maxFileSize * 2) ) ) { fs.stat('./b/' + tmpdest, (err, stat) => { if(!err && stat.isFile() && stat.size > 300) { lib.log('Datei '+tmpdest+' existiert'); @@ -197,7 +197,7 @@ module.exports = (lib) => { }); } else { - 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' }); + 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) => {