Update index.js
Browse files
index.js
CHANGED
|
@@ -364,9 +364,8 @@ app.all('/', (req, res) => {
|
|
| 364 |
},
|
| 365 |
{
|
| 366 |
"title": "Mega Downloader",
|
| 367 |
-
"method": "
|
| 368 |
-
"example": `${host}/mega
|
| 369 |
-
"body": "JSON.stringify({ \"url\": \"example.com\" })"
|
| 370 |
}
|
| 371 |
]
|
| 372 |
});
|
|
@@ -495,9 +494,9 @@ app.all('/', (req, res) => {
|
|
| 495 |
return res.json({ message: e.message });
|
| 496 |
}
|
| 497 |
});
|
| 498 |
-
app.
|
| 499 |
try {
|
| 500 |
-
let { url } = req.
|
| 501 |
if (!/https:\/\/mega\.nz\/file\/[a-zA-Z0-9]{8}#[a-zA-Z0-9-_]{43}/.test(url)) {
|
| 502 |
return res.json({ message: 'Invalid URL' });
|
| 503 |
}
|
|
|
|
| 364 |
},
|
| 365 |
{
|
| 366 |
"title": "Mega Downloader",
|
| 367 |
+
"method": "GET",
|
| 368 |
+
"example": `${host}/mega?url=`+ '${encodeURIComponent(${url})}',
|
|
|
|
| 369 |
}
|
| 370 |
]
|
| 371 |
});
|
|
|
|
| 494 |
return res.json({ message: e.message });
|
| 495 |
}
|
| 496 |
});
|
| 497 |
+
app.get('/mega', async (req, res) => {
|
| 498 |
try {
|
| 499 |
+
let { url } = req.query;
|
| 500 |
if (!/https:\/\/mega\.nz\/file\/[a-zA-Z0-9]{8}#[a-zA-Z0-9-_]{43}/.test(url)) {
|
| 501 |
return res.json({ message: 'Invalid URL' });
|
| 502 |
}
|