fullpwerr commited on
Commit
d0cc56e
·
verified ·
1 Parent(s): 5bb04c1

Update lib/skrep.js

Browse files
Files changed (1) hide show
  1. lib/skrep.js +11 -11
lib/skrep.js CHANGED
@@ -38,21 +38,21 @@ async function ttt(link) {
38
  };
39
 
40
  if (res.image) {
41
- const outputDir = path.join(__dirname, "../tmp")
42
- await downloadImages(res.image, outputDir);
43
 
44
- const FNvd = `tt_video_${Date.now()}.mp4`;
45
- const FNad = `tt_audio_${Date.now()}.mp3`;
46
- const videoPath = `${outputDir}/${FNvd}`;
47
- const audioPath = `${outputDir}/${FNad}`;
48
 
49
  // ✅ Unduh audio sebelum dipakai
50
- await downloadAudio(res.music[0].url, audioPath);
51
 
52
- const slideResult = await createSlideshow(outputDir, videoPath, audioPath);
53
- if (slideResult) {
54
- res.video.push({ resolusi: "Slideshow", url: `https://fullperr-hutatools.hf.space/tmp/${FNvd}`});
55
- }
56
  }
57
  return res;
58
  } catch (e) {
 
38
  };
39
 
40
  if (res.image) {
41
+ const outputDir = path.join(__dirname, "../tmp")
42
+ await downloadImages(res.image, outputDir);
43
 
44
+ const FNvd = `tt_video_${Date.now()}.mp4`;
45
+ const FNad = `tt_audio_${Date.now()}.mp3`;
46
+ const videoPath = `${outputDir}/${FNvd}`;
47
+ const audioPath = `${outputDir}/${FNad}`;
48
 
49
  // ✅ Unduh audio sebelum dipakai
50
+ await downloadAudio(res.music[0].url, audioPath);
51
 
52
+ const slideResult = await createSlideshow(outputDir, videoPath, audioPath);
53
+ if (slideResult) {
54
+ res.video.push({ resolusi: "Slideshow", url: `https://fullperr-hutatools.hf.space/tmp/${FNvd}`});
55
+ }
56
  }
57
  return res;
58
  } catch (e) {