diff --git a/dist/models/anime-parser.d.ts b/dist/models/anime-parser.d.ts index bb0c0fa15..a68805d4e 100644 --- a/dist/models/anime-parser.d.ts +++ b/dist/models/anime-parser.d.ts @@ -21,6 +21,6 @@ declare abstract class AnimeParser extends BaseParser { * * returns episode servers (video links) available */ - abstract fetchEpisodeServers(episodeId: string): Promise; + abstract fetchEpisodeServers(episodeId: string, ...args: any): Promise; } export default AnimeParser; diff --git a/dist/models/types.d.ts b/dist/models/types.d.ts index 8603a295d..5c6367ebd 100644 --- a/dist/models/types.d.ts +++ b/dist/models/types.d.ts @@ -62,7 +62,8 @@ export declare enum MediaFormat { MANGA = "MANGA", NOVEL = "NOVEL", ONE_SHOT = "ONE_SHOT", - PV = "PV" + PV = "PV", + COMIC = "COMIC" } export interface IAnimeInfo extends IAnimeResult { malId?: number | string; @@ -165,6 +166,7 @@ export declare enum StreamingServers { MyCloud = "mycloud", Filemoon = "filemoon", VidStreaming = "vidstreaming", + VidStream = "vidstream", SmashyStream = "smashystream", StreamHub = "streamhub", StreamWish = "streamwish", diff --git a/dist/models/types.js b/dist/models/types.js index ab05356a2..3d2281794 100644 --- a/dist/models/types.js +++ b/dist/models/types.js @@ -15,6 +15,7 @@ var MediaFormat; MediaFormat["NOVEL"] = "NOVEL"; MediaFormat["ONE_SHOT"] = "ONE_SHOT"; MediaFormat["PV"] = "PV"; + MediaFormat["COMIC"] = "COMIC"; })(MediaFormat || (exports.MediaFormat = MediaFormat = {})); var StreamingServers; (function (StreamingServers) { @@ -31,6 +32,7 @@ var StreamingServers; StreamingServers["MyCloud"] = "mycloud"; StreamingServers["Filemoon"] = "filemoon"; StreamingServers["VidStreaming"] = "vidstreaming"; + StreamingServers["VidStream"] = "vidstream"; StreamingServers["SmashyStream"] = "smashystream"; StreamingServers["StreamHub"] = "streamhub"; StreamingServers["StreamWish"] = "streamwish"; diff --git a/dist/models/types.js.map b/dist/models/types.js.map index 83f9beea3..a657d605f 100644 --- a/dist/models/types.js.map +++ b/dist/models/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AA2DA,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,wBAAS,CAAA;AACX,CAAC,EAbW,WAAW,2BAAX,WAAW,QAatB;AA+FD,IAAY,gBAmBX;AAnBD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;IACrB,mBAAmB;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,iDAA6B,CAAA;IAC7B,iDAA6B,CAAA;IAC7B,2CAAuB,CAAA;IACvB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+BAAW,CAAA;AACb,CAAC,EAnBW,gBAAgB,gCAAhB,gBAAgB,QAmB3B;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,8CAA+B,CAAA;IAC/B,kCAAmB,CAAA;AACrB,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB;AAED,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB;AA2ID;;GAEG;AACH,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AAsFD,IAAY,MAmBX;AAnBD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yCAA+B,CAAA;IAC/B,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+BAAqB,CAAA;AACvB,CAAC,EAnBW,MAAM,sBAAN,MAAM,QAmBjB;AAED,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB"} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AA2DA,IAAY,WAcX;AAdD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,wBAAS,CAAA;IACT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B,CAAA;IAC7B,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yCAA+B,CAAA;IAC/B,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+BAAqB,CAAA;AACvB,CAAC,EAnBW,MAAM,sBAAN,MAAM,QAmBjB;AAED,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB"} \ No newline at end of file diff --git a/dist/providers/anime/anix.d.ts b/dist/providers/anime/anix.d.ts index 2b0557ff7..21ddba97e 100644 --- a/dist/providers/anime/anix.d.ts +++ b/dist/providers/anime/anix.d.ts @@ -1,33 +1,37 @@ -import { AnimeParser, ISearch, IAnimeInfo, IAnimeResult, ISource, IEpisodeServer } from '../../models'; +import { AnimeParser, ISearch, IAnimeInfo, IAnimeResult, ISource, IEpisodeServer, StreamingServers, ProxyConfig } from '../../models'; +import { AxiosAdapter } from 'axios'; declare class Anix extends AnimeParser { readonly name = "Anix"; protected baseUrl: string; protected logo: string; protected classPath: string; private readonly requestedWith; + constructor(customBaseURL?: string, proxy?: ProxyConfig, adapter?: AxiosAdapter); /** * @param page page number (optional) - * @param type type of media. (optional) (default `1`) `1`: Japanese with subtitles, `2`: english/dub with no subtitles, `3`: chinese with english subtitles */ fetchRecentEpisodes: (page?: number) => Promise>; /** * @param query Search query + * @param page Page number (optional) */ search: (query: string, page?: number) => Promise>; /** * @param id Anime id - * @param page Page number */ fetchAnimeInfo: (id: string) => Promise; /** * + * @param id Anime id * @param episodeId Episode id + * @param server Streaming server(optional) */ - fetchEpisodeSources: (episodeId: string) => Promise; + fetchEpisodeSources: (id: string, episodeId: string, server?: StreamingServers) => Promise; /** * + * @param id Anime id * @param episodeId Episode id */ - fetchEpisodeServers: (episodeId: string) => Promise; + fetchEpisodeServers: (id: string, episodeId: string) => Promise; } export default Anix; diff --git a/dist/providers/anime/anix.js b/dist/providers/anime/anix.js index 257594525..ad83c4b56 100644 --- a/dist/providers/anime/anix.js +++ b/dist/providers/anime/anix.js @@ -2,8 +2,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); const cheerio_1 = require("cheerio"); const models_1 = require("../../models"); +const extractors_1 = require("../../extractors"); class Anix extends models_1.AnimeParser { - constructor() { + constructor(customBaseURL, proxy, adapter) { super(...arguments); this.name = 'Anix'; this.baseUrl = 'https://anix.sh'; @@ -12,7 +13,6 @@ class Anix extends models_1.AnimeParser { this.requestedWith = 'XMLHttpRequest'; /** * @param page page number (optional) - * @param type type of media. (optional) (default `1`) `1`: Japanese with subtitles, `2`: english/dub with no subtitles, `3`: chinese with english subtitles */ this.fetchRecentEpisodes = async (page = 1) => { try { @@ -46,6 +46,10 @@ class Anix extends models_1.AnimeParser { break; case 'TV Special': finalType = models_1.MediaFormat.TV_SPECIAL; + break; + case 'Comic': + finalType = models_1.MediaFormat.COMIC; + break; } recentEpisodes.push({ id: url === null || url === void 0 ? void 0 : url.split('/')[2], @@ -71,6 +75,7 @@ class Anix extends models_1.AnimeParser { }; /** * @param query Search query + * @param page Page number (optional) */ this.search = async (query, page = 1) => { try { @@ -111,6 +116,10 @@ class Anix extends models_1.AnimeParser { break; case 'TV Special': finalType = models_1.MediaFormat.TV_SPECIAL; + break; + case 'Comic': + finalType = models_1.MediaFormat.COMIC; + break; } searchResult.results.push({ id: url === null || url === void 0 ? void 0 : url.split('/')[2], @@ -129,7 +138,6 @@ class Anix extends models_1.AnimeParser { }; /** * @param id Anime id - * @param page Page number */ this.fetchAnimeInfo = async (id) => { var _a, _b, _c, _d; @@ -216,6 +224,10 @@ class Anix extends models_1.AnimeParser { break; case 'TV Special': animeInfo.type = models_1.MediaFormat.TV_SPECIAL; + break; + case 'Comic': + animeInfo.type = models_1.MediaFormat.COMIC; + break; } return animeInfo; } @@ -225,18 +237,136 @@ class Anix extends models_1.AnimeParser { }; /** * + * @param id Anime id * @param episodeId Episode id + * @param server Streaming server(optional) */ - this.fetchEpisodeSources = async (episodeId) => { - throw new Error('Method not implemented.'); + this.fetchEpisodeSources = async (id, episodeId, server = models_1.StreamingServers.VidStream) => { + var _a; + const url = `${this.baseUrl}/anime/${id}/${episodeId}`; + const uri = new URL(url); + const res = await this.client.get(url); + const $ = (0, cheerio_1.load)(res.data); + const servers = new Map(); + $($('.ani-server-type-pad')[0]) + .find('.server') + .each((i, el) => { + servers.set($(el).text().trim(), $(el).attr('data-video')); + }); + switch (server) { + case models_1.StreamingServers.Mp4Upload: + if (servers.get('Mp4upload') !== undefined) { + const streamUri = new URL(servers.get('Mp4upload')); + return { + headers: { + Referer: uri.origin, + }, + ...(await new extractors_1.StreamWish(this.proxyConfig, this.adapter).extract(streamUri)), + }; + } + throw new Error('Mp4Upload server not found'); + case models_1.StreamingServers.StreamWish: + const streamUrl = (_a = servers.get('Streamwish')) !== null && _a !== void 0 ? _a : undefined; + if (servers.get('Streamwish') != undefined) { + const streamUri = new URL(servers.get('Streamwish')); + return { + headers: { + Referer: uri.origin, + }, + ...(await new extractors_1.StreamWish(this.proxyConfig, this.adapter).extract(streamUri)), + }; + } + throw new Error('StreamWish server not found'); + default: + const episodeSources = { + sources: [], + }; + try { + let defaultUrl = ''; + $('script:contains("loadIframePlayer")').each((i, el) => { + const scriptContent = $(el).text(); + // Regular expression to capture the JSON inside loadIframePlayer + const jsonRegex = /loadIframePlayer\(\s*(['"`])(\[[\s\S]*?\])\1/; + const match = jsonRegex.exec(scriptContent); + if (match && match[0]) { + const extractedJson = match[0] + .replace('loadIframePlayer(', '') + .replace("'", '') + .replace("'", ''); + const data = JSON.parse(extractedJson); + defaultUrl = data[0].url; + episodeSources.sources.push({ + url: defaultUrl, + quality: `default`, + isM3U8: true, + }); + } + else { + console.error('No JSON data found in loadIframePlayer call.'); + } + }); + const m3u8Content = await this.client.get(defaultUrl); + if (m3u8Content.data.includes('EXTM3U')) { + const videoList = m3u8Content.data.split('#EXT-X-STREAM-INF:'); + for (const video of videoList !== null && videoList !== void 0 ? videoList : []) { + if (video.includes('BANDWIDTH')) { + const url = video.split('\n')[1]; + const quality = video.split('RESOLUTION=')[1].split('\n')[0].split('x')[1]; + const path = defaultUrl.replace(/\/[^/]*\.m3u8$/, '/'); + episodeSources.sources.push({ + url: path + url, + quality: `${quality.split(',')[0]}p`, + isM3U8: true, + }); + } + } + } + } + catch (err) { + throw new Error(err.message); + } + return { + headers: { + Referer: uri.origin, + }, + ...episodeSources, + }; + } }; /** * + * @param id Anime id * @param episodeId Episode id */ - this.fetchEpisodeServers = (episodeId) => { - throw new Error('Method not implemented.'); + this.fetchEpisodeServers = async (id, episodeId) => { + const url = `${this.baseUrl}/anime/${id}/${episodeId}`; + const uri = new URL(url); + const res = await this.client.get(url); + const $ = (0, cheerio_1.load)(res.data); + const servers = []; + $($('.ani-server-type-pad')[0]) + .find('.server') + .each((i, el) => { + servers.push({ + name: $(el).text().trim(), + url: $(el).attr('data-video'), + }); + }); + return servers; }; + this.baseUrl = customBaseURL + ? customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://') + ? customBaseURL + : `http://${customBaseURL}` + : this.baseUrl; + if (proxy) { + // Initialize proxyConfig if provided + this.setProxy(proxy); + } + if (adapter) { + // Initialize adapter if provided + this.setAxiosAdapter(adapter); + } } } exports.default = Anix; diff --git a/dist/providers/anime/anix.js.map b/dist/providers/anime/anix.js.map index ebefc5909..32760d03b 100644 --- a/dist/providers/anime/anix.js.map +++ b/dist/providers/anime/anix.js.map @@ -1 +1 @@ -{"version":3,"file":"anix.js","sourceRoot":"","sources":["../../../src/providers/anime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C;wBACjC,MAAM;oBACR,KAAK,OAAO;wBACV,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,KAAK,CAAC;wBACnC,MAAM;oBACR,KAAK,KAAK;wBACR,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,GAAG,CAAC;wBACjC,MAAM;oBACR,KAAK,SAAS;wBACZ,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,OAAO,CAAC;wBACrC,MAAM;oBACR,KAAK,OAAO;wBACV,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,KAAK,CAAC;wBACnC,MAAM;oBACR,KAAK,IAAI;wBACP,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,EAAE,CAAC;wBAChC,MAAM;oBACR,KAAK,YAAY;wBACf,SAAS,CAAC,IAAI,GAAG,oBAAW,CAAC,UAAU,CAAC;gBAC5C,CAAC;gBAED,OAAO,SAAS,CAAC;YACnB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC,CAAC;QAEF;;;WAGG;QACM,wBAAmB,GAAG,KAAK,EAAE,SAAiB,EAAoB,EAAE;YAC3E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC,CAAC;QAEF;;;WAGG;QACM,wBAAmB,GAAG,CAAC,SAAiB,EAA6B,EAAE;YAC9E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,kBAAe,IAAI,CAAC"} \ No newline at end of file +{"version":3,"file":"anix.js","sourceRoot":"","sources":["../../../src/providers/anime/anix.ts"],"names":[],"mappings":";;AAAA,qCAAwC;AAExC,yCAYsB;AACtB,iDAA8C;AAG9C,MAAM,IAAK,SAAQ,oBAAW;IAO5B,YAAY,aAAsB,EAAE,KAAmB,EAAE,OAAsB;QAC7E,KAAK,CAAC,G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EAAE,CAAC;YACV,qCAAqC;YACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,iCAAiC;YACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CAmWF;AAED,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 7e2f5f2bf..391840339 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "prepare": "husky || true", "test": "jest", "test:anime": "jest ./test/anime", + "test:anime:anix": "jest ./test/anime/anix.test.ts", "test:books": "jest ./test/books/libgen.test.ts", "test:comics": "jest ./test/comics", "test:movies": "jest ./test/movies", diff --git a/src/models/anime-parser.ts b/src/models/anime-parser.ts index d17ec9b66..a8a68ea5e 100644 --- a/src/models/anime-parser.ts +++ b/src/models/anime-parser.ts @@ -25,7 +25,7 @@ abstract class AnimeParser extends BaseParser { * * returns episode servers (video links) available */ - abstract fetchEpisodeServers(episodeId: string): Promise; + abstract fetchEpisodeServers(episodeId: string, ...args: any): Promise; } export default AnimeParser; diff --git a/src/models/types.ts b/src/models/types.ts index a7e82b772..99d55421c 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -70,6 +70,7 @@ export enum MediaFormat { NOVEL = 'NOVEL', ONE_SHOT = 'ONE_SHOT', PV = 'PV', + COMIC = 'COMIC', } export interface IAnimeInfo extends IAnimeResult { @@ -179,6 +180,7 @@ export enum StreamingServers { MyCloud = 'mycloud', Filemoon = 'filemoon', VidStreaming = 'vidstreaming', + VidStream = 'vidstream', SmashyStream = 'smashystream', StreamHub = 'streamhub', StreamWish = 'streamwish', diff --git a/src/providers/anime/anix.ts b/src/providers/anime/anix.ts index f4eb6ef7a..b9d3d99a0 100644 --- a/src/providers/anime/anix.ts +++ b/src/providers/anime/anix.ts @@ -10,7 +10,11 @@ import { SubOrSub, MediaFormat, MediaStatus, + StreamingServers, + ProxyConfig, } from '../../models'; +import { StreamWish } from '../../extractors'; +import { AxiosAdapter } from 'axios'; class Anix extends AnimeParser { override readonly name = 'Anix'; @@ -19,9 +23,25 @@ class Anix extends AnimeParser { protected override classPath = 'ANIME.Anix'; private readonly requestedWith = 'XMLHttpRequest'; + constructor(customBaseURL?: string, proxy?: ProxyConfig, adapter?: AxiosAdapter) { + super(...arguments); + this.baseUrl = customBaseURL + ? customBaseURL.startsWith('http://') || customBaseURL.startsWith('https://') + ? customBaseURL + : `http://${customBaseURL}` + : this.baseUrl; + if (proxy) { + // Initialize proxyConfig if provided + this.setProxy(proxy); + } + if (adapter) { + // Initialize adapter if provided + this.setAxiosAdapter(adapter); + } + } + /** * @param page page number (optional) - * @param type type of media. (optional) (default `1`) `1`: Japanese with subtitles, `2`: english/dub with no subtitles, `3`: chinese with english subtitles */ fetchRecentEpisodes = async (page: number = 1): Promise> => { try { @@ -60,6 +80,10 @@ class Anix extends AnimeParser { break; case 'TV Special': finalType = MediaFormat.TV_SPECIAL; + break; + case 'Comic': + finalType = MediaFormat.COMIC; + break; } recentEpisodes.push({ id: url?.split('/')[2]!, @@ -87,6 +111,7 @@ class Anix extends AnimeParser { /** * @param query Search query + * @param page Page number (optional) */ override search = async (query: string, page: number = 1): Promise> => { try { @@ -128,6 +153,10 @@ class Anix extends AnimeParser { break; case 'TV Special': finalType = MediaFormat.TV_SPECIAL; + break; + case 'Comic': + finalType = MediaFormat.COMIC; + break; } searchResult.results.push({ id: url?.split('/')[2]!, @@ -147,7 +176,6 @@ class Anix extends AnimeParser { /** * @param id Anime id - * @param page Page number */ override fetchAnimeInfo = async (id: string): Promise => { const url = `${this.baseUrl}/anime/${id}/ep-1`; @@ -228,6 +256,10 @@ class Anix extends AnimeParser { break; case 'TV Special': animeInfo.type = MediaFormat.TV_SPECIAL; + break; + case 'Comic': + animeInfo.type = MediaFormat.COMIC; + break; } return animeInfo; @@ -238,18 +270,128 @@ class Anix extends AnimeParser { /** * + * @param id Anime id * @param episodeId Episode id + * @param server Streaming server(optional) */ - override fetchEpisodeSources = async (episodeId: string): Promise => { - throw new Error('Method not implemented.'); + override fetchEpisodeSources = async ( + id: string, + episodeId: string, + server: StreamingServers = StreamingServers.VidStream + ): Promise => { + const url = `${this.baseUrl}/anime/${id}/${episodeId}`; + const uri = new URL(url); + const res = await this.client.get(url); + const $ = load(res.data); + const servers = new Map(); + $($('.ani-server-type-pad')[0]) + .find('.server') + .each((i, el) => { + servers.set($(el).text().trim(), $(el).attr('data-video')!); + }); + switch (server) { + case StreamingServers.Mp4Upload: + if (servers.get('Mp4upload') !== undefined) { + const streamUri = new URL(servers.get('Mp4upload')!); + return { + headers: { + Referer: uri.origin, + }, + ...(await new StreamWish(this.proxyConfig, this.adapter).extract(streamUri)), + }; + } + throw new Error('Mp4Upload server not found'); + case StreamingServers.StreamWish: + const streamUrl = servers.get('Streamwish') ?? undefined; + if (servers.get('Streamwish') != undefined) { + const streamUri = new URL(servers.get('Streamwish')!); + return { + headers: { + Referer: uri.origin, + }, + ...(await new StreamWish(this.proxyConfig, this.adapter).extract(streamUri)), + }; + } + throw new Error('StreamWish server not found'); + default: + const episodeSources: ISource = { + sources: [], + }; + + try { + let defaultUrl = ''; + $('script:contains("loadIframePlayer")').each((i, el) => { + const scriptContent = $(el).text(); + // Regular expression to capture the JSON inside loadIframePlayer + const jsonRegex = /loadIframePlayer\(\s*(['"`])(\[[\s\S]*?\])\1/; + const match = jsonRegex.exec(scriptContent); + + if (match && match[0]) { + const extractedJson = match[0] + .replace('loadIframePlayer(', '') + .replace("'", '') + .replace("'", ''); + const data = JSON.parse(extractedJson); + defaultUrl = data[0].url; + + episodeSources.sources.push({ + url: defaultUrl, + quality: `default`, + isM3U8: true, + }); + } else { + console.error('No JSON data found in loadIframePlayer call.'); + } + }); + const m3u8Content = await this.client.get(defaultUrl); + + if (m3u8Content.data.includes('EXTM3U')) { + const videoList = m3u8Content.data.split('#EXT-X-STREAM-INF:'); + for (const video of videoList ?? []) { + if (video.includes('BANDWIDTH')) { + const url = video.split('\n')[1]; + const quality = video.split('RESOLUTION=')[1].split('\n')[0].split('x')[1]; + const path = defaultUrl.replace(/\/[^/]*\.m3u8$/, '/'); + episodeSources.sources.push({ + url: path + url, + quality: `${quality.split(',')[0]}p`, + isM3U8: true, + }); + } + } + } + } catch (err) { + throw new Error((err as Error).message); + } + return { + headers: { + Referer: uri.origin, + }, + ...episodeSources, + }; + } }; /** * + * @param id Anime id * @param episodeId Episode id */ - override fetchEpisodeServers = (episodeId: string): Promise => { - throw new Error('Method not implemented.'); + override fetchEpisodeServers = async (id: string, episodeId: string): Promise => { + const url = `${this.baseUrl}/anime/${id}/${episodeId}`; + const uri = new URL(url); + const res = await this.client.get(url); + const $ = load(res.data); + const servers: IEpisodeServer[] = []; + $($('.ani-server-type-pad')[0]) + .find('.server') + .each((i, el) => { + servers.push({ + name: $(el).text().trim(), + url: $(el).attr('data-video')!, + }); + }); + return servers; }; } diff --git a/test/anime/anix.test.ts b/test/anime/anix.test.ts index 4cc7ab5b4..ccb999115 100644 --- a/test/anime/anix.test.ts +++ b/test/anime/anix.test.ts @@ -25,3 +25,14 @@ test('returns a filled object of anime data', async () => { const data = await anix.fetchAnimeInfo(s.results[0].id); expect(data).not.toBeNull(); }); + +test('returns a filled object of episode sources', async () => { + const data = await anix.fetchEpisodeSources('douluo-dalu-ii-jueshi-tangmen', 'ep-76'); + expect(data.sources).not.toEqual([]); + expect(data.subtitles).not.toEqual([]); +}); + +test('returns a filled array of servers', async () => { + const data = await anix.fetchEpisodeServers('douluo-dalu-ii-jueshi-tangmen', 'ep-76'); + expect(data).not.toEqual([]); +});