S
@saurus2 files
Published 31 minutes ago
javascript
yorunime scrape
yorunime sbs anime scraper
README.md : Dokumentasi & Panduan
Lompat ke Kode ↓Markdown
Yorunime Scraper (Home, Ongoing, Completed, Schedule, Genre, Search, Detail, Episode & Bulk Download)
Scraper Node.js untuk https://www.yorunime.sbs menggunakan endpoint API resmi /api/anime tanpa dependensi eksternal.
Key Features
- Home, Ongoing & Completed: Mengambil daftar anime terbaru, ongoing, dan tamat.
- Schedule, Genre & A-Z List: Jadwal rilis mingguan, daftar genre, anime per genre, dan indeks A-Z.
- Search: Pencarian anime berdasarkan kata kunci.
- Detail, Episode & Server: Mengambil detail anime, daftar episode, dan resolve
serverIdstream. - Bulk Download (
dl): Mendukung slug/URL episode maupun anime untuk mengekstrak semua episode sekaligus.
Installation & Requirements
- Node.js v18+ (membutuhkan
fetch,fs, dancryptobawaan). - Tidak memerlukan dependensi npm eksternal.
Usage
node yorunime.js home
node yorunime.js ongoing 1
node yorunime.js completed 1
node yorunime.js schedule
node yorunime.js genres
node yorunime.js genre action 1
node yorunime.js search "naruto" 1
node yorunime.js detail 2335
node yorunime.js episode <slug>
node yorunime.js server <serverId>
node yorunime.js dl 2335
License & Attribution
Creator: Saurus
Saluran: https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C
yorunime.jsjavascript271 baris (12.5 KB)
/** * Yorunime Scraper * Creator: Saurus * Base Web/Apk: https://www.yorunime.sbs * Saluran: https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C * Note: error fix sndiri yk, ohya tolong jangan hps credit atau claim ini buatan lu hargain dikit jier */ const fs = require('fs');const crypto = require('crypto'); const a0X=a0h;function a0l(){const W=['a8oigSkKWR7dNY4','W7qNgConh2DgW6JcM0S','gSo6k8kVWO8','CZ4kxqy','vKfdcCoKn1ZdJsyfzSolFG','uWZcImkcWRe','fSoOW5ddJw8L','wmkCW7KQ','bSoSySkJW6ddJCkl','krtdQ8krDmkgqMRdS8kM','EqBcOmk2W5S','WROGW6jKWRj5aG4','WOxdSsKKWOWjWRhdMf3cUSk4qCox','mmkxW4mA','rCkNW65ufW','eHSsCCkDoZ9a','Ar1zua','v0yny8k2bZbq','sdhcOSkoW6W5d8oVWQBcKqRdUwpdVYLbD8onjmopWPjTlvdcSCkwWOzYdW/cImoTxcazaxRcHSoqp8kAWR/dVt8','WOpcRGRdV8oUWQJdJSoBWO1LW7flBq','sCkRybhcHxlcQSoZW5WjWONcQSkg','CJldNX1gkmkKcLhcM8owua','rvuHWQy','vKy+wmkluG3dQG','uYZcSmkjWRC','fW90W7qZid7cTSo1W7TjWRDT','uZBdIWT1mSoOdNBcLSokwHddH8ozW6pcOMBcGmoOWQXwASktW43cIv7dNLPOrSkSe8kvCJXDW4TQkmkMW6uzi8oMCfHdW6dcRmk9E2JcL3nalmodW4FcTCo8WRqTjmorWRpcOW','vSoOW6hcGH9XW5v8W7JcP3Soua','tCk2W7BcVeyt','dCo0lCkzWOBdOCkSmq','qGVcKG','g8o6WQ5LWPBdM8knjevjWOpcMSkH','cXeCwCkMBW','W5pdUZJdUdlcL1NcLSkbmCoaW7Ki','W48JW7JcLmo/W7S','W5JcGSkEW4aCWQ5ZWPT7W6C','W7GRk8oJW5TuW6q3WRzQW5/cQCoa','W7fcW5z4WPe','W5aeW5tcHCoA','tKGQDmkS','W5VcJNhdT2BdGItcOCkefmk7W5i0W5NcJtCZW407WPrmW47dHSkNr8kWm1iLWQNdTGKncmoSe8kXWQhcKNNdOSoyWQ8s','WRDRWOJcJq','iCkfW7NcSa','W5pcO2dcSwBdGce','nmkCW7VcVCk/','DcFcJCkvWP8','W4JcRK9ZWP0','kSodnSk6e8o2W63dO8kWW5tcTvm/','WR/dV8kypSo3gdS','ftv+W7q','rGnhc0aF','fKe4wmkCiq8','yHlcO07dSNq','qCkKFW','mW1yW6JdKG','WQhcTchdMatdM8o1nbxdVCoFjge','muNdSHNcSdiEdmkSBqDitW','tJj/W6RdVx0I','FCo1F8kgW77dKCkxWQq','FCovx8kJW4pdQSk6W4ZcI0j+ESolxa','W7tdVmkbsmkOxq','bSkWWPakamogWRhdHIZcI1dcMCk7','uuWUE8kLdtS','lsVdTmkDza','zSoLW41mr8kFW6ZcRG','WRi7hSoWm1Ta','lSk6W6ddTCkhW6LuWO/cHmkTWPe4W4O','tSoCjbe','WO7dKN13','W5y2W7lcKSo/W7y','qsFcI8kzW7W'];a0l=function(){return W;};return a0l();}(function(l,h){const w=a0h,V=l();while(!![]){try{const K=parseInt(w(0x1ee,'EKur'))/0x1*(-parseInt(w(0x1f7,'[JT3'))/0x2)+parseInt(w(0x1d9,'5(GR'))/0x3*(-parseInt(w(0x1e5,'0BLS'))/0x4)+-parseInt(w(0x1f6,'&a0$'))/0x5*(-parseInt(w(0x1d4,'hgpj'))/0x6)+parseInt(w(0x208,'Gg^z'))/0x7+-parseInt(w(0x219,'3h5h'))/0x8*(-parseInt(w(0x20f,'6)[J'))/0x9)+parseInt(w(0x200,'Gyoo'))/0xa+parseInt(w(0x1ed,'IQNY'))/0xb*(-parseInt(w(0x20b,'lq]E'))/0xc);if(K===h)break;else V['push'](V['shift']());}catch(F){V['push'](V['shift']());}}}(a0l,0xa7142));const _m=[a0X(0x20e,'BS%p'),a0X(0x1dd,'XNj4')],_x=[0x5a,0xc3,0x29,0x8f,0x14,0xe7,0x3b,0x92];let _ok=![];function unmask(l,h){const i=a0X,V={'jWHpQ':i(0x202,'3%Ga'),'TYsOj':function(J,k){return J^k;},'YgJvf':function(J,k){return J%k;}},K=Buffer[i(0x1f9,'vbdg')](l[i(0x1e6,'EKur')](''),V[i(0x1db,'fDh%')]),F=Buffer[i(0x1e3,')Pwg')](K[i(0x1d5,'Gyoo')]);for(let J=0x0;J<K[i(0x218,'*bET')];J++){F[J]=V[i(0x214,'qxPi')](K[J],h[V[i(0x1fb,'BS%p')](J,h[i(0x1fa,'fDh%')])]);}return F[i(0x20d,'lq]E')](i(0x203,'urET'));}function extractAttr(l){const G=a0X,h={'sRNSB':G(0x20c,'78Wn')};try{const V=fs[G(0x211,'%ne&')](l,h[G(0x1e2,'qxPi')]),K=V[G(0x1dc,'lq]E')](/^\s*\/\*\*[\s\S]*?\*\//);if(!K)return null;const F=K[0x0][G(0x1e1,'zydv')](/\r?\n/)[G(0x21a,'ealZ')](Z=>Z[G(0x1fc,'zbm%')](/^\s*\*?\s*/,'')[G(0x1f3,'lq]E')](/\s+/g,'')),J=F[G(0x209,'jKi9')](Z=>Z[G(0x1fd,'&a0$')](G(0x1ef,'o@vn'))),k=F[G(0x1df,'zydv')](Z=>Z[G(0x1d8,'YQai')](G(0x1f5,'81zU')));if(!J||!k)return null;return[J,k];}catch{return null;}}function digestAttr(l){const y=a0X,h={'kWAgP':function(V,K){return V!==K;},'gMzmd':y(0x1f1,'0BLS'),'mKlnb':y(0x1ea,'NzR9')};if(!l||h[y(0x1fe,'zbm%')](l[y(0x1e7,'$w5z')],0x2))return'';return crypto[y(0x205,'NO5E')](h[y(0x1f4,'NO5E')])[y(0x1d7,'fDh%')](l[y(0x1de,'wSO0')](''))[y(0x1e9,'IQNY')](h[y(0x1ff,'5Dwy')]);}function a0h(l,h){l=l-0x1d4;const V=a0l();let K=V[l];if(a0h['aQupHs']===undefined){var F=function(w){const X='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let i='',G='';for(let y=0x0,u,W,H=0x0;W=w['charAt'](H++);~W&&(u=y%0x4?u*0x40+W:W,y++%0x4)?i+=String['fromCharCode'](0xff&u>>(-0x2*y&0x6)):0x0){W=X['indexOf'](W);}for(let E=0x0,x=i['length'];E<x;E++){G+='%'+('00'+i['charCodeAt'](E)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(G);};const Z=function(w,X){let G=[],u=0x0,W,H='';w=F(w);let E;for(E=0x0;E<0x100;E++){G[E]=E;}for(E=0x0;E<0x100;E++){u=(u+G[E]+X['charCodeAt'](E%X['length']))%0x100,W=G[E],G[E]=G[u],G[u]=W;}E=0x0,u=0x0;for(let p=0x0;p<w['length'];p++){E=(E+0x1)%0x100,u=(u+G[E])%0x100,W=G[E],G[E]=G[u],G[u]=W,H+=String['fromCharCode'](w['charCodeAt'](p)^G[(G[E]+G[u])%0x100]);}return H;};a0h['SLlQEI']=Z,a0h['SNGwwT']={},a0h['aQupHs']=!![];}const J=V[0x0];a0h['FIhVdI']!==J&&(a0h['SNGwwT']={},a0h['FIhVdI']=J);const k=a0h['SNGwwT'][l];return k===undefined?(a0h['bZubAr']===undefined&&(a0h['bZubAr']=!![]),K=a0h['SLlQEI'](K,h),a0h['SNGwwT'][l]=K):K=k,K;}function guard(){const u=a0X,l={'zTYUw':function(K,F){return K(F);},'TyKDl':function(K,F){return K!==F;},'hOqFk':function(K,F,J){return K(F,J);},'LWOrL':u(0x216,'%ne&'),'aFaYA':u(0x1f0,'o@vn')};if(_ok)return;const h=extractAttr(__filename),V=l[u(0x1da,'P8o7')](digestAttr,h);if(!V||l[u(0x201,'qxPi')](V,l[u(0x20a,'urET')](unmask,_m,_x))){const K=new Error(l[u(0x1eb,'EKur')]);K[u(0x212,'5HKP')]=0x193,K[u(0x1f8,'dxzT')]=l[u(0x206,'BS%p')];throw K;}_ok=!![];} const API_BASE = 'https://www.yorunime.sbs/api/anime';const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'; async function apiGet(action, params = {}) { const qs = new URLSearchParams({ action, ...params }).toString(); const res = await fetch(`${API_BASE}?${qs}`, { headers: { 'User-Agent': UA, 'Accept': 'application/json', 'Referer': 'https://www.yorunime.sbs/' } }); const json = await res.json().catch(() => ({})); if (!res.ok) { throw new Error(json.message || json.error || `HTTP ${res.status}`); } return json.data !== undefined ? json.data : json;} function extractSlug(input) { if (!input) throw new Error('Slug atau URL wajib diisi'); const clean = String(input).trim(); if (!/^https?:\/\//i.test(clean)) return clean.replace(/^\/+|\/+$/g, ''); const parts = new URL(clean).pathname.split('/').filter(Boolean); return parts[parts.length - 1] || clean;} async function home() { guard(); return apiGet('home');} async function ongoing(page = 1) { guard(); return apiGet('ongoing', { page: Math.max(1, Number(page) || 1) });} async function completed(page = 1) { guard(); return apiGet('completed', { page: Math.max(1, Number(page) || 1) });} async function schedule() { guard(); return apiGet('schedule');} async function genres() { guard(); return apiGet('genres');} async function genre(slug, page = 1) { guard(); if (!slug) throw new Error('Slug genre wajib diisi'); return apiGet('genre', { genre: extractSlug(slug), page: Math.max(1, Number(page) || 1) });} async function search(query, page = 1) { guard(); if (!query || !String(query).trim()) throw new Error('Query pencarian wajib diisi'); return apiGet('search', { q: String(query).trim(), page: Math.max(1, Number(page) || 1) });} async function azList(letter = '', page = 1) { guard(); const params = { page: Math.max(1, Number(page) || 1) }; if (letter) params.letter = String(letter).trim(); return apiGet('az-list', params);} async function detail(slugOrUrl) { guard(); return apiGet('detail', { slug: extractSlug(slugOrUrl) });} async function episode(slugOrUrl) { guard(); return apiGet('episode', { slug: extractSlug(slugOrUrl) });} async function server(serverId) { guard(); if (!serverId) throw new Error('serverId wajib diisi'); return apiGet('server', { serverId: String(serverId).trim() });} async function dl(slugOrUrl, options = {}) { guard(); const slug = extractSlug(slugOrUrl); if (/episode/i.test(slug)) { return episode(slug); } const concurrency = Math.max(1, Math.min(8, Number(options.concurrency) || 4)); const info = await detail(slug); const eps = info.episodeList || info.episodes || []; const results = new Array(eps.length); let idx = 0; async function worker() { while (idx < eps.length) { const current = idx++; const ep = eps[current]; const epSlug = ep.slug || ep.episodeId || extractSlug(ep.url || ep.href || ''); try { const epData = await episode(epSlug); results[current] = { title: ep.title || epData.title || epSlug, slug: epSlug, ...epData }; } catch (err) { results[current] = { title: ep.title || epSlug, slug: epSlug, error: err.message }; } } } const workers = Array.from({ length: Math.min(concurrency, eps.length || 1) }, () => worker()); await Promise.all(workers); return { title: info.title || slug, totalEpisodes: results.length, episodes: results };} function printUsage() { console.log([ 'Usage:', ' node yorunime.js home', ' node yorunime.js ongoing [page]', ' node yorunime.js completed [page]', ' node yorunime.js schedule', ' node yorunime.js genres', ' node yorunime.js genre <slug> [page]', ' node yorunime.js search <query> [page]', ' node yorunime.js az [letter] [page]', ' node yorunime.js detail <slug|url>', ' node yorunime.js episode <slug|url>', ' node yorunime.js server <serverId>', ' node yorunime.js dl <slug|url>' ].join('\n'));} async function main() { const start = Date.now(); const [action, arg1, arg2] = process.argv.slice(2); if (!action) { printUsage(); process.exit(1); } try { let data; if (action === 'home') { data = await home(); } else if (action === 'ongoing') { data = await ongoing(arg1); } else if (action === 'completed') { data = await completed(arg1); } else if (action === 'schedule') { data = await schedule(); } else if (action === 'genres') { data = await genres(); } else if (action === 'genre') { if (!arg1) { printUsage(); process.exit(1); } data = await genre(arg1, arg2); } else if (action === 'search') { if (!arg1) { printUsage(); process.exit(1); } data = await search(arg1, arg2); } else if (action === 'az') { data = await azList(arg1, arg2); } else if (action === 'detail') { if (!arg1) { printUsage(); process.exit(1); } data = await detail(arg1); } else if (action === 'episode') { if (!arg1) { printUsage(); process.exit(1); } data = await episode(arg1); } else if (action === 'server') { if (!arg1) { printUsage(); process.exit(1); } data = await server(arg1); } else if (action === 'dl') { if (!arg1) { printUsage(); process.exit(1); } data = await dl(arg1); } else { printUsage(); process.exit(1); } console.log(JSON.stringify({ Creator: 'Saurus', Saluran: 'https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C', time: `${Date.now() - start}ms`, status: true, data }, null, 2)); } catch (err) { const out = { Creator: 'Saurus', Saluran: 'https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C', time: `${Date.now() - start}ms`, status: false, error: err.message }; if (err.code === 403 || err.name === 'CREDIT_REMOVED') { out.code = 403; out.name = 'CREDIT_REMOVED'; } console.log(JSON.stringify(out, null, 2)); process.exit(1); }} if (require.main === module) { main();} module.exports = { home, ongoing, completed, schedule, genres, genre, search, azList, detail, episode, server, dl, bulkDownload: dl, downloadAll: dl};