Update index.js
Browse files
index.js
CHANGED
|
@@ -717,8 +717,8 @@ return res.json({ message: e.message });
|
|
| 717 |
.get('/ytdl', async (req, res) => {
|
| 718 |
try {
|
| 719 |
let { url } = req.query;
|
| 720 |
-
if (!ytIdRegex.test(url)) return res.json({ message: 'Invalid URL' });
|
| 721 |
-
|
| 722 |
let data = await ytAPI(url) || {};
|
| 723 |
let videoID = ytdl.getVideoID(url);
|
| 724 |
let dataInfo = await yts({ videoId: videoID }) || {};
|
|
|
|
| 717 |
.get('/ytdl', async (req, res) => {
|
| 718 |
try {
|
| 719 |
let { url } = req.query;
|
| 720 |
+
//if (!ytIdRegex.test(url)) return res.json({ message: 'Invalid URL' });
|
| 721 |
+
if (!ytdl.validateURL(url)) return res.json({ message: 'Invalid URL' });
|
| 722 |
let data = await ytAPI(url) || {};
|
| 723 |
let videoID = ytdl.getVideoID(url);
|
| 724 |
let dataInfo = await yts({ videoId: videoID }) || {};
|