Update index.js
Browse files23 unmodified lines242526272829291 unmodified lines3213223233243253263273283293301 unmodified line3323333343353363373383393403413423433443454 unmodified lines3503513523533543553563573583593603612 unmodified lines3643653663673683693703713723733743753761 unmodified line3783793803813823833843853863878 unmodified lines39639739839940040140223 unmodified linesreturn response;};//FBDLasync function fby2mate(url) {291 unmodified linesif (!result) return res.json({ message: 'Error: can\'t download' });res.redirect(await result.download());} catch (e) {console.log(e);res.json({ message: e });}}).get('/tt', async (req, res) => {try {let { url } = req.query1 unmodified lineif (!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})} catch (e) {console.log(e);res.json({ message: e });}}).get('/pindl', async (req, res) => {4 unmodified lineslet 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})} catch (e) {console.log(e);res.json({ message: e });}}).get('/fb', async (req, res) => {2 unmodified lineslet 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})} catch (e) {console.log(e);res.json({ message: e });}}).get('/ytsearch', async (req, res) => {try {1 unmodified lineif (!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);} catch (e) {console.log(e);res.json({ message: e });}}).get('/ytdl', async (req, res) => {8 unmodified lines})} catch (e) {console.log(e);res.json({ message: e });}}).listen(7860, () => console.log('App running on port 7860'));23 unmodified lines24252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475291 unmodified lines3673683693703713723733743753763773783793803813823833843853863873881 unmodified line3903913923933943953963973983994004 unmodified lines4054064074084094104114124134142 unmodified lines4174184194204214224234244254264271 unmodified line4294304314324334344354364374388 unmodified lines44744844945045145245323 unmodified linesreturn 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 linesif (!result) return res.json({ message: 'Error: can\'t download' });res.redirect(await result.download());} catch (e) {console.log(e);return res.json({ message: e });}}).get('/ig', async (req,res) => {try {let {url} = req.querylet 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 lineif (!regex.test(url)) return res.json({ message: 'Invalid URL' });let data = await fetch(`https://tikwm.com/api/?url=` + url)data = await data.json()if (!data) return res.json({ message: 'API TO API KOID:v' });return res.json(data)} catch (e) {console.log(e);return res.json({ message: e });}}).get('/pindl', async (req, res) => {4 unmodified lineslet 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(data)} catch (e) {console.log(e);return res.json({ message: e });}}).get('/fb', async (req, res) => {2 unmodified lineslet 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(data)} catch (e) {console.log(e);return res.json({ message: e });}}).get('/ytsearch', async (req, res) => {try {1 unmodified lineif (!q) return res.json({ message: 'Input parameter q' });let data = await yts(q);if (!data.all[0]) return res.json({ message: 'Not found' });return res.json(data.all);} catch (e) {console.log(e);return res.json({ message: e });}}).get('/ytdl', async (req, res) => {8 unmodified lines})} catch (e) {console.log(e);return res.json({ message: e });}}).listen(7860, () => console.log('App running on port 7860'));
index.js+72-21