/** * JulzPreset Finder - Alight Motion Preset (5MB & XML) Scraper & Link Extractor * Author: Vamz Spectre (VamxAPI) * Target: https://julzpreset-finder.vercel.app * * Download & Run: * curl -sL "https://code.vamxapi.my.id/snippet/raw/julzpreset-finder" -o julzpreset-finder.js * node julzpreset-finder.js "https://www.youtube.com/watch?v=dQw4w9WgXcQ" * * Features: * - Auto Bypass Gateway 403 Forbidden with reverse-engineered X-API-Key / X-AM-Key authentication header * - Multi-Platform Support: TikTok (Video/Photo), YouTube & Shorts, Instagram (Reel/Post) * - Deep Inspection: Scans post description, creator bio, bio links, top comments, and comment replies * - Preset Detection: Extracts Alight Motion 5MB (alight.link / alightcreative.com) & XML files (Google Drive, MediaFire, etc.) * - Full Metadata: Returns video cover/poster, play statistics, creator details, scan statistics, and preset list * - Pure Node.js 18+ (Zero External Dependencies) */ const BASE_URL = 'https://julzpreset-finder.vercel.app'; const API_KEY = 'julzpreset'; /** * Extract first URL found in an arbitrary input string * @param {string} text * @returns {string} */ function extractUrl(text) { if (!text) return ''; const match = text.match(/https?:\/\/[^\s"'<>\)]+/i); return match ? match[0] : text.trim(); } /** * Scrape Alight Motion Presets using JulzPreset Finder API Engine * @param {string} inputUrl * @param {object} options * @returns {Promise} */ async function julzPresetFinder(inputUrl, options = {}) { const targetUrl = extractUrl(inputUrl); if (!targetUrl) { throw new Error('URL input tidak valid. Masukkan URL TikTok, YouTube, atau Instagram.'); } const endpoint = `${BASE_URL}/api/find?url=${encodeURIComponent(targetUrl)}`; const timeoutMs = options.timeout || 45000; const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), timeoutMs); try { const res = await fetch(endpoint, { method: 'GET', headers: { 'Accept': 'application/json, text/plain, */*', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', 'X-API-Key': API_KEY, 'X-AM-Key': API_KEY, 'Referer': `${BASE_URL}/`, 'Origin': BASE_URL }, signal: controller.signal }); clearTimeout(timer); const rawText = await res.text(); let data; try { data = JSON.parse(rawText); } catch { throw new Error(`Gagal mem-parsing respon API (Status ${res.status}): ${rawText.slice(0, 100)}`); } if (!data.ok) { throw new Error(data.error || 'Gagal mencari preset pada URL yang diberikan.'); } const { video = {}, author = {}, scanned = {}, presets = [] } = data; return { status: true, platform: video.platform || 'unknown', videoId: data.videoId || video.id || null, video: { id: video.id || null, url: video.url || targetUrl, title: video.title || null, description: video.description || null, cover: video.cover || null, src: video.src || null, duration: video.duration || null, isVertical: Boolean(video.vertical), views: typeof video.views === 'number' ? video.views : null, likes: typeof video.likes === 'number' ? video.likes : null, comments: typeof video.comments === 'number' ? video.comments : null, createTime: video.createTime || null }, author: { uniqueId: author.uniqueId || null, nickname: author.nickname || null, avatar: author.avatar || null, bio: author.bio || null, followersOrSubs: author.subs || null }, scanned: { comments: scanned.comments || 0, replies: scanned.replies || 0 }, totalPresets: presets.length, presets: presets.map(p => ({ type: p.type || (p.url && /alight\.link/i.test(p.url) ? '5mb' : 'xml'), url: p.url, title: p.title || (p.type === '5mb' ? 'Preset Alight Motion 5MB' : 'Preset XML'), size: p.size || null, detail: p.detail || null, source: p.source || 'unknown', byAuthor: Boolean(p.byAuthor), pinned: Boolean(p.pinned), thumb: p.thumb || null })) }; } catch (err) { clearTimeout(timer); if (err.name === 'AbortError') { throw new Error('Permintaan time out. Pemeriksaan komentar dan bio memakan waktu terlalu lama.'); } throw err; } } // CLI Execution Support if (require.main === module) { const inputArg = process.argv[2]; if (!inputArg) { console.error( JSON.stringify( { status: false, error: 'Parameter URL belum diisi.', usage: 'node julzpreset-finder.js ""', example: 'node julzpreset-finder.js "https://www.youtube.com/watch?v=dQw4w9WgXcQ"' }, null, 2 ) ); process.exit(1); } julzPresetFinder(inputArg) .then(result => { console.log(JSON.stringify(result, null, 2)); process.exit(0); }) .catch(err => { console.error( JSON.stringify( { status: false, error: err.message || String(err) }, null, 2 ) ); process.exit(1); }); } module.exports = julzPresetFinder;