Update index.js
Browse files5 unmodified lines678910111213375 unmodified lines3893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204213913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754765 unmodified linesconst util = require('util');const axios = require('axios');const FormData = require('form-data')const cp = require('child_process')const os = require('os')const cheerio = require('cheerio')const cloudscraper = require('cloudscraper') const { File } = require('megajs')375 unmodified linesapp.use(morgan('dev'));app.use(express.json());
const v8 = require('v8');
app.all('/', (req, res) => { const status = {} status['diskUsage'] = cp.execSync('du -sh').toString().split('M')[0] + ' MB' const used = process.memoryUsage() for (let x in used) status[x] = formatSize(used[x]) const totalmem = os.totalmem() const freemem = os.freemem() status['memoryUsage'] = `${formatSize(totalmem - freemem)} / ${formatSize(totalmem)}` // Menambahkan statistik heap V8 const heapStats = v8.getHeapStatistics(); for (let x in heapStats) status[x] = formatSize(heapStats[x]) // Menambahkan semua properti dan metode dari v8 for (let x in v8) { if (typeof v8[x] === 'function') { status[x] = 'function' } else { status[x] = v8[x] } } const host = 'https://' + req.get('host'); res.json({ creator: `@${process.env['SPACE_AUTHOR_NAME'] || 'ALOK FF'}`, message: 'Hello World!', const host = 'https://' + req.get('host'); res.json({ "List": [ { "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": "GET", "example": `${host}/mega?url=`+ '${encodeURIComponent(${url})}', }, { "title": "Twitter/X Downloader", "method": "GET", "example": `${host}/twitter?url=`, } ] }); uptime: new Date(process.uptime() * 1000).toUTCString().split(' ')[4], status, "List": [ { "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": "GET", "example": `${host}/mega?url=`+ `${encodeURIComponent("url")}`, }, { "title": "Twitter/X Downloader", "method": "GET", "example": `${host}/twitter?url=`, } ] });});
app.get('/yt', async (req, res) => { const host = 'https://' + req.get('host'); try {index.js+82-50