fucking youtubeapi
This commit is contained in:
parent
c6798f7a08
commit
d8c4da9aba
|
@ -94,7 +94,7 @@ self.generateThumbs = () => {
|
||||||
rows.forEach((e,i,a) => {
|
rows.forEach((e,i,a) => {
|
||||||
var thumbnail = outdir+'/'+e.id+'.png';
|
var thumbnail = outdir+'/'+e.id+'.png';
|
||||||
if(!fs.existsSync(thumbnail)) {
|
if(!fs.existsSync(thumbnail)) {
|
||||||
if(e.thumb == '') {
|
//if(e.thumb == '') {
|
||||||
var cmd;
|
var cmd;
|
||||||
switch(e.mime) {
|
switch(e.mime) {
|
||||||
case "video/mp4":
|
case "video/mp4":
|
||||||
|
@ -128,7 +128,7 @@ self.generateThumbs = () => {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
/*}
|
||||||
else {
|
else {
|
||||||
var dat = fs.createWriteStream(thumbnail);
|
var dat = fs.createWriteStream(thumbnail);
|
||||||
request(e.thumb).pipe(dat);
|
request(e.thumb).pipe(dat);
|
||||||
|
@ -139,7 +139,7 @@ self.generateThumbs = () => {
|
||||||
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,17 +5,17 @@ module.exports = (lib) => {
|
||||||
name: 'thumbnailer',
|
name: 'thumbnailer',
|
||||||
call: /^\!thumb(.*\d+)?$/i,
|
call: /^\!thumb(.*\d+)?$/i,
|
||||||
level: 100,
|
level: 100,
|
||||||
active: 0,
|
active: 1,
|
||||||
func: (e) => {
|
func: (e) => {
|
||||||
var id;
|
var id;
|
||||||
if(id = e.message.split(' ')[1]) {
|
if(id = e.message.split(' ')[1]) {
|
||||||
if(Number.isInteger(parseInt(id)))
|
if(Number.isInteger(parseInt(id)))
|
||||||
fs.unlink('./t/'+id+'.png', () => lib.generateThumbs() );
|
fs.unlink('./t/'+id+'.png', () => lib.generateThumbs() );
|
||||||
}
|
}
|
||||||
else {
|
/*else {
|
||||||
deleteFolderRecursive('./t');
|
deleteFolderRecursive('./t');
|
||||||
lib.generateThumbs();
|
lib.generateThumbs();
|
||||||
}
|
}*/
|
||||||
},
|
},
|
||||||
desc: 'generate thumbnail'
|
desc: 'generate thumbnail'
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user