Update index.js
Browse files328 unmodified lines329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368118 unmodified lines487488489490491492493494495496497498499500501502328 unmodified lines{"title": "Tiktok Downloader","method": "GET","example": `${host}/tt?url=`,},{"title": "Facebook Downloader","method": "GET","example": `${host}/fb?url=`,},{"title": "Instagram Downloader","method": "GET","example": `${host}/ig?url=`,},{"title": "Youtube Downloader","method": "GET","example": `${host}/ytdl?url=`,},{"title": "Youtube Search","method": "GET","example": `${host}/ytsearch?q=`,},{"title": "Pinterest Downloader","method": "GET","example": `${host}/pindl?url=`,},{"title": "Mediafire Downloader","method": "GET","example": `${host}/mediafire?url=`,}]})}).get('/yt', async (req, res) => {const host = 'https://' + req.get('host');try {118 unmodified linesreturn res.json({ message: e.message });}}).get('/mega', async (req,res) => {try {let {url} = req.queryif (!/https:\/\/mega\.nz\/file\/[a-zA-Z0-9]{8}#[a-zA-Z0-9-_]{43}/.test(url)) {return res.json({ message: 'Invalid URL' });}console.log(url)} catch (e) {console.log(e);return res.json({ message: e.message });}}).listen(7860, () => console.log('App running on port 7860'));328 unmodified lines329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374118 unmodified lines493494495496497498499500501502503504505506507508509328 unmodified lines{"title": "Tiktok Downloader","method": "GET","example": "${host}/tt?url="},{"title": "Facebook Downloader","method": "GET","example": "${host}/fb?url="},{"title": "Instagram Downloader","method": "GET","example": "${host}/ig?url="},{"title": "Youtube Downloader","method": "GET","example": "${host}/ytdl?url="},{"title": "Youtube Search","method": "GET","example": "${host}/ytsearch?q="},{"title": "Pinterest Downloader","method": "GET","example": "${host}/pindl?url="},{"title": "Mediafire Downloader","method": "GET","example": "${host}/mediafire?url="},{"title": "Mega Downloader","method": "POST","example": "${host}/mega","body": "JSON.stringify({ \"url\": \"example.com\" })"}]}).get('/yt', async (req, res) => {const host = 'https://' + req.get('host');try {118 unmodified linesreturn res.json({ message: e.message });}}).post('/mega', async (req, res) => {try {let { url } = req.body;if (!/https:\/\/mega\.nz\/file\/[a-zA-Z0-9]{8}#[a-zA-Z0-9-_]{43}/.test(url)) {return res.json({ message: 'Invalid URL' });}console.log(url);return res.json({ message: 'URL is valid' });} catch (e) {console.log(e);return res.json({ message: e.message });}});.listen(7860, () => console.log('App running on port 7860'));
index.js+25-18