Top4Top File Upload

JavaScriptPublic
by zx-apiJul 31, 2026, 05:43 AMExpires: Never41 views
Top4Top File Upload
Raw
1/**
2 *
3 * Scrape Name: Uploader Top4Top
4 * Credit By Zix
5 * Link Saluran other: https://whatsapp.com/channel/0029Vb6P2e1E50UZYaX4wI0W
6 *
7**/
8
9const axios = require('axios');
10const FormData = require('form-data');
11const fs = require('fs');
12const cheerio = require('cheerio');
13
14async function uploadFileToTop4Top(filePath) {
15    const targetUrl = 'https://top4top.io/index.php';
16
17    if (!fs.existsSync(filePath)) {
18        console.error(`❌ File tidak ditemukan: ${filePath}`);
19        return;
20    }
21
22    try {
23        console.log(`Memulai proses upload untuk file: ${filePath}...`);
24
25        const form = new FormData();
26        
27        form.append('file_0_', fs.createReadStream(filePath)); 
28        
29        form.append('submitr', '[ رفع الملفات ]');
30
31        const response = await axios.post(targetUrl, form, {
32            headers: {
33                ...form.getHeaders(),
34                // Menambahkan User-Agent dan Referer agar request terlihat natural dan tidak diblokir
35                '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',
36                'Referer': 'https://top4top.io/',
37                'Origin': 'https://top4top.io'
38            },
39            maxBodyLength: Infinity,
40            maxContentLength: Infinity
41        });
42
43        const $ = cheerio.load(response.data);
44        const uploadedLinks = [];
45
46        $('input[type="text"]').each((i, el) => {
47            const val = $(el).val();
48            // Validasi sederhana: Jika value berisi URL situs target, simpan sebagai hasil
49            if (val && (val.includes('top4top.io') || val.includes('http'))) {
50                uploadedLinks.push(val);
51            }
52        });
53
54        if (uploadedLinks.length > 0) {
55            const uniqueLinks = [...new Set(uploadedLinks)];
56            uniqueLinks.forEach((link, idx) => {
57                console.log(`${idx + 1}. ${link}`);
58            });
59        } else {
60            console.log('\n⚠️ Proses HTTP sukses, tetapi script tidak dapat menemukan link di halaman.');
61            console.log('Hal ini mungkin terjadi jika format file tidak didukung atau batas upload terlampaui.');
62        }
63
64    } catch (error) {
65        console.error('\n❌ Terjadi kesalahan saat upload:', error.message);
66        if (error.response) {
67            console.error('Status Code:', error.response.status);
68        }
69    }
70}
71
72const fileYangInginDiUpload = './gambar.jpg'; 
73uploadFileToTop4Top(fileYangInginDiUpload);
74
74 lines·2,576 chars·2.5 KB