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