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