react-native-consumet 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/consumet/ConsumetModule.kt +3 -3
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/index.js.map +1 -1
- package/lib/commonjs/models/proxy.js +80 -25
- package/lib/commonjs/models/proxy.js.map +1 -1
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai.js +19 -14
- package/lib/commonjs/providers/anime/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe.js +5 -0
- package/lib/commonjs/providers/anime/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro.js +26 -19
- package/lib/commonjs/providers/anime/zoro.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +45 -214
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/providers/meta/mal.js +4 -4
- package/lib/commonjs/providers/meta/mal.js.map +1 -1
- package/lib/commonjs/providers/meta/tmdb.js +8 -15
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies.js +16 -8
- package/lib/commonjs/providers/movies/multimovies.js.map +1 -1
- package/lib/commonjs/utils/index.js +4 -4
- package/lib/commonjs/utils/utils.js +140 -4
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/index.js.map +1 -1
- package/lib/module/models/proxy.js +80 -25
- package/lib/module/models/proxy.js.map +1 -1
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/animekai.js +18 -14
- package/lib/module/providers/anime/animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe.js +5 -0
- package/lib/module/providers/anime/animepahe.js.map +1 -1
- package/lib/module/providers/anime/zoro.js +25 -19
- package/lib/module/providers/anime/zoro.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +46 -215
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/providers/meta/mal.js +5 -5
- package/lib/module/providers/meta/mal.js.map +1 -1
- package/lib/module/providers/meta/tmdb.js +9 -16
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/multimovies.js +16 -8
- package/lib/module/providers/movies/multimovies.js.map +1 -1
- package/lib/module/utils/index.js +2 -2
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/utils.js +126 -1
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +3 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/proxy.d.ts +6 -7
- package/lib/typescript/commonjs/src/models/proxy.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +36 -7
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts +0 -3
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/utils.d.ts +15 -1
- package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +3 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/index.d.ts +2 -2
- package/lib/typescript/module/src/models/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/proxy.d.ts +6 -7
- package/lib/typescript/module/src/models/proxy.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +36 -7
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animekai.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts +0 -3
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +2 -2
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/utils.d.ts +15 -1
- package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
- package/package.json +8 -11
- package/src/{index.ts → index.tsx} +5 -0
- package/src/models/index.ts +4 -0
- package/src/models/proxy.ts +80 -30
- package/src/models/types.ts +37 -3
- package/src/providers/anime/animekai.ts +17 -14
- package/src/providers/anime/animepahe.ts +8 -0
- package/src/providers/anime/zoro.ts +25 -20
- package/src/providers/meta/anilist.ts +81 -330
- package/src/providers/meta/mal.ts +5 -5
- package/src/providers/meta/tmdb.ts +11 -16
- package/src/providers/movies/multimovies.ts +15 -11
- package/src/utils/index.ts +2 -2
- package/src/utils/utils.ts +162 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anilist.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/meta/anilist.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,KAAK,UAAU,EAEf,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AAmB,GAAU,WAAW,MAAM,EAAE,GAAG,MAAM,GAAG,KAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAE/F;CACH;AASD,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multimovies.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/movies/multimovies.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,MAAM,EACN,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAGtB,cAAM,WAAY,SAAQ,WAAW;IACnC,SAAkB,IAAI,iBAAiB;IACvC,UAAmB,OAAO,
|
|
1
|
+
{"version":3,"file":"multimovies.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/movies/multimovies.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,MAAM,EACN,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAGtB,cAAM,WAAY,SAAQ,WAAW;IACnC,SAAkB,IAAI,iBAAiB;IACvC,UAAmB,OAAO,SAAiC;IAC3D,UAAmB,IAAI,SACkF;IACzG,UAAmB,SAAS,SAAwB;IAC3C,cAAc,cAA4C;gBACvD,aAAa,CAAC,EAAE,MAAM;IAYlC;;;;OAIG;IACM,MAAM,GAAU,OAAO,MAAM,EAAE,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAyDvF;IAEF;;;OAGG;IACM,cAAc,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,UAAU,CAAC,CAuGpE;IAEF;;;;;OAKG;IACM,mBAAmB,GAC1B,WAAW,MAAM,EACjB,UAAU,MAAM,EAAE,8CAA8C;IAChE,SAAQ,gBAA8C,EACtD,SAAS,MAAM,KACd,OAAO,CAAC,OAAO,CAAC,CAyDjB;IAEF;;;OAGG;IACM,mBAAmB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAYjF;IAEF,YAAY,GAAU,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CA+BrE;IAEF,YAAY,GAAU,OAAO,MAAM,EAAE,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAgCpF;YAEY,SAAS;CAkGxB;AAYD,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GogoCDN, StreamSB, VidCloud, MixDrop, Kwik, RapidCloud, MegaCloud, StreamTape, VizCloud, Filemoon, BilibiliExtractor, AsianLoad, SmashyStream, StreamHub, VidMoly, MegaUp } from '../extractors';
|
|
2
|
-
import { USER_AGENT, splitAuthor, floorID, formatTitle, genElement, capitalizeFirstLetter, range, getDays, days, isJson, convertDuration, substringAfter, substringBefore,
|
|
2
|
+
import { USER_AGENT, splitAuthor, floorID, formatTitle, genElement, capitalizeFirstLetter, range, getDays, days, isJson, convertDuration, substringAfter, substringBefore, calculateStringSimilarity } from './utils';
|
|
3
3
|
import { anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, anilistCharacterQuery, anilistStaffInfoQuery } from './queries';
|
|
4
4
|
import { parsePostInfo } from './getComics';
|
|
5
5
|
import getKKey from '../extractors/kisskh/kkey';
|
|
6
|
-
export { USER_AGENT, GogoCDN, StreamSB, SmashyStream, StreamHub, splitAuthor, floorID, formatTitle, parsePostInfo, genElement, capitalizeFirstLetter, VidCloud, MixDrop, Kwik, anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, range, RapidCloud, MegaCloud, StreamTape, VizCloud, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, anilistStaffInfoQuery, Filemoon, anilistCharacterQuery, getDays, days, isJson, convertDuration, BilibiliExtractor, AsianLoad, substringAfter, substringBefore,
|
|
6
|
+
export { USER_AGENT, GogoCDN, StreamSB, SmashyStream, StreamHub, splitAuthor, floorID, formatTitle, parsePostInfo, genElement, capitalizeFirstLetter, VidCloud, MixDrop, Kwik, anilistSearchQuery, anilistMediaDetailQuery, kitsuSearchQuery, range, RapidCloud, MegaCloud, StreamTape, VizCloud, anilistTrendingQuery, anilistPopularQuery, anilistAiringScheduleQuery, anilistGenresQuery, anilistAdvancedQuery, anilistSiteStatisticsQuery, anilistStaffInfoQuery, Filemoon, anilistCharacterQuery, getDays, days, isJson, convertDuration, BilibiliExtractor, AsianLoad, substringAfter, substringBefore, calculateStringSimilarity, VidMoly, getKKey, MegaUp, };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACP,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,MAAM,EACN,eAAe,EACf,cAAc,EACd,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OA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eFirstLetter: (s: string) => string;
|
|
|
15
15
|
export declare const getDays: (day1: string, day2: string) => number[];
|
|
16
16
|
export declare const isJson: (str: string) => boolean;
|
|
17
17
|
export declare function convertDuration(milliseconds: number): string;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const calculateStringSimilarity: (first: string, second: string) => number;
|
|
19
19
|
export declare const substringAfter: (str: string, toFind: string) => string;
|
|
20
20
|
export declare const substringBefore: (str: string, toFind: string) => string;
|
|
21
21
|
export declare const substringAfterLast: (str: string, toFind: string) => string;
|
|
22
22
|
export declare const substringBeforeLast: (str: string, toFind: string) => string;
|
|
23
23
|
export declare const getHashFromImage: (url: string) => "" | "hash";
|
|
24
|
+
export declare function findSimilarTitles(inputTitle: string, titles: any[]): any[];
|
|
25
|
+
export declare function cleanTitle(title: string | undefined | null): string;
|
|
26
|
+
export declare function removeSpecialChars(title: string | undefined | null): string;
|
|
27
|
+
export declare function transformSpecificVariations(title: string | undefined | null): string;
|
|
28
|
+
export declare function sanitizeTitle(title: string): string;
|
|
29
|
+
export declare function stringSearch(string: string, pattern: string): number;
|
|
30
|
+
export declare function parseUrl(url: string): {
|
|
31
|
+
href: string;
|
|
32
|
+
origin: string;
|
|
33
|
+
pathname: string;
|
|
34
|
+
hostname: string;
|
|
35
|
+
search: string;
|
|
36
|
+
hash: string;
|
|
37
|
+
};
|
|
24
38
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/utils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,wHACgG,CAAC;AACxH,eAAO,MAAM,IAAI,UAAiF,CAAC;AACnG,eAAO,MAAM,SAAS,2BAA2B,CAAC;AAElD,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,aAgB1C,CAAC;AA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AC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAIpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQnD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAcpE;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAwBA"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-consumet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "React Native library providing access to entertainment media information (anime, movies, manga, etc.) from multiple sources, adapting the Consumet API for mobile applications.",
|
|
5
|
-
"source": "./src/index.
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"*": [
|
|
11
|
-
"lib/typescript/commonjs/src/index.d.ts",
|
|
12
|
-
"lib/typescript/module/src/index.d.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
},
|
|
8
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
16
10
|
"exports": {
|
|
17
11
|
".": {
|
|
18
12
|
"import": {
|
|
@@ -87,6 +81,7 @@
|
|
|
87
81
|
"@types/crypto-js": "^4.2.2",
|
|
88
82
|
"@types/jest": "^29.5.5",
|
|
89
83
|
"@types/react": "^19.0.0",
|
|
84
|
+
"@types/string-similarity": "^4.0.2",
|
|
90
85
|
"babel-jest": "^29.7.0",
|
|
91
86
|
"commitlint": "^19.6.1",
|
|
92
87
|
"del-cli": "^5.1.0",
|
|
@@ -186,6 +181,8 @@
|
|
|
186
181
|
"ascii-url-encoder": "^1.2.0",
|
|
187
182
|
"axios": "^1.8.4",
|
|
188
183
|
"cheerio": "1.0.0-rc.12",
|
|
189
|
-
"crypto-js": "^4.2.0"
|
|
184
|
+
"crypto-js": "^4.2.0",
|
|
185
|
+
"react-native-url-polyfill": "^2.0.0",
|
|
186
|
+
"string-similarity": "^4.0.4"
|
|
190
187
|
}
|
|
191
188
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'react-native-url-polyfill/auto';
|
|
1
2
|
import Consumet from './NativeConsumet';
|
|
2
3
|
|
|
3
4
|
export function getSources(s: string): Promise<string> {
|
|
@@ -66,6 +67,8 @@ import {
|
|
|
66
67
|
type ITitle,
|
|
67
68
|
MediaFormat,
|
|
68
69
|
type ProxyConfig,
|
|
70
|
+
type AniZipEpisode,
|
|
71
|
+
type IMovieSeason,
|
|
69
72
|
} from './models';
|
|
70
73
|
|
|
71
74
|
export { ANIME, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
|
|
@@ -131,4 +134,6 @@ export type {
|
|
|
131
134
|
FuzzyDate,
|
|
132
135
|
ITitle,
|
|
133
136
|
ProxyConfig,
|
|
137
|
+
AniZipEpisode,
|
|
138
|
+
IMovieSeason,
|
|
134
139
|
};
|
package/src/models/index.ts
CHANGED
|
@@ -47,6 +47,8 @@ import {
|
|
|
47
47
|
type ProxyConfig,
|
|
48
48
|
type IStaff,
|
|
49
49
|
WatchListType,
|
|
50
|
+
type AniZipEpisode,
|
|
51
|
+
type IMovieSeason,
|
|
50
52
|
} from './types';
|
|
51
53
|
import { LibgenBookObject, GetComicsComicsObject } from './type-objects';
|
|
52
54
|
|
|
@@ -103,4 +105,6 @@ export type {
|
|
|
103
105
|
ITitle,
|
|
104
106
|
ProxyConfig,
|
|
105
107
|
IStaff,
|
|
108
|
+
AniZipEpisode,
|
|
109
|
+
IMovieSeason,
|
|
106
110
|
};
|
package/src/models/proxy.ts
CHANGED
|
@@ -1,51 +1,95 @@
|
|
|
1
1
|
import axios, { type AxiosAdapter, type AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
2
|
import type { ProxyConfig } from './types';
|
|
4
3
|
|
|
5
4
|
export class Proxy {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
protected client: AxiosInstance;
|
|
6
|
+
private validUrl = /^https?:\/\/.+/;
|
|
7
|
+
private proxyUrl: string | null = null;
|
|
8
|
+
private proxyKey: string | null = null;
|
|
9
|
+
private rotationTimer: NodeJS.Timeout | null = null;
|
|
10
|
+
|
|
11
11
|
constructor(
|
|
12
12
|
protected proxyConfig?: ProxyConfig,
|
|
13
13
|
protected adapter?: AxiosAdapter
|
|
14
14
|
) {
|
|
15
|
-
|
|
15
|
+
// Create client with optimized defaults for React Native
|
|
16
|
+
this.client = axios.create({
|
|
17
|
+
// Increase timeout for mobile networks
|
|
18
|
+
timeout: 15000,
|
|
19
|
+
// Add headers only once here
|
|
20
|
+
headers: {
|
|
21
|
+
'Accept': 'application/json, text/plain, */*',
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Apply adapter if provided
|
|
27
|
+
if (adapter) this.client.defaults.adapter = adapter;
|
|
28
|
+
|
|
29
|
+
// Set up interceptor only once
|
|
30
|
+
this.setupInterceptor();
|
|
16
31
|
|
|
32
|
+
// Apply proxy if provided
|
|
17
33
|
if (proxyConfig) this.setProxy(proxyConfig);
|
|
18
|
-
if (adapter) this.setAxiosAdapter(adapter);
|
|
19
34
|
}
|
|
20
|
-
|
|
35
|
+
|
|
36
|
+
private setupInterceptor() {
|
|
37
|
+
// Set the interceptor once during initialization
|
|
38
|
+
this.client.interceptors.request.use((config) => {
|
|
39
|
+
// Only modify URL if we have a proxy
|
|
40
|
+
if (this.proxyUrl) {
|
|
41
|
+
config.url = `${this.proxyUrl}${config?.url || ''}`;
|
|
42
|
+
|
|
43
|
+
// Only set header if we have a key
|
|
44
|
+
if (this.proxyKey) {
|
|
45
|
+
config.headers.set('x-api-key', this.proxyKey);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Special case for anify
|
|
50
|
+
if (config?.url?.includes('anify')) {
|
|
51
|
+
config.headers.set('User-Agent', 'consumet');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return config;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
21
58
|
/**
|
|
22
59
|
* Set or Change the proxy config
|
|
23
60
|
*/
|
|
24
61
|
setProxy(proxyConfig: ProxyConfig) {
|
|
25
|
-
|
|
62
|
+
// Clear any existing rotation timer
|
|
63
|
+
if (this.rotationTimer) {
|
|
64
|
+
clearInterval(this.rotationTimer);
|
|
65
|
+
this.rotationTimer = null;
|
|
66
|
+
}
|
|
26
67
|
|
|
27
|
-
|
|
28
|
-
|
|
68
|
+
// Early return if no URL
|
|
69
|
+
if (!proxyConfig?.url) return;
|
|
29
70
|
|
|
71
|
+
// Handle array of URLs
|
|
30
72
|
if (Array.isArray(proxyConfig?.url)) {
|
|
31
|
-
|
|
32
|
-
|
|
73
|
+
// Validate all URLs first
|
|
74
|
+
for (const [i, url] of this.toMap<string>(proxyConfig.url)) {
|
|
75
|
+
if (!this.validUrl.test(url)) {
|
|
76
|
+
throw new Error(`Proxy URL at index ${i} is invalid!`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
33
79
|
|
|
80
|
+
// Start rotation with validated URLs
|
|
34
81
|
this.rotateProxy({ ...proxyConfig, urls: proxyConfig.url });
|
|
35
|
-
|
|
36
82
|
return;
|
|
37
83
|
}
|
|
38
84
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (config?.url?.includes('anify')) config.headers.set('User-Agent', 'consumet');
|
|
85
|
+
// Handle single URL
|
|
86
|
+
if (!this.validUrl.test(proxyConfig.url)) {
|
|
87
|
+
throw new Error('Proxy URL is invalid!');
|
|
88
|
+
}
|
|
46
89
|
|
|
47
|
-
|
|
48
|
-
|
|
90
|
+
// Store proxy settings (used by interceptor)
|
|
91
|
+
this.proxyUrl = proxyConfig.url;
|
|
92
|
+
this.proxyKey = proxyConfig.key ?? null;
|
|
49
93
|
}
|
|
50
94
|
|
|
51
95
|
/**
|
|
@@ -54,18 +98,24 @@ export class Proxy {
|
|
|
54
98
|
setAxiosAdapter(adapter: AxiosAdapter) {
|
|
55
99
|
this.client.defaults.adapter = adapter;
|
|
56
100
|
}
|
|
101
|
+
|
|
57
102
|
private rotateProxy = (proxy: Omit<ProxyConfig, 'url'> & { urls: string[] }) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
103
|
+
// Start with first URL
|
|
104
|
+
this.proxyUrl = proxy.urls[0]!;
|
|
105
|
+
this.proxyKey = proxy.key ?? null;
|
|
106
|
+
|
|
107
|
+
// Set up rotation
|
|
108
|
+
let index = 0;
|
|
109
|
+
const urlCount = proxy.urls.length;
|
|
61
110
|
|
|
62
|
-
|
|
111
|
+
this.rotationTimer = setInterval(() => {
|
|
112
|
+
// Move to next URL in array
|
|
113
|
+
index = (index + 1) % urlCount;
|
|
114
|
+
this.proxyUrl = proxy.urls[index]!;
|
|
63
115
|
}, proxy?.rotateInterval ?? 5000);
|
|
64
116
|
};
|
|
65
117
|
|
|
66
118
|
private toMap = <T>(arr: T[]): [number, T][] => arr.map((v, i) => [i, v]);
|
|
67
|
-
|
|
68
|
-
protected client: AxiosInstance;
|
|
69
119
|
}
|
|
70
120
|
|
|
71
121
|
export default Proxy;
|
package/src/models/types.ts
CHANGED
|
@@ -127,6 +127,7 @@ export interface IAnimeEpisodeV2 {
|
|
|
127
127
|
|
|
128
128
|
export interface IAnimeEpisode {
|
|
129
129
|
id: string;
|
|
130
|
+
uniqueId?: string;
|
|
130
131
|
number: number;
|
|
131
132
|
title?: string;
|
|
132
133
|
description?: string;
|
|
@@ -140,6 +141,25 @@ export interface IAnimeEpisode {
|
|
|
140
141
|
[x: string]: unknown; // other fields
|
|
141
142
|
}
|
|
142
143
|
|
|
144
|
+
export interface AniZipEpisode {
|
|
145
|
+
episodeNumber: number;
|
|
146
|
+
title: {
|
|
147
|
+
'ja': string;
|
|
148
|
+
'en': string;
|
|
149
|
+
'fr': string;
|
|
150
|
+
'hu': string;
|
|
151
|
+
'x-jat': string;
|
|
152
|
+
};
|
|
153
|
+
airDate: string;
|
|
154
|
+
airDateUtc: string;
|
|
155
|
+
overview: string;
|
|
156
|
+
image: string;
|
|
157
|
+
episode: string;
|
|
158
|
+
airdate: string;
|
|
159
|
+
rating: string;
|
|
160
|
+
summary: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
143
163
|
export interface IEpisodeServer {
|
|
144
164
|
name: string;
|
|
145
165
|
url: string;
|
|
@@ -351,7 +371,7 @@ export interface ISource {
|
|
|
351
371
|
outro?: Intro;
|
|
352
372
|
subtitles?: ISubtitle[];
|
|
353
373
|
sources: IVideo[];
|
|
354
|
-
download?: string;
|
|
374
|
+
download?: string | { url?: string; quality?: string }[];
|
|
355
375
|
embedURL?: string;
|
|
356
376
|
}
|
|
357
377
|
|
|
@@ -372,7 +392,12 @@ export interface IMovieEpisode {
|
|
|
372
392
|
number?: number;
|
|
373
393
|
season?: number;
|
|
374
394
|
description?: string;
|
|
375
|
-
image?:
|
|
395
|
+
image?:
|
|
396
|
+
| string
|
|
397
|
+
| {
|
|
398
|
+
mobile?: string;
|
|
399
|
+
hd?: string;
|
|
400
|
+
};
|
|
376
401
|
releaseDate?: string;
|
|
377
402
|
[x: string]: unknown; // other fields
|
|
378
403
|
}
|
|
@@ -432,6 +457,15 @@ interface INewsFeedPreview {
|
|
|
432
457
|
full: string;
|
|
433
458
|
}
|
|
434
459
|
|
|
460
|
+
export interface IMovieSeason {
|
|
461
|
+
season: number;
|
|
462
|
+
image?: {
|
|
463
|
+
mobile?: string;
|
|
464
|
+
hd?: string;
|
|
465
|
+
};
|
|
466
|
+
episodes: IMovieEpisode[];
|
|
467
|
+
}
|
|
468
|
+
|
|
435
469
|
export interface IMovieInfo extends IMovieResult {
|
|
436
470
|
cover?: string;
|
|
437
471
|
recommendations?: IMovieResult[];
|
|
@@ -445,7 +479,7 @@ export interface IMovieInfo extends IMovieResult {
|
|
|
445
479
|
tags?: string[];
|
|
446
480
|
totalEpisodes?: number;
|
|
447
481
|
trailer?: Trailer;
|
|
448
|
-
seasons?:
|
|
482
|
+
seasons?: IMovieSeason[];
|
|
449
483
|
episodes?: IMovieEpisode[];
|
|
450
484
|
}
|
|
451
485
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from '../../models';
|
|
16
16
|
|
|
17
17
|
import { MegaUp } from '../../utils';
|
|
18
|
+
import axios from 'axios';
|
|
18
19
|
|
|
19
20
|
const { GenerateToken, DecodeIframeData } = new MegaUp();
|
|
20
21
|
|
|
@@ -299,7 +300,7 @@ class AnimeKai extends AnimeParser {
|
|
|
299
300
|
title: '',
|
|
300
301
|
};
|
|
301
302
|
try {
|
|
302
|
-
const { data } = await
|
|
303
|
+
const { data } = await axios.get(`${this.baseUrl}/watch/${id}`, {
|
|
303
304
|
headers: this.Headers(),
|
|
304
305
|
});
|
|
305
306
|
const $ = load(data);
|
|
@@ -388,7 +389,7 @@ class AnimeKai extends AnimeParser {
|
|
|
388
389
|
info.season = $('.entity-scroll > .detail').find("div:contains('Premiered') > span").text().trim();
|
|
389
390
|
|
|
390
391
|
const ani_id = $('.rate-box#anime-rating').attr('data-id');
|
|
391
|
-
const episodesAjax = await
|
|
392
|
+
const episodesAjax = await axios.get(
|
|
392
393
|
`${this.baseUrl}/ajax/episodes/list?ani_id=${ani_id}&_=${GenerateToken(ani_id!)}`,
|
|
393
394
|
{
|
|
394
395
|
headers: {
|
|
@@ -400,26 +401,28 @@ class AnimeKai extends AnimeParser {
|
|
|
400
401
|
);
|
|
401
402
|
const $$ = load(episodesAjax.data.result);
|
|
402
403
|
|
|
404
|
+
// Pre-calculate values used for all episodes
|
|
405
|
+
const episodeElements = $$('div.eplist > ul > li > a');
|
|
406
|
+
const subCount = parseInt($('.entity-scroll > .info > span.sub').text().trim()) || 0;
|
|
407
|
+
const dubCount = parseInt($('.entity-scroll > .info > span.dub').text().trim()) || 0;
|
|
408
|
+
|
|
403
409
|
info.totalEpisodes = $$('div.eplist > ul > li').length;
|
|
404
410
|
info.episodes = [];
|
|
405
411
|
|
|
406
|
-
|
|
412
|
+
episodeElements.each((i, el) => {
|
|
413
|
+
const $el = $$(el);
|
|
414
|
+
const href = `${$el.attr('href')}ep=${$el.attr('num')}` || '';
|
|
415
|
+
const number = parseInt($el.attr('data-number') || '0');
|
|
407
416
|
const episodeId = `${info.id}$ep=${$$(el).attr('num')}$token=${$$(el).attr('token')}`; //appending token to episode id, as it is required to fetch servers keeping the structure same as other providers
|
|
408
|
-
const number = parseInt($$(el).attr('num')!);
|
|
409
|
-
const title = $$(el).children('span').text().trim();
|
|
410
|
-
const url = `${this.baseUrl}/watch/${info.id}${$$(el).attr('href')}ep=${$$(el).attr('num')}`;
|
|
411
|
-
const isFiller = $$(el).hasClass('filler');
|
|
412
|
-
const isSubbed = number <= (parseInt($('.entity-scroll > .info > span.sub').text().trim()) || 0);
|
|
413
|
-
const isDubbed = number <= (parseInt($('.entity-scroll > .info > span.dub').text().trim()) || 0);
|
|
414
417
|
|
|
415
418
|
info.episodes?.push({
|
|
416
419
|
id: episodeId,
|
|
417
420
|
number: number,
|
|
418
|
-
title:
|
|
419
|
-
isFiller:
|
|
420
|
-
isSubbed:
|
|
421
|
-
isDubbed:
|
|
422
|
-
url:
|
|
421
|
+
title: $el.children('span').text().trim(),
|
|
422
|
+
isFiller: $el.hasClass('filler'),
|
|
423
|
+
isSubbed: number <= subCount,
|
|
424
|
+
isDubbed: number <= dubCount,
|
|
425
|
+
url: this.baseUrl + href,
|
|
423
426
|
});
|
|
424
427
|
});
|
|
425
428
|
|
|
@@ -171,6 +171,13 @@ class AnimePahe extends AnimeParser {
|
|
|
171
171
|
audio: $(el).attr('data-audio'),
|
|
172
172
|
}));
|
|
173
173
|
|
|
174
|
+
const downloads = $('div#pickDownload > a')
|
|
175
|
+
.map((i, el) => ({
|
|
176
|
+
url: $(el).attr('href')!,
|
|
177
|
+
quality: $(el).text(),
|
|
178
|
+
}))
|
|
179
|
+
.get();
|
|
180
|
+
|
|
174
181
|
const iSource: ISource = {
|
|
175
182
|
headers: {
|
|
176
183
|
Referer: 'https://kwik.cx/',
|
|
@@ -183,6 +190,7 @@ class AnimePahe extends AnimeParser {
|
|
|
183
190
|
res[0]!.isDub = link.audio === 'eng';
|
|
184
191
|
iSource.sources.push(res[0]!);
|
|
185
192
|
}
|
|
193
|
+
iSource.download = downloads;
|
|
186
194
|
|
|
187
195
|
return iSource;
|
|
188
196
|
} catch (err) {
|
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
|
|
18
18
|
import { StreamSB, MegaCloud, StreamTape } from '../../utils';
|
|
19
19
|
import { USER_AGENT } from '../../utils';
|
|
20
|
+
import axios from 'axios';
|
|
20
21
|
|
|
21
22
|
class Zoro extends AnimeParser {
|
|
22
23
|
override readonly name = 'Zoro';
|
|
23
|
-
protected override baseUrl = 'https://
|
|
24
|
+
protected override baseUrl = 'https://hianime.nz';
|
|
24
25
|
protected override logo =
|
|
25
26
|
'https://is3-ssl.mzstatic.com/image/thumb/Purple112/v4/7e/91/00/7e9100ee-2b62-0942-4cdc-e9b93252ce1c/source/512x512bb.jpg';
|
|
26
27
|
protected override classPath = 'ANIME.Zoro';
|
|
@@ -536,7 +537,7 @@ class Zoro extends AnimeParser {
|
|
|
536
537
|
title: '',
|
|
537
538
|
};
|
|
538
539
|
try {
|
|
539
|
-
const { data } = await
|
|
540
|
+
const { data } = await axios.get(`${this.baseUrl}/watch/${id}`);
|
|
540
541
|
const $ = load(data);
|
|
541
542
|
|
|
542
543
|
const { mal_id, anilist_id } = JSON.parse($('#syncData').text());
|
|
@@ -583,7 +584,7 @@ class Zoro extends AnimeParser {
|
|
|
583
584
|
}
|
|
584
585
|
|
|
585
586
|
// ZORO - PAGE INFO
|
|
586
|
-
const zInfo = await
|
|
587
|
+
const zInfo = await axios.get(info.url);
|
|
587
588
|
const $$$ = load(zInfo.data);
|
|
588
589
|
|
|
589
590
|
info.genres = [];
|
|
@@ -623,34 +624,36 @@ class Zoro extends AnimeParser {
|
|
|
623
624
|
.trim();
|
|
624
625
|
}
|
|
625
626
|
|
|
626
|
-
const episodesAjax = await
|
|
627
|
+
const episodesAjax = await axios.get(`${this.baseUrl}/ajax/v2/episode/list/${id.split('-').pop()}`, {
|
|
627
628
|
headers: {
|
|
628
629
|
'X-Requested-With': 'XMLHttpRequest',
|
|
629
630
|
'Referer': `${this.baseUrl}/watch/${id}`,
|
|
630
631
|
},
|
|
631
632
|
});
|
|
632
|
-
|
|
633
633
|
const $$ = load(episodesAjax.data.html);
|
|
634
634
|
|
|
635
|
-
|
|
635
|
+
// Pre-calculate values used for all episodes
|
|
636
|
+
const episodeElements = $$('div.detail-infor-content > div > a');
|
|
637
|
+
const subCount = parseInt($('div.film-stats div.tick div.tick-item.tick-sub').text().trim()) || 0;
|
|
638
|
+
const dubCount = parseInt($('div.film-stats div.tick div.tick-item.tick-dub').text().trim()) || 0;
|
|
639
|
+
|
|
640
|
+
info.totalEpisodes = episodeElements.length;
|
|
636
641
|
info.episodes = [];
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
const
|
|
642
|
-
const
|
|
643
|
-
const isSubbed = number <= (parseInt($('div.film-stats div.tick div.tick-item.tick-sub').text().trim()) || 0);
|
|
644
|
-
const isDubbed = number <= (parseInt($('div.film-stats div.tick div.tick-item.tick-dub').text().trim()) || 0);
|
|
642
|
+
|
|
643
|
+
// Single pass through episodes
|
|
644
|
+
episodeElements.each((i, el) => {
|
|
645
|
+
const $el = $$(el);
|
|
646
|
+
const href = $el.attr('href') || '';
|
|
647
|
+
const number = parseInt($el.attr('data-number') || '0');
|
|
645
648
|
|
|
646
649
|
info.episodes?.push({
|
|
647
|
-
id:
|
|
650
|
+
id: href.split('/')[2]?.replace('?ep=', '$episode$') || '',
|
|
648
651
|
number: number,
|
|
649
|
-
title: title,
|
|
650
|
-
isFiller:
|
|
651
|
-
isSubbed:
|
|
652
|
-
isDubbed:
|
|
653
|
-
url:
|
|
652
|
+
title: $el.attr('title'),
|
|
653
|
+
isFiller: $el.hasClass('ssl-item-filler'),
|
|
654
|
+
isSubbed: number <= subCount,
|
|
655
|
+
isDubbed: number <= dubCount,
|
|
656
|
+
url: this.baseUrl + href,
|
|
654
657
|
});
|
|
655
658
|
});
|
|
656
659
|
|
|
@@ -828,6 +831,7 @@ class Zoro extends AnimeParser {
|
|
|
828
831
|
}
|
|
829
832
|
return res;
|
|
830
833
|
} catch (err) {
|
|
834
|
+
console.log(err);
|
|
831
835
|
throw new Error('Something went wrong. Please try again later.');
|
|
832
836
|
}
|
|
833
837
|
};
|
|
@@ -867,6 +871,7 @@ class Zoro extends AnimeParser {
|
|
|
867
871
|
});
|
|
868
872
|
return results;
|
|
869
873
|
} catch (err) {
|
|
874
|
+
console.log(err);
|
|
870
875
|
throw new Error('Something went wrong. Please try again later.');
|
|
871
876
|
}
|
|
872
877
|
};
|