bugfix
This commit is contained in:
parent
91a2edcce7
commit
b34e63ce0e
|
@ -18,8 +18,15 @@ module.exports = (bot, trigger, lib) => {
|
|||
lib.checkRepost(entry, (cbcr) => {
|
||||
if(cbcr) {
|
||||
var dat = fs.createWriteStream('./b/'+tmpdest+'.webm');
|
||||
try {
|
||||
ytdl(entry, { filter: (format) => { return format.container === 'webm'; } })
|
||||
ytdl(entry, { filter: (format) => {
|
||||
try {
|
||||
return format.container === 'webm';
|
||||
}
|
||||
catch(ex) {
|
||||
dl = false;
|
||||
e.reply("noep D:");
|
||||
}
|
||||
} })
|
||||
.on('response', (res) => {
|
||||
if(res.headers['content-length'] > lib.cfg.maxFileSize) {
|
||||
res.destroy();
|
||||
|
@ -28,13 +35,6 @@ module.exports = (bot, trigger, lib) => {
|
|||
}
|
||||
})
|
||||
.pipe( dat );
|
||||
}
|
||||
catch(ex) {
|
||||
dat.close();
|
||||
fs.unlink('./b/'+tmpdest+'.webm');
|
||||
e.reply("noep");
|
||||
dl = false;
|
||||
}
|
||||
dat.on('finish', () => {
|
||||
if(dl) {
|
||||
dat.close();
|
||||
|
|
Loading…
Reference in New Issue
Block a user