/** * * Scrape Name: Uploader Top4Top * Credit By Zix * Link Saluran other: https://whatsapp.com/channel/0029Vb6P2e1E50UZYaX4wI0W * **/ const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); const cheerio = require('cheerio'); async function uploadFileToTop4Top(filePath) { const targetUrl = 'https://top4top.io/index.php'; if (!fs.existsSync(filePath)) { console.error(`❌ File tidak ditemukan: ${filePath}`); return; } try { console.log(`Memulai proses upload untuk file: ${filePath}...`); const form = new FormData(); form.append('file_0_', fs.createReadStream(filePath)); form.append('submitr', '[ رفع الملفات ]'); const response = await axios.post(targetUrl, form, { headers: { ...form.getHeaders(), // Menambahkan User-Agent dan Referer agar request terlihat natural dan tidak diblokir 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', 'Referer': 'https://top4top.io/', 'Origin': 'https://top4top.io' }, maxBodyLength: Infinity, maxContentLength: Infinity }); const $ = cheerio.load(response.data); const uploadedLinks = []; $('input[type="text"]').each((i, el) => { const val = $(el).val(); // Validasi sederhana: Jika value berisi URL situs target, simpan sebagai hasil if (val && (val.includes('top4top.io') || val.includes('http'))) { uploadedLinks.push(val); } }); if (uploadedLinks.length > 0) { const uniqueLinks = [...new Set(uploadedLinks)]; uniqueLinks.forEach((link, idx) => { console.log(`${idx + 1}. ${link}`); }); } else { console.log('\n⚠️ Proses HTTP sukses, tetapi script tidak dapat menemukan link di halaman.'); console.log('Hal ini mungkin terjadi jika format file tidak didukung atau batas upload terlampaui.'); } } catch (error) { console.error('\n❌ Terjadi kesalahan saat upload:', error.message); if (error.response) { console.error('Status Code:', error.response.status); } } } const fileYangInginDiUpload = './gambar.jpg'; uploadFileToTop4Top(fileYangInginDiUpload);