modified: src/lib.js
modified: src/main.js modified: src/trigger/debug.js modified: src/trigger/ytdl.js
This commit is contained in:
@ -5,14 +5,7 @@ module.exports = (bot, trigger, lib) => {
|
||||
level: 100,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
if(lib.debug) {
|
||||
lib.debug = false;
|
||||
e.reply('debugmode deactivated');
|
||||
}
|
||||
else {
|
||||
lib.debug = true;
|
||||
e.reply('debugmode activated');
|
||||
}
|
||||
e.reply(lib.toggleDebug());
|
||||
},
|
||||
desc: 'toggle debug'
|
||||
});
|
||||
|
@ -19,7 +19,8 @@ module.exports = (bot, trigger, lib) => {
|
||||
lib.checkRepost(entry, (cbcr) => {
|
||||
if(cbcr) {
|
||||
var dat = fs.createWriteStream('./b/'+tmpdest+'.webm');
|
||||
ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
|
||||
//ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
|
||||
ytdl(entry)
|
||||
.on('response', (res) => {
|
||||
if(res.headers['content-length'] > lib.cfg.maxFileSize) {
|
||||
res.destroy();
|
||||
@ -27,6 +28,9 @@ module.exports = (bot, trigger, lib) => {
|
||||
e.reply('f0ck! your file is too big (~'+lib.formatSize(res.headers['content-length'])+'), max '+lib.formatSize(lib.cfg.maxFileSize)+' allowed');
|
||||
}
|
||||
})
|
||||
.on('error', (err) => {
|
||||
//e.reply(err);
|
||||
})
|
||||
.pipe( dat );
|
||||
dat.on('finish', () => {
|
||||
if(dl) {
|
||||
|
Reference in New Issue
Block a user