randydev commited on
Commit
1b55172
·
verified ·
1 Parent(s): 450b31c

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +46 -1
plugins/alldownloader.js CHANGED
@@ -7,6 +7,7 @@ import {
7
  tiktokdl,
8
  youtubedl,
9
  sfilemobi,
 
10
  sfilemobiSearch,
11
  TiktokDownloader,
12
  XnxxDownloader,
@@ -14,7 +15,7 @@ import {
14
  InstagramDownloader,
15
  TeraboxDownloader,
16
  TeraboxV2Downloader,
17
- capcutdl
18
  } from '../lib/all.js';
19
 
20
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
@@ -51,6 +52,50 @@ async function downloadMedia(media) {
51
  }
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  /**
55
  * @swagger
56
  * /api/v1/dl/sfilemobi-search:
 
7
  tiktokdl,
8
  youtubedl,
9
  sfilemobi,
10
+ capcutdl,
11
  sfilemobiSearch,
12
  TiktokDownloader,
13
  XnxxDownloader,
 
15
  InstagramDownloader,
16
  TeraboxDownloader,
17
  TeraboxV2Downloader,
18
+ PinterestDownloader
19
  } from '../lib/all.js';
20
 
21
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
 
52
  }
53
  }
54
 
55
+ /**
56
+ * @swagger
57
+ * /api/v1/dl/pint:
58
+ * get:
59
+ * summary: Pinterest Search Downloader
60
+ * tags: [ALL-Downloader]
61
+ * parameters:
62
+ * - in: query
63
+ * name: q
64
+ * required: true
65
+ * description: null
66
+ * schema:
67
+ * type: string
68
+ * - in: header
69
+ * name: x-api-key
70
+ * required: true
71
+ * description: API key for authentication
72
+ * schema:
73
+ * type: string
74
+ * responses:
75
+ * 200:
76
+ * description: Success
77
+ * 400:
78
+ * description: Bad Request (e.g., missing or invalid URL)
79
+ * 401:
80
+ * description: Unauthorized (e.g., missing or invalid API key)
81
+ * 500:
82
+ * description: Internal Server Error
83
+ */
84
+ AllDlRoutes.get('/api/v1/dl/pint', authenticateApiKey, apiLimiter, async (req, res) => {
85
+ try {
86
+ const q = req.query.q;
87
+
88
+ if (!q) {
89
+ return res.status(400).json({ error: "URL parameter is required." });
90
+ }
91
+ const results = await PinterestDownloader(q);
92
+ res.json({ results });
93
+ } catch (error) {
94
+ res.status(500).json({ error: error.message });
95
+ }
96
+ });
97
+
98
+
99
  /**
100
  * @swagger
101
  * /api/v1/dl/sfilemobi-search: