randydev commited on
Commit
3f1a41e
·
verified ·
1 Parent(s): 30e6e8c

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +46 -1
plugins/alldownloader.js CHANGED
@@ -10,7 +10,8 @@ import {
10
  sfilemobiSearch,
11
  TiktokDownloader,
12
  XnxxDownloader,
13
- TwitterDownloader
 
14
  } from '../lib/all.js';
15
 
16
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
@@ -91,6 +92,50 @@ AllDlRoutes.get('/api/v1/dl/sfilemobi-search', authenticateApiKey, apiLimiter, a
91
  }
92
  });
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
  * @swagger
96
  * /api/v1/dl/twitter:
 
10
  sfilemobiSearch,
11
  TiktokDownloader,
12
  XnxxDownloader,
13
+ TwitterDownloader,
14
+ InstagramDownloader
15
  } from '../lib/all.js';
16
 
17
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
 
92
  }
93
  });
94
 
95
+ /**
96
+ * @swagger
97
+ * /api/v1/dl/instagram:
98
+ * get:
99
+ * summary: Instagram Downloader
100
+ * tags: [ALL-Downloader]
101
+ * parameters:
102
+ * - in: query
103
+ * name: url
104
+ * required: true
105
+ * description: null
106
+ * schema:
107
+ * type: string
108
+ * - in: header
109
+ * name: x-api-key
110
+ * required: true
111
+ * description: API key for authentication
112
+ * schema:
113
+ * type: string
114
+ * responses:
115
+ * 200:
116
+ * description: Success
117
+ * 400:
118
+ * description: Bad Request (e.g., missing or invalid URL)
119
+ * 401:
120
+ * description: Unauthorized (e.g., missing or invalid API key)
121
+ * 500:
122
+ * description: Internal Server Error
123
+ */
124
+ AllDlRoutes.get('/api/v1/dl/instagram', authenticateApiKey, apiLimiter, async (req, res) => {
125
+ try {
126
+ const url = req.query.url;
127
+
128
+ if (!url) {
129
+ return res.status(400).json({ error: "URL parameter is required." });
130
+ }
131
+
132
+ const results = await InstagramDownloader(url);
133
+ res.json({ results });
134
+ } catch (error) {
135
+ res.status(500).json({ error: error.message });
136
+ }
137
+ });
138
+
139
  /**
140
  * @swagger
141
  * /api/v1/dl/twitter: