crextractor 1.3.3 → 1.3.5
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/crextractor.js +29 -9
- package/package.json +29 -20
package/crextractor.js
CHANGED
|
@@ -15,14 +15,23 @@ const downloadMobileApk = async () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const downloadTvApk = async () => {
|
|
18
|
+
const searchParams = new URLSearchParams();
|
|
19
|
+
searchParams.append('query', 'crunchyroll');
|
|
20
|
+
searchParams.append('cdn', 'web');
|
|
21
|
+
searchParams.append('q', 'bXlDUFU9YXJtNjQtdjhhLGFybWVhYmktdjdhLGFybWVhYmkmbGVhbmJhY2s9MA');
|
|
22
|
+
searchParams.append('aab', '1');
|
|
23
|
+
const searchUrl = `https://ws2-cache.aptoide.com/api/7/apps/search?${searchParams.toString()}`;
|
|
24
|
+
const searchResults = await fetch(searchUrl).then((r) => r.json());
|
|
25
|
+
const id = searchResults.datalist?.list?.[0]?.id;
|
|
26
|
+
if (!id) {
|
|
27
|
+
console.error('Unable to find ID for TV APK');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
18
30
|
const source = 'https://webservices.aptoide.com/webservices/3/getApkInfo';
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const response = await fetch(source, {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
body: formData,
|
|
25
|
-
});
|
|
31
|
+
const body = new FormData();
|
|
32
|
+
body.append('identif', `id:${id}`);
|
|
33
|
+
body.append('mode', 'json');
|
|
34
|
+
const response = await fetch(source, { method: 'POST', body });
|
|
26
35
|
const json = await response.json();
|
|
27
36
|
const url = json.apk.path;
|
|
28
37
|
const filepath = join(process.cwd(), 'crunchyroll.apk');
|
|
@@ -74,7 +83,15 @@ const parseCredentials = async (decompiledDir) => {
|
|
|
74
83
|
if (id && secret) return { id, secret };
|
|
75
84
|
}
|
|
76
85
|
|
|
77
|
-
const constantsPath = join(
|
|
86
|
+
const constantsPath = join(
|
|
87
|
+
decompiledDir,
|
|
88
|
+
'sources',
|
|
89
|
+
'com',
|
|
90
|
+
'crunchyroll',
|
|
91
|
+
'api',
|
|
92
|
+
'util',
|
|
93
|
+
'Constants.java',
|
|
94
|
+
);
|
|
78
95
|
const constants = await readFile(constantsPath, 'utf8');
|
|
79
96
|
return {
|
|
80
97
|
id: constants.split(' PROD_CLIENT_ID = "')[1].split('"')[0],
|
|
@@ -127,7 +144,10 @@ const extract = async ({ target = 'mobile', output, cleanup = false } = {}) => {
|
|
|
127
144
|
console.log(`Authorization: ${authorization}`);
|
|
128
145
|
|
|
129
146
|
if (output) {
|
|
130
|
-
await writeFile(
|
|
147
|
+
await writeFile(
|
|
148
|
+
output,
|
|
149
|
+
JSON.stringify({ version, id, secret, encoded, authorization }, null, 2),
|
|
150
|
+
);
|
|
131
151
|
}
|
|
132
152
|
|
|
133
153
|
return { version, id, secret, encoded, authorization };
|
package/package.json
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crextractor",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Utility for extracting credentials from the Crunchyroll Android app",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"crunchyroll"
|
|
7
|
+
],
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/vitalygashkov/crextractor/issues",
|
|
10
|
+
"email": "vitalygashkov@vk.com"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/vitalygashkov/crextractor.git"
|
|
17
|
+
},
|
|
18
|
+
"funding": [
|
|
19
|
+
{
|
|
20
|
+
"type": "individual",
|
|
21
|
+
"url": "https://t.me/tribute/app?startapp=dqW2"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
6
24
|
"bin": {
|
|
7
25
|
"crextractor": "bin/cli.js"
|
|
8
26
|
},
|
|
@@ -11,33 +29,24 @@
|
|
|
11
29
|
"crextractor.d.ts",
|
|
12
30
|
"crextractor.js"
|
|
13
31
|
],
|
|
14
|
-
"types": "crextractor.d.ts",
|
|
15
32
|
"type": "commonjs",
|
|
33
|
+
"main": "crextractor.js",
|
|
34
|
+
"types": "crextractor.d.ts",
|
|
16
35
|
"scripts": {
|
|
17
36
|
"start": "node bin/cli.js",
|
|
18
37
|
"extract:mobile": "node bin/cli.js --target mobile --output ./credentials.mobile.json",
|
|
19
38
|
"extract:tv": "node bin/cli.js --target tv --output ./credentials.tv.json",
|
|
20
39
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
40
|
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
"crunchyroll"
|
|
24
|
-
],
|
|
25
|
-
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"readmeFilename": "README.md",
|
|
28
|
-
"funding": [
|
|
29
|
-
{
|
|
30
|
-
"type": "individual",
|
|
31
|
-
"url": "https://t.me/tribute/app?startapp=dqW2"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=20"
|
|
36
|
-
},
|
|
37
41
|
"dependencies": {
|
|
38
42
|
"molnia": "^0.1.7"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
|
|
45
|
+
"oxfmt": "^0.28.0",
|
|
46
|
+
"typescript": "^5.9.3"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=22"
|
|
50
|
+
},
|
|
51
|
+
"readmeFilename": "README.md"
|
|
43
52
|
}
|