Closure-RI commited on
Commit
07e590f
·
verified ·
1 Parent(s): f932d3b

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -538,7 +538,7 @@ async function nhentai(url) {
538
 
539
  if (isWebp) {
540
  const convertedImagePath = downloadedImagePath.replace('.webp', '.jpg');
541
- await convertImage(downloadedImagePath, convertedImagePath);
542
  fs.unlinkSync(downloadedImagePath); // Hapus file asli (.webp)
543
  imagePaths.push(convertedImagePath);
544
  } else {
@@ -563,7 +563,7 @@ async function nhentai(url) {
563
  }
564
 
565
 
566
- async function convertImage(inputPath, outputPath) {
567
  try {
568
  await execAsync(`ffmpeg -i "${inputPath}" -q:v 1 "${outputPath}"`);
569
  console.log(`Converted ${inputPath} to ${outputPath}`);
 
538
 
539
  if (isWebp) {
540
  const convertedImagePath = downloadedImagePath.replace('.webp', '.jpg');
541
+ await convertImageV2(downloadedImagePath, convertedImagePath);
542
  fs.unlinkSync(downloadedImagePath); // Hapus file asli (.webp)
543
  imagePaths.push(convertedImagePath);
544
  } else {
 
563
  }
564
 
565
 
566
+ async function convertImageV2(inputPath, outputPath) {
567
  try {
568
  await execAsync(`ffmpeg -i "${inputPath}" -q:v 1 "${outputPath}"`);
569
  console.log(`Converted ${inputPath} to ${outputPath}`);