Update index.js
Browse files23 unmodified lines24252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475291 unmodified lines3673683693243253263703713723733743753763773783793803813823833843853863873881 unmodified line3903913923353933373383393943953963423973983994004 unmodified lines4054064073533543554084094103584114124134142 unmodified lines4174184193673683694204213713723734224234244254264271 unmodified line4294304313814324334343844354364374388 unmodified lines44744844939945045145245323 unmodified lines return response;};
//INDOWNasync function igdl(url) { let res = await axios("https://indown.io/") let _$ = cheerio.load(res.data) let referer = _$("input[name=referer]").val() let locale = _$("input[name=locale]").val() let _token = _$("input[name=_token]").val() let { data } = await axios.post( "https://indown.io/download", new URLSearchParams({ link: url, referer, locale, _token, }), { headers: { cookie: res.headers["set-cookie"].join(" "), }, } ) let $ = cheerio.load(data) let result = [] let __$ = cheerio.load($("#result").html()) __$("video").each(function () { let $$ = $(this) result.push({ author: creator, type: "video", thumbnail: $$.attr("poster"), url: $$.find("source").attr("src"), }) }) __$("img").each(function () { let $$ = $(this) result.push({ author: creator, type: "image", url: $$.attr("src"), }) })
return result}
//FBDLasync function fby2mate(url) {291 unmodified lines if (!result) return res.json({ message: 'Error: can\'t download' }); res.redirect(await result.download()); } catch (e) { console.log(e); res.json({ message: e }); } console.log(e); return res.json({ message: e }); } }) .get('/ig', async (req,res) => { try { let {url} = req.query let regex = /https?:\/\/(www\.)?instagram\.com\/(p|reel|tv)/; if (!regex.test(url)) return res.json({ message: 'Invalid URL' }); let data = await igdl(url) return res.json(data) } catch (e) { console.log(e); return res.json({ message: e }); } }) .get('/tt', async (req, res) => { try { let { url } = req.query1 unmodified line if (!regex.test(url)) return res.json({ message: 'Invalid URL' }); let data = await fetch(`https://tikwm.com/api/?url=` + url) data = await data.json() console.log(data) if (!data) return res.json({ message: 'API TO API KOID:v' }); return res.json({ result: await data }) return res.json(data) } catch (e) { console.log(e); res.json({ message: e }); return res.json({ message: e }); } }) .get('/pindl', async (req, res) => {4 unmodified lines let data = await fetch(`https://pinterestdownloader.io/id/frontendService/DownloaderService?url=` + url) data = await data.json() if (!data) return res.json({ message: 'API TO API KOID:v' }); return res.json({ result: data }) return res.json(data) } catch (e) { console.log(e); res.json({ message: e }); return res.json({ message: e }); } }) .get('/fb', async (req, res) => {2 unmodified lines let regex = /https?:\/\/(fb\.watch|(www\.|web\.|m\.)?facebook\.com)/; if (!regex.test(url)) return res.json({ message: 'Invalid URL' }); let data = await fby2mate(url) return res.json({ result:data }) return res.json(data) } catch (e) { console.log(e); res.json({ message: e }); } console.log(e); return res.json({ message: e }); } }) .get('/ytsearch', async (req, res) => { try {1 unmodified line if (!q) return res.json({ message: 'Input parameter q' }); let data = await yts(q); if (!data.all[0]) return res.json({ message: 'Not found' }); res.json(data.all); return res.json(data.all); } catch (e) { console.log(e); res.json({ message: e }); return res.json({ message: e }); } }) .get('/ytdl', async (req, res) => {8 unmodified lines }) } catch (e) { console.log(e); res.json({ message: e }); return res.json({ message: e }); } }) .listen(7860, () => console.log('App running on port 7860'));index.js+72-21