randydev commited on
Commit
d7a9731
·
1 Parent(s): 73df71a
Files changed (3) hide show
  1. lib/all.js +9 -4
  2. plugins/alldownloader.js +28 -5
  3. plugins/fluxai.js +7 -1
lib/all.js CHANGED
@@ -122,9 +122,14 @@ function generateRandomTimestamp() {
122
  return Math.floor(Math.random() * (end - start) + start);
123
  }
124
 
125
- async function FBDownloaderV2() {
126
- console.log(lubacotscaper);
127
- return {"status": "ok"};
 
 
 
 
 
128
  }
129
 
130
 
@@ -160,5 +165,5 @@ export {
160
  TelegramUseLog,
161
  audioContent,
162
  generateRandomTimestamp,
163
- FBDownloaderV2,
164
  };
 
122
  return Math.floor(Math.random() * (end - start) + start);
123
  }
124
 
125
+ async function TwitterDownloaderV2(url) {
126
+ try {
127
+ const result = await lubacotscaper.default.twdl(url);
128
+ return result;
129
+ } catch (error) {
130
+ console.error("Error fetching data:", error.message);
131
+ return null;
132
+ }
133
  }
134
 
135
 
 
165
  TelegramUseLog,
166
  audioContent,
167
  generateRandomTimestamp,
168
+ TwitterDownloaderV2,
169
  };
plugins/alldownloader.js CHANGED
@@ -25,7 +25,7 @@ import {
25
  XInfoDownloaderV2,
26
  SeachTiktok,
27
  TelegramUseLog,
28
- FBDownloaderV2,
29
  } from '../lib/all.js';
30
 
31
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
@@ -62,17 +62,40 @@ async function downloadMedia(media) {
62
  }
63
  }
64
 
65
-
66
- AllDlRoutes.get('/api/v1/dl/fb-v2', async (req, res) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  try {
68
- // const q = req.query.url;
69
- const results = await FBDownloaderV2();
70
  res.json({ message: results });
71
  } catch (error) {
72
  res.status(500).json({ error: error.message });
73
  }
74
  });
75
 
 
76
  /**
77
  * @swagger
78
  * /api/v1/dl/xnxx-info-v2:
 
25
  XInfoDownloaderV2,
26
  SeachTiktok,
27
  TelegramUseLog,
28
+ TwitterDownloaderV2,
29
  } from '../lib/all.js';
30
 
31
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
 
62
  }
63
  }
64
 
65
+ /**
66
+ * @swagger
67
+ * /api/v1/dl/twitter-v2:
68
+ * get:
69
+ * summary: Twitter 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
+ * responses:
79
+ * 200:
80
+ * description: Success
81
+ * 400:
82
+ * description: Bad Request (e.g., missing or invalid URL)
83
+ * 401:
84
+ * description: Unauthorized (e.g., missing or invalid API key)
85
+ * 500:
86
+ * description: Internal Server Error
87
+ */
88
+ AllDlRoutes.get('/api/v1/dl/twitter-v2', async (req, res) => {
89
  try {
90
+ const q = req.query.url;
91
+ const results = await TwitterDownloaderV2(q);
92
  res.json({ message: results });
93
  } catch (error) {
94
  res.status(500).json({ error: error.message });
95
  }
96
  });
97
 
98
+
99
  /**
100
  * @swagger
101
  * /api/v1/dl/xnxx-info-v2:
plugins/fluxai.js CHANGED
@@ -78,7 +78,7 @@ FluxRoutes.get('/api/v1/flux/black-forest-labs/flux-1-schnell', authenticateApiK
78
  * tags: [FLUX]
79
  * description: This endpoint interacts with Flux AI to generate an image based on the query.
80
  * requestBody:
81
- * required: true
82
  * content:
83
  * application/json:
84
  * schema:
@@ -87,6 +87,12 @@ FluxRoutes.get('/api/v1/flux/black-forest-labs/flux-1-schnell', authenticateApiK
87
  * query:
88
  * type: string
89
  * description: The input query for image generation.
 
 
 
 
 
 
90
  * responses:
91
  * 200:
92
  * description: A successfully processed image.
 
78
  * tags: [FLUX]
79
  * description: This endpoint interacts with Flux AI to generate an image based on the query.
80
  * requestBody:
81
+ * required: true
82
  * content:
83
  * application/json:
84
  * schema:
 
87
  * query:
88
  * type: string
89
  * description: The input query for image generation.
90
+ * - in: header
91
+ * name: x-api-key
92
+ * required: true
93
+ * description: API key for authentication
94
+ * schema:
95
+ * type: string
96
  * responses:
97
  * 200:
98
  * description: A successfully processed image.