/** * RapipMovies Anime Scraper & Detail API Client * Author: Vamz Spectre (VamxAPI) * Target: https://rapip-movies.up.railway.app/#/anime * Description: * Reverse-engineered client for RapipMovies anime catalog. * Fetches complete anime lists, pagination, details, seasons, episodes, * and direct streaming player embed URLs. * * Usage CLI: * curl -sL "https://code.vamxapi.my.id/snippet/raw/rapip-anime" -o rapip-anime.js * node rapip-anime.js list 1 * node rapip-anime.js detail tv-67075 */ const BASE_URL = 'https://api-lk21-kappa.vercel.app'; async function getAnimeList(page = 1) { const url = `${BASE_URL}/anime/list?page=${page}`; const res = await fetch(url, { 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', 'Referer': 'https://rapip-movies.up.railway.app/' } }); if (!res.ok) { throw new Error(`Failed to fetch anime list: ${res.status} ${res.statusText}`); } const data = await res.json(); return { status: true, author: 'Vamz Spectre', page: data.page || page, total: data.total || 0, results: (data.results || []).map(item => ({ id: item.id, tmdbId: item.tmdbId, title: item.title, year: item.year, rating: item.rating, genres: item.genres || [], overview: item.overview || null, poster: item.poster, backdrop: item.backdrop, runtime: item.runtime || 0, playerUrl: item.src })) }; } async function getAnimeDetail(id) { const url = `${BASE_URL}/anime/detail/${encodeURIComponent(id)}`; const res = await fetch(url, { 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', 'Referer': 'https://rapip-movies.up.railway.app/' } }); if (!res.ok) { throw new Error(`Failed to fetch anime detail: ${res.status} ${res.statusText}`); } const data = await res.json(); return { status: true, author: 'Vamz Spectre', result: { id: data.id, tmdbId: data.tmdbId, title: data.title, year: data.year, rating: data.rating, overview: data.overview || null, genres: data.genres || [], poster: data.poster, backdrop: data.backdrop, runtime: data.runtime, seasons: (data.seasons || []).map(s => ({ seasonNumber: s.number, seasonName: s.name, episodeCount: s.episodeCount, poster: s.poster })), playerUrl: data.src } }; } // CLI Runner if (require.main === module) { const action = process.argv[2] || 'list'; const param = process.argv[3] || '1'; (async () => { try { let result; if (action === 'detail') { result = await getAnimeDetail(param); } else { result = await getAnimeList(Number(param) || 1); } console.log(JSON.stringify(result, null, 2)); } catch (err) { console.error(JSON.stringify({ status: false, error: err.message }, null, 2)); process.exit(1); } })(); } module.exports = { getAnimeList, getAnimeDetail };