Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -538,7 +538,7 @@ async function nhentai(url) {
|
|
| 538 |
|
| 539 |
if (isWebp) {
|
| 540 |
const convertedImagePath = downloadedImagePath.replace('.webp', '.jpg');
|
| 541 |
-
await
|
| 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
|
| 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}`);
|