react-native-consumet 0.4.3 → 0.6.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/build.gradle +1 -0
- package/android/generated/java/com/consumet/NativeConsumetSpec.java +8 -0
- package/android/generated/jni/RNConsumetSpec-generated.cpp +12 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +14 -0
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +18 -0
- package/android/src/main/java/com/consumet/ConsumetModule.kt +63 -38
- package/android/src/main/java/com/consumet/DdosGuardModule.kt +142 -0
- package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +14 -0
- package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +6 -0
- package/ios/generated/RNConsumetSpecJSI-generated.cpp +14 -0
- package/ios/generated/RNConsumetSpecJSI.h +18 -0
- package/lib/commonjs/NativeConsumet.ts +2 -0
- package/lib/commonjs/index.js +10 -4
- 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 +59 -9
- 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 +38 -208
- 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 +6 -15
- package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
- package/lib/commonjs/providers/movies/multimovies.js +33 -13
- 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/NativeConsumet.ts +2 -0
- package/lib/module/index.js +6 -3
- 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 +60 -10
- 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 +39 -209
- 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 +7 -16
- package/lib/module/providers/meta/tmdb.js.map +1 -1
- package/lib/module/providers/movies/multimovies.js +33 -13
- 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/NativeConsumet.d.ts +4 -0
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +6 -3
- 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 +4 -1
- 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 +7 -3
- 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/NativeConsumet.d.ts +4 -0
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +6 -3
- 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 +4 -1
- 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 +7 -3
- 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 +5 -2
- package/src/NativeConsumet.ts +2 -0
- package/src/index.tsx +5 -3
- package/src/models/index.ts +2 -0
- package/src/models/proxy.ts +80 -30
- package/src/models/types.ts +6 -1
- package/src/providers/anime/animekai.ts +17 -14
- package/src/providers/anime/animepahe.ts +70 -10
- package/src/providers/anime/zoro.ts +25 -20
- package/src/providers/meta/anilist.ts +71 -325
- package/src/providers/meta/mal.ts +5 -5
- package/src/providers/meta/tmdb.ts +7 -16
- package/src/providers/movies/multimovies.ts +28 -19
- 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,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,MAAM,EACN,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,WAAW,EAEhB,KAAK,MAAM,
|
|
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,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,MAA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AAO,
|
|
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,CAwDjB;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;CAwGxB;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,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,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EACL,UAAU,EACV,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,WAAW,EACX,OAAO,EACP,WAAW,EACX,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,QAAQ,EACR,qBAAqB,EACrB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,OAAO,EACP,OAAO,EACP,MAAM,GACP,CAAC"}
|
|
@@ -15,10 +15,24 @@ export declare const capitalizeFirstLetter: (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;AAEF,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,WAOjC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,WAGxC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,wEAyB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI;;;;;CAAsE,aACzC,CAAC;AAEpD,eAAO,MAAM,qBAAqB,GAAI,GAAG,MAAM,WAA4C,CAAC;AAE5F,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,aAWjD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,YAOjC,CAAC;AAEF,wBAAgB,eAAe,CAAC,YAAY,EAAE,MA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CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-consumet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"@types/crypto-js": "^4.2.2",
|
|
82
82
|
"@types/jest": "^29.5.5",
|
|
83
83
|
"@types/react": "^19.0.0",
|
|
84
|
+
"@types/string-similarity": "^4.0.2",
|
|
84
85
|
"babel-jest": "^29.7.0",
|
|
85
86
|
"commitlint": "^19.6.1",
|
|
86
87
|
"del-cli": "^5.1.0",
|
|
@@ -180,6 +181,8 @@
|
|
|
180
181
|
"ascii-url-encoder": "^1.2.0",
|
|
181
182
|
"axios": "^1.8.4",
|
|
182
183
|
"cheerio": "1.0.0-rc.12",
|
|
183
|
-
"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"
|
|
184
187
|
}
|
|
185
188
|
}
|
package/src/NativeConsumet.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
5
|
getSources(xrax: string): Promise<string>;
|
|
6
|
+
bypassDdosGuard(url: string): Promise<{ cookie: string }>;
|
|
7
|
+
getDdosGuardCookiesWithWebView(url: string): Promise<string>;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export default TurboModuleRegistry.getEnforcing<Spec>('Consumet');
|
package/src/index.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import 'react-native-url-polyfill/auto';
|
|
1
2
|
import Consumet from './NativeConsumet';
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
export const { getSources, bypassDdosGuard, getDdosGuardCookiesWithWebView } = Consumet;
|
|
5
|
+
|
|
6
6
|
import { ANIME, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META, NEWS } from './providers';
|
|
7
7
|
import { PROVIDERS_LIST } from './utils/providers-list';
|
|
8
8
|
import {
|
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
MediaFormat,
|
|
68
68
|
type ProxyConfig,
|
|
69
69
|
type AniZipEpisode,
|
|
70
|
+
type IMovieSeason,
|
|
70
71
|
} from './models';
|
|
71
72
|
|
|
72
73
|
export { ANIME, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
|
|
@@ -133,4 +134,5 @@ export type {
|
|
|
133
134
|
ITitle,
|
|
134
135
|
ProxyConfig,
|
|
135
136
|
AniZipEpisode,
|
|
137
|
+
IMovieSeason,
|
|
136
138
|
};
|
package/src/models/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
type IStaff,
|
|
49
49
|
WatchListType,
|
|
50
50
|
type AniZipEpisode,
|
|
51
|
+
type IMovieSeason,
|
|
51
52
|
} from './types';
|
|
52
53
|
import { LibgenBookObject, GetComicsComicsObject } from './type-objects';
|
|
53
54
|
|
|
@@ -105,4 +106,5 @@ export type {
|
|
|
105
106
|
ProxyConfig,
|
|
106
107
|
IStaff,
|
|
107
108
|
AniZipEpisode,
|
|
109
|
+
IMovieSeason,
|
|
108
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
|
@@ -392,7 +392,12 @@ export interface IMovieEpisode {
|
|
|
392
392
|
number?: number;
|
|
393
393
|
season?: number;
|
|
394
394
|
description?: string;
|
|
395
|
-
image?:
|
|
395
|
+
image?:
|
|
396
|
+
| string
|
|
397
|
+
| {
|
|
398
|
+
mobile?: string;
|
|
399
|
+
hd?: string;
|
|
400
|
+
};
|
|
396
401
|
releaseDate?: string;
|
|
397
402
|
[x: string]: unknown; // other fields
|
|
398
403
|
}
|
|
@@ -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
|
|
|
@@ -10,22 +10,52 @@ import {
|
|
|
10
10
|
type IAnimeEpisode,
|
|
11
11
|
type IEpisodeServer,
|
|
12
12
|
MediaFormat,
|
|
13
|
+
SubOrSub,
|
|
13
14
|
} from '../../models';
|
|
14
15
|
import { Kwik } from '../../extractors';
|
|
16
|
+
import { bypassDdosGuard, getDdosGuardCookiesWithWebView } from 'react-native-consumet';
|
|
15
17
|
|
|
16
18
|
class AnimePahe extends AnimeParser {
|
|
17
19
|
override readonly name = 'AnimePahe';
|
|
18
20
|
protected override baseUrl = 'https://animepahe.ru';
|
|
19
21
|
protected override logo = 'https://animepahe.com/pikacon.ico';
|
|
20
22
|
protected override classPath = 'ANIME.AnimePahe';
|
|
23
|
+
private ddgCookie:
|
|
24
|
+
| {
|
|
25
|
+
cookie: string;
|
|
26
|
+
}
|
|
27
|
+
| null
|
|
28
|
+
| string = null;
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
// Initialize the DDoS-Guard cookie when the instance is created
|
|
33
|
+
this.initDdgCookie();
|
|
34
|
+
}
|
|
21
35
|
|
|
22
|
-
|
|
36
|
+
private async initDdgCookie(): Promise<void> {
|
|
37
|
+
try {
|
|
38
|
+
try {
|
|
39
|
+
this.ddgCookie = await getDdosGuardCookiesWithWebView(this.baseUrl);
|
|
40
|
+
// console.log('DDoS-Guard cookie obtained (WebView):', this.ddgCookie);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
// console.error('Failed to bypass DDoS-Guard with WebView:', err);
|
|
43
|
+
this.ddgCookie = await bypassDdosGuard(this.baseUrl);
|
|
44
|
+
// console.log('DDoS-Guard cookie obtained (fallback):', this.ddgCookie);
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error('Failed to initialize DDoS-Guard cookie:', error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
23
50
|
|
|
24
51
|
/**
|
|
25
52
|
* @param query Search query
|
|
26
53
|
*/
|
|
27
54
|
override search = async (query: string): Promise<ISearch<IAnimeResult>> => {
|
|
28
55
|
try {
|
|
56
|
+
if (!this.ddgCookie) {
|
|
57
|
+
await this.initDdgCookie();
|
|
58
|
+
}
|
|
29
59
|
const { data } = await this.client.get(`${this.baseUrl}/api?m=search&q=${encodeURIComponent(query)}`, {
|
|
30
60
|
headers: this.Headers(false),
|
|
31
61
|
});
|
|
@@ -56,8 +86,10 @@ class AnimePahe extends AnimeParser {
|
|
|
56
86
|
id: id,
|
|
57
87
|
title: '',
|
|
58
88
|
};
|
|
59
|
-
console.log(`${this.baseUrl}/anime/${id}`, this.Headers(id));
|
|
60
89
|
try {
|
|
90
|
+
if (!this.ddgCookie) {
|
|
91
|
+
await this.initDdgCookie();
|
|
92
|
+
}
|
|
61
93
|
const res = await fetch(`${this.baseUrl}/anime/${id}`, {
|
|
62
94
|
headers: this.Headers(id),
|
|
63
95
|
});
|
|
@@ -135,6 +167,8 @@ class AnimePahe extends AnimeParser {
|
|
|
135
167
|
title: item.title,
|
|
136
168
|
image: item.snapshot,
|
|
137
169
|
duration: item.duration,
|
|
170
|
+
isSubbed: item.audio === 'jpn' || item.audio === 'eng',
|
|
171
|
+
isDubbed: item.audio === 'eng',
|
|
138
172
|
url: `${this.baseUrl}/play/${id}/${item.session}`,
|
|
139
173
|
}) as IAnimeEpisode
|
|
140
174
|
)
|
|
@@ -155,10 +189,14 @@ class AnimePahe extends AnimeParser {
|
|
|
155
189
|
|
|
156
190
|
/**
|
|
157
191
|
*
|
|
158
|
-
* @param episodeId
|
|
192
|
+
* @param episodeId Episode id
|
|
193
|
+
* @param subOrDub sub or dub (default `SubOrSub.SUB`) (optional)
|
|
159
194
|
*/
|
|
160
|
-
override fetchEpisodeSources = async (episodeId: string): Promise<ISource> => {
|
|
195
|
+
override fetchEpisodeSources = async (episodeId: string, subOrDub: SubOrSub = SubOrSub.SUB): Promise<ISource> => {
|
|
161
196
|
try {
|
|
197
|
+
if (!this.ddgCookie) {
|
|
198
|
+
await this.initDdgCookie();
|
|
199
|
+
}
|
|
162
200
|
const { data } = await this.client.get(`${this.baseUrl}/play/${episodeId}`, {
|
|
163
201
|
headers: this.Headers(episodeId.split('/')[0]!),
|
|
164
202
|
});
|
|
@@ -184,12 +222,28 @@ class AnimePahe extends AnimeParser {
|
|
|
184
222
|
},
|
|
185
223
|
sources: [],
|
|
186
224
|
};
|
|
225
|
+
|
|
187
226
|
for (const link of links) {
|
|
188
227
|
const res = await new Kwik(this.proxyConfig).extract(new URL(link.url));
|
|
189
228
|
res[0]!.quality = link.quality;
|
|
190
229
|
res[0]!.isDub = link.audio === 'eng';
|
|
191
|
-
|
|
230
|
+
|
|
231
|
+
// Only include sources that match the requested SubOrSub type
|
|
232
|
+
if ((subOrDub === SubOrSub.DUB && res[0]!.isDub) || (subOrDub === SubOrSub.SUB && !res[0]!.isDub)) {
|
|
233
|
+
iSource.sources.push(res[0]!);
|
|
234
|
+
}
|
|
192
235
|
}
|
|
236
|
+
|
|
237
|
+
// If no sources were found after filtering, include all sources as fallback
|
|
238
|
+
// if (iSource.sources.length === 0) {
|
|
239
|
+
// for (const link of links) {
|
|
240
|
+
// const res = await new Kwik(this.proxyConfig).extract(new URL(link.url));
|
|
241
|
+
// res[0]!.quality = link.quality;
|
|
242
|
+
// res[0]!.isDub = link.audio === 'eng';
|
|
243
|
+
// iSource.sources.push(res[0]!);
|
|
244
|
+
// }
|
|
245
|
+
// }
|
|
246
|
+
|
|
193
247
|
iSource.download = downloads;
|
|
194
248
|
|
|
195
249
|
return iSource;
|
|
@@ -202,7 +256,6 @@ class AnimePahe extends AnimeParser {
|
|
|
202
256
|
const res = await this.client.get(`${this.baseUrl}/api?m=release&id=${session}&sort=episode_asc&page=${page}`, {
|
|
203
257
|
headers: this.Headers(session),
|
|
204
258
|
});
|
|
205
|
-
|
|
206
259
|
const epData = res.data.data;
|
|
207
260
|
|
|
208
261
|
return [
|
|
@@ -213,6 +266,8 @@ class AnimePahe extends AnimeParser {
|
|
|
213
266
|
title: item.title,
|
|
214
267
|
image: item.snapshot,
|
|
215
268
|
duration: item.duration,
|
|
269
|
+
isSubbed: item.audio === 'jpn' || item.audio === 'eng',
|
|
270
|
+
isDubbed: item.audio === 'eng',
|
|
216
271
|
url: `${this.baseUrl}/play/${session}/${item.session}`,
|
|
217
272
|
})
|
|
218
273
|
),
|
|
@@ -228,11 +283,9 @@ class AnimePahe extends AnimeParser {
|
|
|
228
283
|
};
|
|
229
284
|
|
|
230
285
|
private Headers(sessionId: string | false) {
|
|
231
|
-
|
|
286
|
+
const headers: Record<string, string> = {
|
|
232
287
|
'authority': 'animepahe.ru',
|
|
233
288
|
'accept': 'application/json, text/javascript, */*; q=0.01',
|
|
234
|
-
'Cookie':
|
|
235
|
-
'__ddg8_=t30Kk4WN3QXxGGeS; __ddg10_=1743778081; __ddg9_=103.123.226.218; __ddgid_=UyBX8L5x2N3PVwHQ; __ddgmark_=zzjwIU0XrzYhLZNA; __ddg2_=mYFJpxSZiwbzc2Lj; __ddg1_=dyfub1Uw7hUQG4jJhFzD; XSRF-TOKEN=eyJpdiI6Ii9qdkJOVkdIckU4c3pURnE4UGQwRGc9PSIsInZhbHVlIjoiWFd0L3hJaXA2MmZ4emtuSnFTWFNnemtPaHdwMmpISDkwV2VtVDJ5Tjl1VVFHNEd0aXlPNzRTTkZ4ZXRHUVliZzhWbng1cEV3MjgvMWFtekRETkRpY0pOTE9sNkM3enVVeGxGTExTRzlkZUhmZUtlZVAwRitOYVUvaGdBV0J1a04iLCJtYWMiOiI3OWEwZDZhZmQwMmJhYjZlZmU3MDFiN2EyM2E2ZDU2MjE0YTNhNWI3MGEwZTQzZDEzYTIyMGY4OTVhYWMzYzI0IiwidGFnIjoiIn0%3D; laravel_session=eyJpdiI6Im5jdVZKbjBpck56eEtlWEhzNVFGR0E9PSIsInZhbHVlIjoiWG42MjV4RmVFa1hNcVUvWFFaRDlQdmZsbU53UlMvRUFzL0padFRTcFhSYmhJaWJ5R3RheW11SElCcGl5NkRxUkMwdW8rUTFKMW5qblBRV2xHMmZXZHd3S3dMMExVTHVVamNwZk1IMkJIRmUwcjMrV0VXM2JEcWJZb2FOTXNmaWgiLCJtYWMiOiI3ODk4YWJkYjM0ZGVkZDYzNWUxNWQxMjFhOGZkYWQ3Yzc2ZmIzN2Q1MGUyMjcxMGQxNTU5YTNjNTU3MGE5YTRmIiwidGFnIjoiIn0%3D; latest=6081; res=1080; aud=jpn; av1=0',
|
|
236
289
|
'sec-ch-ua': '"Not A(Brand";v="99", "Microsoft Edge";v="121", "Chromium";v="121"',
|
|
237
290
|
'sec-ch-ua-mobile': '?0',
|
|
238
291
|
'sec-ch-ua-platform': '"Windows"',
|
|
@@ -240,10 +293,17 @@ class AnimePahe extends AnimeParser {
|
|
|
240
293
|
'sec-fetch-mode': 'cors',
|
|
241
294
|
'sec-fetch-site': 'same-origin',
|
|
242
295
|
'x-requested-with': 'XMLHttpRequest',
|
|
243
|
-
'Referer': `${this.baseUrl}
|
|
296
|
+
'Referer': sessionId ? `${this.baseUrl}/anime/${sessionId}` : `${this.baseUrl}`,
|
|
244
297
|
'user-agent':
|
|
245
298
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
|
|
246
299
|
};
|
|
300
|
+
|
|
301
|
+
if (this.ddgCookie) {
|
|
302
|
+
headers.Cookie =
|
|
303
|
+
typeof this.ddgCookie === 'object' && this.ddgCookie !== null ? this.ddgCookie.cookie : this.ddgCookie || '';
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return headers;
|
|
247
307
|
}
|
|
248
308
|
}
|
|
249
309
|
|