/** * OppaDrama K-Drama Scraper & Video Stream Extractor (Dual CJS/ESM Support) * Author: Vamz Spectre / VamxAPI * Website: https://vamxapi.my.id * Channel: https://whatsapp.com/channel/0029Vb8n36OGE56uvRAq4y3y */ const BASE_URL = "https://oppadrama.io"; const HEADERS = { "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", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7", }; /** * 1. Get Latest Episode Releases (Update Terbaru di Homepage) * @param {number} page */ async function getLatestUpdates(page = 1) { const url = page > 1 ? `${BASE_URL}/page/${page}/` : `${BASE_URL}/`; const res = await fetch(url, { headers: HEADERS, signal: AbortSignal.timeout(15000) }); if (!res.ok) throw new Error(`HTTP Error ${res.status}`); const html = await res.text(); const results = []; const cards = html.match(/