randydev commited on
Commit
afb23f1
·
verified ·
1 Parent(s): a9746de

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +10 -1
plugins/alldownloader.js CHANGED
@@ -83,17 +83,26 @@ AllDlRoutes.get('/api/v1/dl/tiktok', authenticateApiKey, apiLimiter, async (req,
83
  AllDlRoutes.get('/api/v1/dl/fb', authenticateApiKey, apiLimiter, async (req, res) => {
84
  try {
85
  const url = req.query.url;
86
-
87
  if (!url) {
88
  return res.status(400).json({ error: "url parameter is required." });
89
  }
 
90
  const results = await facebookdl(url);
 
 
 
 
 
 
 
 
91
  res.json({ results });
92
  } catch (error) {
93
  res.status(500).json({ error: error.message });
94
  }
95
  });
96
 
 
97
  /**
98
  * @swagger
99
  * /api/v1/dl/snapsave:
 
83
  AllDlRoutes.get('/api/v1/dl/fb', authenticateApiKey, apiLimiter, async (req, res) => {
84
  try {
85
  const url = req.query.url;
 
86
  if (!url) {
87
  return res.status(400).json({ error: "url parameter is required." });
88
  }
89
+
90
  const results = await facebookdl(url);
91
+
92
+ for (const video of results.video) {
93
+ video.url = await video.download();
94
+ }
95
+ for (const audio of results.audio) {
96
+ audio.url = await audio.download();
97
+ }
98
+
99
  res.json({ results });
100
  } catch (error) {
101
  res.status(500).json({ error: error.message });
102
  }
103
  });
104
 
105
+
106
  /**
107
  * @swagger
108
  * /api/v1/dl/snapsave: