Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -988,7 +988,6 @@ app.get('/r34cookie', async (req, res) => {
|
|
988 |
|
989 |
|
990 |
|
991 |
-
|
992 |
// Fungsi untuk mendapatkan data dari API Pixiv berdasarkan ID ilustrasi
|
993 |
async function pixivGetData(illustId) {
|
994 |
const headers = {
|
@@ -1079,17 +1078,15 @@ app.get("/process-pixiv/:illustId", async (req, res) => {
|
|
1079 |
const pixivData = await pixivGetData(illustId);
|
1080 |
const frameDir = await downloadAndExtractZipFromPixivData(pixivData);
|
1081 |
const videoPath = await createVideoFromExtractedImages(pixivData, frameDir);
|
1082 |
-
|
1083 |
-
//
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
}
|
1092 |
-
});
|
1093 |
} catch (error) {
|
1094 |
console.error("Error processing Pixiv illustration:", error);
|
1095 |
res.status(500).send("Error processing illustration.");
|
|
|
988 |
|
989 |
|
990 |
|
|
|
991 |
// Fungsi untuk mendapatkan data dari API Pixiv berdasarkan ID ilustrasi
|
992 |
async function pixivGetData(illustId) {
|
993 |
const headers = {
|
|
|
1078 |
const pixivData = await pixivGetData(illustId);
|
1079 |
const frameDir = await downloadAndExtractZipFromPixivData(pixivData);
|
1080 |
const videoPath = await createVideoFromExtractedImages(pixivData, frameDir);
|
1081 |
+
|
1082 |
+
// Buat URL untuk mengakses file mp4
|
1083 |
+
const videoUrl = `https://arashicode-komik.hf.space/static/${path.relative(tmpDir, videoPath)}`;
|
1084 |
+
|
1085 |
+
// Kirim URL file mp4 dalam format JSON
|
1086 |
+
res.json({ url: videoUrl });
|
1087 |
+
|
1088 |
+
// Jadwalkan penghapusan file setelah 2 menit
|
1089 |
+
scheduleFolderDeletion(frameDir);
|
|
|
|
|
1090 |
} catch (error) {
|
1091 |
console.error("Error processing Pixiv illustration:", error);
|
1092 |
res.status(500).send("Error processing illustration.");
|