/** * * Name Scrape: Terabox Download + Anti Limit * By Zx * Saluran Edmin: https://whatsapp.com/channel/0029Vb6P2e1E50UZYaX4wI0W * Website Download Video: https://savenest.web.id * */ const axios = require('axios'); function generateRandomFingerprint() { const cpuList = [4, 8, 12, 16]; const ramList = [4, 8, 16, 32]; const rendererList = [ "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 Direct3D11 vs_5_0 ps_5_0, D3D11)", "ANGLE (AMD, AMD Radeon Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)", "ANGLE (Intel, Intel(R) Iris(R) Xe Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)", "Mali-G57 MC2", "Adreno (TM) 610" ]; const isMobile = Math.random() > 0.5; return { cpu: cpuList[Math.floor(Math.random() * cpuList.length)], memory: ramList[Math.floor(Math.random() * ramList.length)], touch: isMobile ? Math.floor(Math.random() * 5) + 1 : 0, platform: isMobile ? "Linux armv81" : "Win32", lang: "id-ID", vendor: "Google Inc.", webgl_vendor: "Google Inc. (NVIDIA)", webgl_renderer: rendererList[Math.floor(Math.random() * rendererList.length)], // Acak User-Agent sesuai platform ua: isMobile ? 'Mozilla/5.0 (Linux; Android 13; CPH2565) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', backup_token: null }; } const mergeCookies = (newCookieHeaders, currentCookies = '') => { if (!newCookieHeaders) return currentCookies; const newCookiesStr = newCookieHeaders.map(c => c.split(';')[0].trim()).join('; '); return currentCookies ? `${currentCookies}; ${newCookiesStr}` : newCookiesStr; }; async function scrapeTerabox(targetUrl) { const baseUrl = 'https://flowvideoplayer.com'; const fingerprint = generateRandomFingerprint(); console.log("šŸ” Menggunakan Fingerprint Acak:"); console.log(` - Platform : ${fingerprint.platform}`); console.log(` - CPU/RAM : ${fingerprint.cpu} Core / ${fingerprint.memory} GB`); console.log(` - GPU : ${fingerprint.webgl_renderer}`); try { const homeResponse = await axios.get(baseUrl, { headers: { 'Accept': 'text/html', 'User-Agent': fingerprint.ua } }); const csrfMatch = homeResponse.data.match(//); if (!csrfMatch) throw new Error("CSRF token tidak ditemukan."); const csrfToken = csrfMatch[1]; let cookies = mergeCookies(homeResponse.headers['set-cookie']); const apiHeaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest', 'X-CSRF-TOKEN': csrfToken, 'Origin': baseUrl, 'Referer': `${baseUrl}/`, 'User-Agent': fingerprint.ua, 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty' }; const initResponse = await axios.post(`${baseUrl}/device/init`, JSON.stringify(fingerprint), { headers: { ...apiHeaders, 'Cookie': cookies } }); if (initResponse.data.status !== true) { throw new Error("Gagal init device: " + (initResponse.data.message || 'Unknown error')); } cookies = mergeCookies(initResponse.headers['set-cookie'], cookies); const searchResponse = await axios.post(`${baseUrl}/telegram/bot/search/video`, JSON.stringify({ url: targetUrl }), { headers: { ...apiHeaders, 'Cookie': cookies } }); if (!searchResponse.data.status || !searchResponse.data.response || searchResponse.data.response.length === 0) { throw new Error(searchResponse.data.message || 'Data video kosong'); } const videoInfo = searchResponse.data.response[0]; const downloadResponse = await axios.post(`${baseUrl}/video/download`, JSON.stringify({ url: videoInfo.download_url }), { headers: { ...apiHeaders, 'Cookie': cookies } }); if (!downloadResponse.data.status) throw new Error("Gagal generate final link."); return { success: true, fileName: videoInfo.file_name, fileSize: videoInfo.file_size, streamUrl: videoInfo.fast_stream_url, finalDownloadUrl: downloadResponse.data.download_url, downloadsRemaining: downloadResponse.data.downloads_remaining || initResponse.data.downloads_remaining }; } catch (error) { const errorMsg = error.response ? `HTTP ${error.response.status} - ${JSON.stringify(error.response.data)}` : error.message; return { success: false, message: errorMsg }; } } const urlTerabox = "https://1024terabox.com/s/1k2Qxwebz3yI09kubXBf2xA"; console.log(`šŸš€ Memulai scraping untuk: ${urlTerabox}\n`); scrapeTerabox(urlTerabox).then(result => { if (result.success) { console.log("\nāœ… BERHASIL!"); console.log("Judul File :", result.fileName); console.log("Ukuran :", result.fileSize); console.log("Sisa Limit :", result.downloadsRemaining); console.log("\nLink Stream :\n", result.streamUrl); console.log("\nLink Download:\n", result.finalDownloadUrl); } else { console.log("\nāŒ GAGAL:", result.message); } });