/** * Dubbindo Scraper (dubbindo.site) * Nonton Film, Anime, & Drama Dubbing Indonesia * * Features: * - Search Videos * - Latest Videos * - Trending & Top Videos * - Category Videos * - Video Detail & Direct MP4 Streaming / Download Links (Multi Quality: 720p, 480p, 360p, 240p) * * Author: Vamz Spectre / VamxAPI * CLI Usage: * node dubbindo.js "naruto" * node dubbindo.js "https://www.dubbindo.site/watch/pokemon-detective-pikachu-live-action-2019_rtiCLlND4e8ZyWh.html" * node dubbindo.js --latest */ const axios = require('axios'); const cheerio = require('cheerio'); const BASE_URL = 'https://www.dubbindo.site'; const http = axios.create({ baseURL: BASE_URL, timeout: 15000, headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', 'Accept-Language': 'id,en-US;q=0.9,en;q=0.8' } }); function parseVideoCard($, el) { const card = $(el); const anchor = card.find('.video-thumb a').first(); const titleAnchor = card.find('.video-title a').first(); const url = anchor.attr('href') || titleAnchor.attr('href') || ''; const title = (card.find('.video-title h4').attr('title') || card.find('.video-title h4').text() || '').trim(); const thumbnail = card.find('.video-thumb img').attr('src') || ''; const previewGif = (card.find('.play_hover_btn').attr('onmouseenter') || '').match(/'([^']+)'/)?.[1] || null; const duration = card.find('.video-duration').text().trim() || null; const infoText = card.find('.video-info').text().replace(/\s+/g, ' ').trim(); const viewsMatch = infoText.match(/([\d,]+)\s*Views/i); const views = viewsMatch ? viewsMatch[1].replace(/,/g, '') : null; const timeMatch = infoText.match(/ยท\s*([0-9]+\s+[a-zA-Z\s]+ago)/i); const uploaded = timeMatch ? timeMatch[1].trim() : null; const uploaderEl = card.find('.video-info a').first(); const uploader = uploaderEl.length ? { name: uploaderEl.text().trim(), url: uploaderEl.attr('href') || '' } : null; const desc = card.find('.descc').text().replace(/\s+/g, ' ').trim() || null; const id = card.attr('data-id') || (url.match(/_([a-zA-Z0-9]+)\.html/)?.[1] || null); return { id, title, url, thumbnail, previewGif, duration, views: views ? parseInt(views, 10) : null, uploaded, uploader, description: desc }; } async function search(query, page = 1) { const res = await http.get('/search', { params: { keyword: query, page_id: page } }); const $ = cheerio.load(res.data); const results = []; $('.video-latest-list, .video-wrapper').each((_, el) => { const item = parseVideoCard($, el); if (item.title && item.url) { results.push(item); } }); return { status: true, query, page: Number(page), total: results.length, results }; } async function latest(page = 1) { const res = await http.get('/videos/latest', { params: { page_id: page } }); const $ = cheerio.load(res.data); const results = []; $('.video-latest-list, .video-wrapper').each((_, el) => { const item = parseVideoCard($, el); if (item.title && item.url) { results.push(item); } }); return { status: true, page: Number(page), total: results.length, results }; } async function trending(page = 1) { const res = await http.get('/videos/trending', { params: { page_id: page } }); const $ = cheerio.load(res.data); const results = []; $('.video-latest-list, .video-wrapper').each((_, el) => { const item = parseVideoCard($, el); if (item.title && item.url) { results.push(item); } }); return { status: true, page: Number(page), total: results.length, results }; } async function top(page = 1) { const res = await http.get('/videos/top', { params: { page_id: page } }); const $ = cheerio.load(res.data); const results = []; $('.video-latest-list, .video-wrapper').each((_, el) => { const item = parseVideoCard($, el); if (item.title && item.url) { results.push(item); } }); return { status: true, page: Number(page), total: results.length, results }; } async function category(catId, page = 1) { const res = await http.get(`/videos/category/${catId}`, { params: { page_id: page } }); const $ = cheerio.load(res.data); const results = []; $('.video-latest-list, .video-wrapper').each((_, el) => { const item = parseVideoCard($, el); if (item.title && item.url) { results.push(item); } }); return { status: true, category: catId, page: Number(page), total: results.length, results }; } async function detail(urlOrSlugOrId) { let targetUrl = urlOrSlugOrId; if (!targetUrl.startsWith('http')) { if (targetUrl.includes('.html')) { targetUrl = `${BASE_URL}/watch/${targetUrl}`; } else { targetUrl = `${BASE_URL}/watch/${targetUrl}.html`; } } const res = await http.get(targetUrl); const html = res.data; const $ = cheerio.load(html); const title = ($('h1[itemprop="title"]').text() || $('title').text().replace(/ - UVideo.*$/, '') || '').trim(); const shortId = targetUrl.match(/_([a-zA-Z0-9]+)\.html/)?.[1] || null; const embedUrl = shortId ? `${BASE_URL}/embed/${shortId}` : null; // Views & Likes const viewsText = $('.views-counter').text().replace(/\s+/g, ' ').trim() || (html.match(/([\d,]+)\s+Views/i)?.[1] || ''); const views = viewsText ? parseInt(viewsText.replace(/[^\d]/g, ''), 10) : null; const likes = parseInt($('#likes').text().trim() || '0', 10); const dislikes = parseInt($('#dislikes').text().trim() || '0', 10); // Description const description = $('.video-description').text().trim() || $('.descc').first().text().trim() || null; // Category const catEl = $('a[href*="/videos/category/"]').first(); const category = catEl.length ? { id: (catEl.attr('href').match(/\/videos\/category\/([^"'/]+)/)?.[1] || ''), name: catEl.text().trim() } : null; // Uploader const uploaderEl = $('.publisher-name a').first(); const avatarEl = $('.publisher-avatar img').first(); const uploader = uploaderEl.length ? { name: uploaderEl.text().trim(), url: uploaderEl.attr('href') || '', avatar: avatarEl.attr('src') || null } : null; // Stream Sources const streams = []; $('source').each((_, el) => { const src = $(el).attr('src'); const type = $(el).attr('type') || 'video/mp4'; const quality = $(el).attr('data-quality') || $(el).attr('label') || $(el).attr('title') || 'default'; if (src && !streams.some(s => s.url === src)) { streams.push({ quality, type, url: src }); } }); // Downloads (match both modal download buttons and link_download) const downloads = []; const downloadMatches = [...html.matchAll(/]+href="([^"]+)"[^>]*class="[^"]*(?:clickdownload|click download|btn-share)[^"]*"[^>]*>([\s\S]*?)<\/a>/gi)]; for (const match of downloadMatches) { const url = match[1]; const label = match[2].replace(/<[^>]+>/g, '').replace(/\s+/g, ' ').trim() || 'Download'; if (url && url !== '#' && !downloads.some(d => d.url === url)) { downloads.push({ label, url }); } } // Also check direct link_download if present const singleDl = $('#link_download').attr('href'); if (singleDl && singleDl !== '#' && !downloads.some(d => d.url === singleDl)) { downloads.unshift({ label: 'Download', url: singleDl }); } // Related videos const related = []; $('.ra-thumb').each((_, el) => { const thumb = $(el); const card = thumb.parent(); const link = thumb.find('a').first(); const url = link.attr('href') || ''; const title = card.find('.video-title').text().trim(); const thumbnail = thumb.find('img').attr('src') || ''; const duration = thumb.find('.video-duration').text().trim() || null; const views = card.find('.video-views').text().replace(/[^\d]/g, '') || null; const uploader = card.find('.user-name a').text().trim() || null; const shortId = url.match(/_([a-zA-Z0-9]+)\.html/)?.[1] || null; if (title && url && !related.some(r => r.url === url)) { related.push({ id: shortId, title, url, thumbnail, duration, views: views ? parseInt(views, 10) : null, uploader }); } }); return { status: true, title, id: shortId, url: targetUrl, embedUrl, views, likes, dislikes, category, uploader, description, streams, downloads, related: related.slice(0, 10) }; } module.exports = { search, latest, trending, top, category, detail }; // CLI Runner if (require.main === module) { const arg1 = process.argv[2]; const arg2 = process.argv[3]; (async () => { try { if (!arg1) { // Default: get latest videos const res = await latest(1); console.log(JSON.stringify(res, null, 2)); } else if (arg1 === '--latest') { const res = await latest(arg2 || 1); console.log(JSON.stringify(res, null, 2)); } else if (arg1 === '--trending') { const res = await trending(arg2 || 1); console.log(JSON.stringify(res, null, 2)); } else if (arg1 === '--top') { const res = await top(arg2 || 1); console.log(JSON.stringify(res, null, 2)); } else if (arg1 === '--category') { const res = await category(arg2 || '1', 1); console.log(JSON.stringify(res, null, 2)); } else if (arg1.startsWith('http://') || arg1.startsWith('https://') || arg1.includes('.html')) { const res = await detail(arg1); console.log(JSON.stringify(res, null, 2)); } else { // Search query const res = await search(arg1, arg2 || 1); console.log(JSON.stringify(res, null, 2)); } } catch (err) { console.error(JSON.stringify({ status: false, error: err.message }, null, 2)); process.exit(1); } })(); }