- plugins/alldownloader.js +4 -26
plugins/alldownloader.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import express from 'express';
|
2 |
-
import
|
3 |
import { Database } from '../database/database.js';
|
4 |
import {
|
5 |
facebookdl,
|
@@ -65,20 +65,6 @@ async function downloadMedia(media) {
|
|
65 |
* get:
|
66 |
* summary: Youtube DL Downloader
|
67 |
* tags: [ALL-Downloader]
|
68 |
-
* parameters:
|
69 |
-
* - in: query
|
70 |
-
* name: url
|
71 |
-
* required: true
|
72 |
-
* description: null
|
73 |
-
* schema:
|
74 |
-
* type: string
|
75 |
-
* - in: header
|
76 |
-
* name: x-api-key
|
77 |
-
* required: true
|
78 |
-
* description: API key for authentication
|
79 |
-
* schema:
|
80 |
-
* type: string
|
81 |
-
* example: "lu api key di @aknuserbot telegram"
|
82 |
* responses:
|
83 |
* 200:
|
84 |
* description: Success
|
@@ -89,18 +75,10 @@ async function downloadMedia(media) {
|
|
89 |
* 500:
|
90 |
* description: Internal Server Error
|
91 |
*/
|
92 |
-
AllDlRoutes.get('/api/v1/dl/youtube-dl',
|
93 |
try {
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
const info = await ytdl.getInfo(url);
|
98 |
-
const { title, video_url, thumbnails } = info.videoDetails;
|
99 |
-
return res.json({
|
100 |
-
title,
|
101 |
-
video_url,
|
102 |
-
thumbnail: thumbnails?.[0]?.url || null,
|
103 |
-
});
|
104 |
} catch (err) {
|
105 |
res.status(500).json({ error: err.message });
|
106 |
}
|
|
|
1 |
import express from 'express';
|
2 |
+
import { ytmp3 } = require('@kelvdra/scraper');
|
3 |
import { Database } from '../database/database.js';
|
4 |
import {
|
5 |
facebookdl,
|
|
|
65 |
* get:
|
66 |
* summary: Youtube DL Downloader
|
67 |
* tags: [ALL-Downloader]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
* responses:
|
69 |
* 200:
|
70 |
* description: Success
|
|
|
75 |
* 500:
|
76 |
* description: Internal Server Error
|
77 |
*/
|
78 |
+
AllDlRoutes.get('/api/v1/dl/youtube-dl', async (req, res) => {
|
79 |
try {
|
80 |
+
console.dir(ytmp3)
|
81 |
+
res.json({ message: "Ok" });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
} catch (err) {
|
83 |
res.status(500).json({ error: err.message });
|
84 |
}
|