Update index.js
Browse files26 unmodified lines272829303031323334353637383940414243444546474849505152535455565758596061626364656667686970283 unmodified lines35435535635735835936036136236336492 unmodified lines45745845946046146246346446546646746846947047147247347447547647726 unmodified lines return response;};
//INDOWN
// MEDIAFIRE DLasync function mediafire(url) { return new Promise(async(resolve, reject) => { var a, b; if (!/https?:\/\/(www\.)?mediafire\.com/.test(url)) return resolve() const data = await axios.get(url, {headers:headers}).catch(function (error) {}) if (!data) { resolve() } else { const $ = cheerio.load(data.data); const Url = ($('#downloadButton').attr('href') || '').trim(); const url2 = ($('#download_link > a.retry').attr('href') || '').trim(); const $intro = $('div.dl-info > div.intro'); const filename = $intro.find('div.filename').text().trim(); const filetype = $intro.find('div.filetype > span').eq(0).text().trim(); const ext = ((b = (a = /\(\.(.*?)\)/.exec($intro.find('div.filetype > span').eq(1).text())) === null || a === void 0 ? void 0 : a[1]) === null || b === void 0 ? void 0 : b.trim()) || 'bin'; const $li = $('div.dl-info > ul.details > li'); const aploud = $li.eq(1).find('span').text().trim(); const filesize = $li.eq(0).find('span').text().trim(); const filesizeB = (0, formatSize)(filesize); const result = { url: Url || url2, url2, filename, filetype, ext, upload_date: aploud, filesize, filesizeB }; resolve(result) } })}
//SAVEIGasync function igdl(query) {url_dl = [];let headers = {283 unmodified lines "title": "Pinterest Downloader", "method": "GET", "example": `${host}/pindl?url=`, }, { "title": "Mediafire Downloader", "method": "GET", "example": `${host}/mediafire?url=`, } ]})})92 unmodified lines return res.json({ message: e.message }); } }) .get('/mediafire', async (req, res) => { try { let { url } = req.query if (!/https?:\/\/(www\.)?mediafire\.com\/(file|download)/i.test(url)) { return res.json({ message: 'Invalid URL' }); } else if (/https?:\/\/(www\.)?mediafire\.com\/file\/[^\/]+\/[^\/]+$/i.test(url)) { return res.json({ message: 'Invalid URL' }); } let data = await mediafire(url) return res.json(data) } catch (e) { console.log(e); return res.json({ message: e.message }); } }) .get('/ytdl', async (req, res) => { try { let { url } = req.queryindex.js+58-1