diff --git a/src/config.js b/src/config.js index b6e7c45..2a911c5 100644 --- a/src/config.js +++ b/src/config.js @@ -577,6 +577,18 @@ export const SOURCES = [ }], }, + { + key: 'mynimeku', + label: 'Mynimeku', + sourceFile: 'mynimeku', + proxyParam: 'mnk', + timeout: 25000, + jitter: 500, + retries: 2, + multiUrl: true, + dedicated: true, + }, + { key: 'net79', label: 'Net79', @@ -659,6 +671,18 @@ export const SOURCES = [ }], }, + { + key: 'subsl', + label: 'SubSL', + sourceFile: 'subsl', + proxyParam: 'sbl', + timeout: 25000, + jitter: 500, + retries: 2, + multiUrl: true, + }, + + { key: 'taroflix', label: 'TaroFlix', @@ -677,6 +701,18 @@ export const SOURCES = [ }], }, + { + key: 'tattooin', + label: 'Tattooin', + sourceFile: 'tattooin', + proxyParam: 'tt', + timeout: 25000, + jitter: 500, + retries: 2, + multiUrl: true, + dedicated: true, + }, + { key: 'streamaggregator', label: 'StreamAggregator', @@ -713,6 +749,17 @@ export const SOURCES = [ }], }, + { + key: 'todaytvseries', + label: 'TodayTVSeries', + sourceFile: 'todaytvseries', + proxyParam: 'tts', + timeout: 25000, + jitter: 500, + retries: 2, + multiUrl: true, + }, + { key: 'torrentio', label: 'Torrentio', diff --git a/src/sources/mynimeku.js b/src/sources/mynimeku.js new file mode 100644 index 0000000..d5c7386 --- /dev/null +++ b/src/sources/mynimeku.js @@ -0,0 +1,107 @@ +import { + extractAnchors, + extractTags, + fetchPage, + normText, + resolveContentMeta, + stripTags, + toStreamResult, +} from '../utils/helpers.js'; + +const BASE = 'https://www.mynimeku.com'; +const FILE_RE = /file\.mydriveku\.my\.id\/api\/v1\/(public|private)\/([^/?&]+)/i; +const INDO_RE = /\bsubtitle\s+indonesia\b|\bsub(?:title)?\s*indo(?:nesia)?\b/i; + +const headTitle = title => (title || '').trim().split(/\s+-/)[0].replace(/^[\s-:]+|[\s-:]+$/g, '') || (title || '').trim(); + +function titleOk(post, title, year) { + const nt = normText(post); + const short = normText(headTitle(title)); + const words = short.split(/\s+/).filter(w => w.length >= 2); + if (!words.length) return false; + let hit = words.every(w => new RegExp(`\\b${w}\\b`).test(nt)); + if (!hit) { + const compact = short.replace(/[^a-z0-9]+/g, ''); + hit = compact.length >= 8 && nt.replace(/[^a-z0-9]+/g, '').includes(compact); + } + if (!hit) return false; + return words.length === 1 ? (year != null && new RegExp(`\\b${year}\\b`).test(nt)) : true; +} + +function seasonOk(post, season) { + const nth = post.match(/(\d+)(?:st|nd|rd|th)\s+season/i); + const m = post.match(/season\s*(\d+)/i); + const n = nth ? Number(nth[1]) : (m ? Number(m[1]) : null); + return n == null ? season === 1 : n === season; +} + +async function searchSeries(title, season, year) { + const q = headTitle(title); + const run = async query => { + const r = await fetchPage(`${BASE}/?s=${encodeURIComponent(query)}`); + if (!r || !r.ok) return []; + const seen = new Set(); + const out = []; + for (const a of extractAnchors(r.text, BASE)) { + const href = a.href.split('?')[0]; + if (!href.includes('/series/') || seen.has(href) || !a.text) continue; + seen.add(href); + if (titleOk(a.text, title, year) && seasonOk(a.text, season)) out.push(href); + } + return out; + }; + const res = await run(q); + return res.length || q === title ? res : run(title); +} + +function extractFiles(html) { + const h1 = html.match(/