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