Update plugins/alldownloader.js
Browse files- plugins/alldownloader.js +44 -4
plugins/alldownloader.js
CHANGED
@@ -46,6 +46,50 @@ async function downloadMedia(media) {
|
|
46 |
}
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
/**
|
50 |
* @swagger
|
51 |
* /api/v1/dl/sfilemobi:
|
@@ -90,8 +134,6 @@ AllDlRoutes.get('/api/v1/dl/sfilemobi', authenticateApiKey, apiLimiter, async (r
|
|
90 |
}
|
91 |
});
|
92 |
|
93 |
-
|
94 |
-
|
95 |
/**
|
96 |
* @swagger
|
97 |
* /api/v1/dl/tiktok:
|
@@ -136,7 +178,6 @@ AllDlRoutes.get('/api/v1/dl/tiktok', authenticateApiKey, apiLimiter, async (req,
|
|
136 |
}
|
137 |
});
|
138 |
|
139 |
-
|
140 |
/**
|
141 |
* @swagger
|
142 |
* /api/v1/dl/tiktok-v2:
|
@@ -232,7 +273,6 @@ AllDlRoutes.get('/api/v1/dl/fb', authenticateApiKey, apiLimiter, async (req, res
|
|
232 |
}
|
233 |
});
|
234 |
|
235 |
-
|
236 |
/**
|
237 |
* @swagger
|
238 |
* /api/v1/dl/snapsave:
|
|
|
46 |
}
|
47 |
}
|
48 |
|
49 |
+
/**
|
50 |
+
* @swagger
|
51 |
+
* /api/v1/dl/sfilemobi-search:
|
52 |
+
* get:
|
53 |
+
* summary: Sfilemobi Search Downloader
|
54 |
+
* tags: [ALL-Downloader]
|
55 |
+
* parameters:
|
56 |
+
* - in: query
|
57 |
+
* name: q
|
58 |
+
* required: true
|
59 |
+
* description: The URL of the TikTok video to be processed
|
60 |
+
* schema:
|
61 |
+
* type: string
|
62 |
+
* - in: header
|
63 |
+
* name: x-api-key
|
64 |
+
* required: true
|
65 |
+
* description: API key for authentication
|
66 |
+
* schema:
|
67 |
+
* type: string
|
68 |
+
* responses:
|
69 |
+
* 200:
|
70 |
+
* description: Success
|
71 |
+
* 400:
|
72 |
+
* description: Bad Request (e.g., missing or invalid URL)
|
73 |
+
* 401:
|
74 |
+
* description: Unauthorized (e.g., missing or invalid API key)
|
75 |
+
* 500:
|
76 |
+
* description: Internal Server Error
|
77 |
+
*/
|
78 |
+
AllDlRoutes.get('/api/v1/dl/sfilemobi-search', authenticateApiKey, apiLimiter, async (req, res) => {
|
79 |
+
try {
|
80 |
+
const q = req.query.q;
|
81 |
+
|
82 |
+
if (!q) {
|
83 |
+
return res.status(400).json({ error: "URL parameter is required." });
|
84 |
+
}
|
85 |
+
|
86 |
+
const results = await sfilemobiSearch(q);
|
87 |
+
res.json({ results });
|
88 |
+
} catch (error) {
|
89 |
+
res.status(500).json({ error: error.message });
|
90 |
+
}
|
91 |
+
});
|
92 |
+
|
93 |
/**
|
94 |
* @swagger
|
95 |
* /api/v1/dl/sfilemobi:
|
|
|
134 |
}
|
135 |
});
|
136 |
|
|
|
|
|
137 |
/**
|
138 |
* @swagger
|
139 |
* /api/v1/dl/tiktok:
|
|
|
178 |
}
|
179 |
});
|
180 |
|
|
|
181 |
/**
|
182 |
* @swagger
|
183 |
* /api/v1/dl/tiktok-v2:
|
|
|
273 |
}
|
274 |
});
|
275 |
|
|
|
276 |
/**
|
277 |
* @swagger
|
278 |
* /api/v1/dl/snapsave:
|