randydev commited on
Commit
b6522a6
·
verified ·
1 Parent(s): a71b34c

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +44 -0
plugins/alldownloader.js CHANGED
@@ -1,4 +1,5 @@
1
  import express from 'express';
 
2
  import {
3
  facebookdl,
4
  savefrom,
@@ -54,6 +55,49 @@ async function downloadMedia(media) {
54
  }
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  /**
58
  * @swagger
59
  * /api/v1/dl/instagram-v2:
 
1
  import express from 'express';
2
+ const { xnxxSearch, xnxxDownload } = 'xnxx-scraper';
3
  import {
4
  facebookdl,
5
  savefrom,
 
55
  }
56
  }
57
 
58
+ /**
59
+ * @swagger
60
+ * /api/v1/dl/xnxxsearch-v2:
61
+ * get:
62
+ * summary: Xnxx Search V2 Downloader
63
+ * tags: [ALL-Downloader]
64
+ * parameters:
65
+ * - in: query
66
+ * name: q
67
+ * required: true
68
+ * description: null
69
+ * schema:
70
+ * type: string
71
+ * - in: header
72
+ * name: x-api-key
73
+ * required: true
74
+ * description: API key for authentication
75
+ * schema:
76
+ * type: string
77
+ * responses:
78
+ * 200:
79
+ * description: Success
80
+ * 400:
81
+ * description: Bad Request (e.g., missing or invalid URL)
82
+ * 401:
83
+ * description: Unauthorized (e.g., missing or invalid API key)
84
+ * 500:
85
+ * description: Internal Server Error
86
+ */
87
+ AllDlRoutes.get('/api/v1/dl/xnxxsearch-v2', authenticateApiKey, apiLimiter, async (req, res) => {
88
+ try {
89
+ const q = req.query.q;
90
+
91
+ if (!q) {
92
+ return res.status(400).json({ error: "URL parameter is required." });
93
+ }
94
+ const results = xnxxSearch(q);
95
+ res.json({ results });
96
+ } catch (error) {
97
+ res.status(500).json({ error: error.message });
98
+ }
99
+ });
100
+
101
  /**
102
  * @swagger
103
  * /api/v1/dl/instagram-v2: