/** * ======================================================== * Name: UsersDrive File Data & Download Extractor * * Cara Download: * curl -sL "https://code.vamxapi.my.id/snippet/raw/usersdrive-downloader" -o usersdrive-downloader.js * * Cara Eksekusi: * node usersdrive-downloader.js "https://usersdrive.com/api/download-data/ce5wq9m88s4v.html" * node usersdrive-downloader.js "https://usersdrive.com/ce5wq9m88s4v.html" * * Author: Vamz Spectre * Source: https://vamxapi.my.id * ======================================================== */ const DEFAULT_HEADERS = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.9", }; /** * Extractor Utama UsersDrive * Mengurai ID file, nama file, kapasitas, tanggal upload, uploader, dan link download/tracker. */ async function extractUsersDrive(targetUrl) { const cleanUrl = (targetUrl || "").trim(); if (!cleanUrl) { throw new Error("URL UsersDrive wajib disertakan!"); } const fileIdMatch = cleanUrl.match(/\/([a-zA-Z0-9]+)(?:\.html)?(?:$|[?#])/); if (!fileIdMatch || !fileIdMatch[1]) { throw new Error("Gagal membaca File ID dari link UsersDrive."); } const fileId = fileIdMatch[1]; const standardPageUrl = `https://usersdrive.com/${fileId}.html`; const res = await fetch(standardPageUrl, { headers: DEFAULT_HEADERS, }); if (!res.ok) { throw new Error(`Gagal membuka link UsersDrive: HTTP ${res.status}`); } const html = await res.text(); if (html.includes("File Not Found") || html.includes("deleted by the owner")) { throw new Error("File di UsersDrive tidak ditemukan atau sudah dihapus oleh uploader."); } const nameMatch = html.match(/