changing convert to magick command because of deprecation
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s
This commit is contained in:
parent
c1f06de7c5
commit
7028d92d5e
@ -32,7 +32,7 @@ for(let item of items) {
|
||||
if(mime.startsWith('video/') || mime == 'image/gif')
|
||||
await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`);
|
||||
else if(mime.startsWith('image/') && mime != 'image/gif')
|
||||
await exec(`convert ./public/b/${filename} ./tmp/${itemid}.png`);
|
||||
await exec(`magick ./public/b/${filename} ./tmp/${itemid}.png`);
|
||||
else if(mime.startsWith('audio/')) {
|
||||
if(link.match(/soundcloud/)) {
|
||||
let cover = (await exec(`yt-dlp --get-thumbnail "${link}"`)).stdout.trim();
|
||||
@ -42,8 +42,8 @@ for(let item of items) {
|
||||
await exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`);
|
||||
const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size;
|
||||
if(size >= 0) {
|
||||
await exec(`convert ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
|
||||
await exec(`convert ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
|
||||
await exec(`magick ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
|
||||
await exec(`magick ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
} catch(err) {
|
||||
//console.log(err);
|
||||
@ -51,21 +51,21 @@ for(let item of items) {
|
||||
}
|
||||
else {
|
||||
await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
|
||||
await exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
await exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
|
||||
await exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
await exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
}
|
||||
|
||||
await exec(`convert "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
|
||||
await exec(`magick "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
|
||||
await fs.promises.unlink(`./tmp/${itemid}.png`).catch(err => {});
|
||||
await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(err => {});
|
||||
} catch(err) {
|
||||
//console.log(err);
|
||||
await exec(`convert ./mugge.png ./public/t/${itemid}.webp`);
|
||||
await exec(`magick ./mugge.png ./public/t/${itemid}.webp`);
|
||||
}
|
||||
console.log(`current: ${itemid} (${count} / ${total})`);
|
||||
count++;
|
||||
@ -76,7 +76,7 @@ for(let item of items) {
|
||||
const itemid = item.id;
|
||||
const filename = item.dest;
|
||||
await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./debug/tmp/${itemid}`);
|
||||
await exec(`convert "./debug/tmp/${itemid}" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.png`);
|
||||
await exec(`magick "./debug/tmp/${itemid}" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.png`);
|
||||
await fs.unlink(`./debug/tmp/${itemid}`);
|
||||
console.log(`current: ${itemid} (${count} / ${total})`);
|
||||
} catch(err) {}
|
||||
|
@ -62,7 +62,7 @@ export default new class queue {
|
||||
if(mime.startsWith('video/') || mime == 'image/gif')
|
||||
await this.exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`);
|
||||
else if(mime.startsWith('image/') && mime != 'image/gif')
|
||||
await this.exec(`convert "./public/b/${filename}[0]" ./tmp/${itemid}.png`);
|
||||
await this.exec(`magick "./public/b/${filename}[0]" ./tmp/${itemid}.png`);
|
||||
else if(mime.startsWith('audio/')) {
|
||||
if(link.match(/soundcloud/)) {
|
||||
let cover = (await this.exec(`yt-dlp -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' --get-thumbnail "${link}"`)).stdout.trim();
|
||||
@ -72,23 +72,23 @@ export default new class queue {
|
||||
await this.exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`);
|
||||
const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size;
|
||||
if(size >= 0) {
|
||||
await this.exec(`convert ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
|
||||
await this.exec(`convert ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
|
||||
await this.exec(`magick ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
|
||||
await this.exec(`magick ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
} catch(err) {}
|
||||
}
|
||||
else {
|
||||
await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
|
||||
await this.exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
await this.exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
|
||||
await this.exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
await this.exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
|
||||
}
|
||||
}
|
||||
|
||||
await this.exec(`convert "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
|
||||
await this.exec(`magick "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
|
||||
await fs.promises.unlink(`./tmp/${itemid}.png`).catch(_=>{});
|
||||
await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(_=>{});
|
||||
return true;
|
||||
|
@ -247,7 +247,7 @@ export default async bot => {
|
||||
try {
|
||||
await queue.genThumbnail(filename, mime, itemid, link);
|
||||
} catch(err) {
|
||||
await queue.exec(`convert ./mugge.png ./public/t/${itemid}.webp`);
|
||||
await queue.exec(`magick ./mugge.png ./public/t/${itemid}.webp`);
|
||||
}
|
||||
|
||||
let speed = lib.calcSpeed(size, end);
|
||||
|
Loading…
Reference in New Issue
Block a user