fucking youtubeapi

This commit is contained in:
Flummi 2017-11-15 03:06:56 +01:00
parent c6798f7a08
commit d8c4da9aba
2 changed files with 13 additions and 13 deletions

View File

@ -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+')');
}); });
}); });
} }*/
} }
}); });
}); });

View File

@ -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'
}); });