randydev commited on
Commit
4bd4c9f
·
1 Parent(s): 7276de6
Files changed (3) hide show
  1. lib/all.js +9 -0
  2. package.json +1 -0
  3. plugins/alldownloader.js +44 -0
lib/all.js CHANGED
@@ -32,6 +32,7 @@ import {
32
  } from '../lib/scrapper.js';
33
 
34
  import { trbtoken, trburl } from '../config.js';
 
35
 
36
 
37
  async function audioContent(url) {
@@ -122,6 +123,13 @@ function generateRandomTimestamp() {
122
  return Math.floor(Math.random() * (end - start) + start);
123
  }
124
 
 
 
 
 
 
 
 
125
  export {
126
  facebookdl,
127
  savefrom,
@@ -154,4 +162,5 @@ export {
154
  TelegramUseLog,
155
  audioContent,
156
  generateRandomTimestamp,
 
157
  };
 
32
  } from '../lib/scrapper.js';
33
 
34
  import { trbtoken, trburl } from '../config.js';
35
+ import { report } from 'process';
36
 
37
 
38
  async function audioContent(url) {
 
123
  return Math.floor(Math.random() * (end - start) + start);
124
  }
125
 
126
+ async function FBDownloaderV2(url) {
127
+ const results = await getFbVideoInfo(url);
128
+ console.log(results);
129
+ return results;
130
+ }
131
+
132
+
133
  export {
134
  facebookdl,
135
  savefrom,
 
162
  TelegramUseLog,
163
  audioContent,
164
  generateRandomTimestamp,
165
+ FBDownloaderV2,
166
  };
package.json CHANGED
@@ -19,6 +19,7 @@
19
  "gifted-dls": "*",
20
  "buffer": "*",
21
  "another-fb-video-downloader": "*",
 
22
  "happy-dl": "*",
23
  "mongoose": "*",
24
  "multer": "*",
 
19
  "gifted-dls": "*",
20
  "buffer": "*",
21
  "another-fb-video-downloader": "*",
22
+ "fb-downloader-scrapper": "*",
23
  "happy-dl": "*",
24
  "mongoose": "*",
25
  "multer": "*",
plugins/alldownloader.js CHANGED
@@ -25,6 +25,7 @@ import {
25
  XInfoDownloaderV2,
26
  SeachTiktok,
27
  TelegramUseLog,
 
28
  } from '../lib/all.js';
29
 
30
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
@@ -61,6 +62,49 @@ async function downloadMedia(media) {
61
  }
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  /**
65
  * @swagger
66
  * /api/v1/dl/xnxx-info-v2:
 
25
  XInfoDownloaderV2,
26
  SeachTiktok,
27
  TelegramUseLog,
28
+ FBDownloaderV2,
29
  } from '../lib/all.js';
30
 
31
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
 
62
  }
63
  }
64
 
65
+ /**
66
+ * @swagger
67
+ * /api/v1/dl/fb-v2:
68
+ * get:
69
+ * summary: Fb V2 Downloader
70
+ * tags: [ALL-Downloader]
71
+ * parameters:
72
+ * - in: query
73
+ * name: url
74
+ * required: true
75
+ * description: null
76
+ * schema:
77
+ * type: string
78
+ * - in: header
79
+ * name: x-api-key
80
+ * required: true
81
+ * description: API key for authentication
82
+ * schema:
83
+ * type: string
84
+ * responses:
85
+ * 200:
86
+ * description: Success
87
+ * 400:
88
+ * description: Bad Request (e.g., missing or invalid URL)
89
+ * 401:
90
+ * description: Unauthorized (e.g., missing or invalid API key)
91
+ * 500:
92
+ * description: Internal Server Error
93
+ */
94
+ AllDlRoutes.get('/api/v1/dl/fb-v2', authenticateApiKey, apiLimiter, async (req, res) => {
95
+ try {
96
+ const q = req.query.url;
97
+
98
+ if (!q) {
99
+ return res.status(400).json({ error: "url parameter is required." });
100
+ }
101
+ const results = await FBDownloaderV2(q);
102
+ res.json({ message: results });
103
+ } catch (error) {
104
+ res.status(500).json({ error: error.message });
105
+ }
106
+ });
107
+
108
  /**
109
  * @swagger
110
  * /api/v1/dl/xnxx-info-v2: