86 Commits
Author SHA1 Message Date
vitalygashkovandgithub-actions[bot] 0053b334fb Apply automatic changes 2026-07-01 07:42:20 +00:00
Vitaly Gashkov 7a973b7168 Merge branch 'main' of https://github.com/vitalygashkov/crextractor 2026-06-21 13:40:02 +05:00
Vitaly Gashkov 97e528b715 chore: set cron to run job every month instead of every week 2026-06-21 13:40:01 +05:00
vitalygashkovandgithub-actions[bot] 743f40d218 Apply automatic changes 2026-06-13 07:17:44 +00:00
Vitaly Gashkov 2c080d1c90 Merge branch 'main' of https://github.com/vitalygashkov/crextractor 2026-04-29 17:30:47 +05:00
Vitaly Gashkov b889090c03 update FUNDING.yml 2026-04-29 17:30:13 +05:00
vitalygashkovandgithub-actions[bot] 010bcbd2b8 Apply automatic changes 2026-04-25 07:06:09 +00:00
vitalygashkovandgithub-actions[bot] 6de5ae7740 Apply automatic changes 2026-04-04 06:52:16 +00:00
vitalygashkovandgithub-actions[bot] 067ee0b7de Apply automatic changes 2026-03-21 06:34:23 +00:00
vitalygashkovandgithub-actions[bot] 9e331b05c7 Apply automatic changes 2026-03-14 06:37:26 +00:00
vitalygashkovandgithub-actions[bot] 523fef223c Apply automatic changes 2026-03-07 06:30:28 +00:00
Vitaly Gashkov 68b61b3dd2 1.4.0 2026-02-15 17:44:58 +05:00
Vitaly Gashkov 49b208c9ec refactor: migrate to esm 2026-02-15 17:44:53 +05:00
Vitaly Gashkov 0372c520b0 chore: update README 2026-02-15 16:50:05 +05:00
vitalygashkovandgithub-actions[bot] 41694bb0b9 Apply automatic changes 2026-02-15 11:38:02 +00:00
Vitaly Gashkov 6d2019cec7 fix: add executable permissions for jadx 2026-02-15 16:35:15 +05:00
Vitaly Gashkov 9dec6c95a4 fix: create release only if ref is tag 2026-02-08 14:17:30 +05:00
Vitaly Gashkov 4175a41b73 chore: add repo url to package.json 2026-02-08 14:15:13 +05:00
Vitaly Gashkov ebad84b4e7 chore: add repo url to package.json 2026-02-08 14:15:00 +05:00
Vitaly Gashkov e7e1e3df4f fix: install new npm to support trusted publishers 2026-02-08 14:12:59 +05:00
Vitaly Gashkov d8f8586045 fix: add id-token permission to publish workflow 2026-02-08 14:08:12 +05:00
Vitaly Gashkov b42a8d29dc chore: allow run workflow manually 2026-02-08 14:06:27 +05:00
Vitaly Gashkov fc11a30c73 chore: remove npm token from workflow env 2026-02-08 14:03:52 +05:00
Vitaly Gashkov 4264727c33 1.3.5 2026-02-08 14:01:29 +05:00
Vitaly Gashkov c6ec34ca8b chore: add formatter 2026-02-08 14:01:20 +05:00
Vitaly Gashkov 3297dce797 fix: search tv app id instead of hardcoding 2026-02-08 14:00:56 +05:00
vitalygashkovandgithub-actions[bot] ae1e4c97d7 Apply automatic changes 2026-01-13 14:54:29 +00:00
Vitaly Gashkov f5d2233d68 Merge branch 'main' of https://github.com/vitalygashkov/crunchys 2026-01-13 19:51:36 +05:00
Vitaly Gashkov 196a1cad1d fix: update crunchyroll tv app id 2026-01-13 19:51:30 +05:00
vitalygashkovandgithub-actions[bot] 00408ad8e8 Apply automatic changes 2025-11-22 06:18:19 +00:00
vitalygashkovandgithub-actions[bot] 4e5a0d1561 Apply automatic changes 2025-11-04 14:52:19 +00:00
Vitaly Gashkov cbdde54471 1.3.4 2025-11-04 19:49:27 +05:00
Vitaly Gashkov 777eb4ee2b fix: update tv app id 2025-11-04 19:48:37 +05:00
Vitaly Gashkov b2c672dfa6 1.3.3 2025-10-25 12:14:11 +05:00
Vitaly Gashkov 828f4fa1d5 fix: correct checking for downloaded apk 2025-10-25 12:13:35 +05:00
Vitaly Gashkov 8275aff35e 1.3.2 2025-10-25 12:09:17 +05:00
Vitaly Gashkov 1d8596b8c9 chore: update deps 2025-10-25 12:09:12 +05:00
Vitaly Gashkov 8658934ebe Merge branch 'main' of https://github.com/vitalygashkov/crunchys 2025-10-25 12:04:16 +05:00
Vitaly Gashkov 96e77102e3 fix: skip process if downloaded apk not found 2025-10-25 12:03:59 +05:00
vitalygashkovandgithub-actions[bot] 673c276c9a Apply automatic changes 2025-10-11 06:17:25 +00:00
vitalygashkovandgithub-actions[bot] ed80f46a45 Apply automatic changes 2025-10-04 06:17:15 +00:00
vitalygashkovandgithub-actions[bot] e8468cafe9 Apply automatic changes 2025-09-27 06:17:10 +00:00
Vitaly Gashkov 50d84b208c 1.3.1 2025-09-20 22:19:07 +05:00
Vitaly Gashkov 3ed2207eaa chore: update tv credentials 2025-09-20 22:17:18 +05:00
Vitaly Gashkov 980278acb9 Merge branch 'main' of https://github.com/vitalygashkov/crunchys 2025-09-20 22:17:01 +05:00
Vitaly Gashkov 485d330af2 fix: update source for tv apk 2025-09-20 22:16:34 +05:00
vitalygashkovandgithub-actions[bot] 50f77e0e7a Apply automatic changes 2025-09-13 06:16:25 +00:00
Vitaly Gashkov 00ba683170 chore: update tv credentials manually 2025-09-06 22:04:12 +05:00
Vitaly Gashkov d979333e13 update workflow 2025-09-01 13:03:24 +05:00
Vitaly Gashkov 1908ba60f5 update workflow 2025-09-01 12:59:48 +05:00
Vitaly Gashkov 45ab0a6085 update workflow 2025-09-01 12:54:30 +05:00
Vitaly Gashkov 17e9adf3b2 update workflow 2025-09-01 12:48:03 +05:00
Vitaly Gashkov 99d07dc063 update workflow 2025-09-01 12:46:35 +05:00
Vitaly Gashkov c7a72f06a2 update workflow 2025-09-01 12:44:19 +05:00
Vitaly Gashkov 2ac5d94eb8 update workflow 2025-09-01 12:38:24 +05:00
Vitaly Gashkov f2db789e75 update workflow 2025-09-01 12:36:22 +05:00
Vitaly Gashkov a00b53007f update workflow 2025-09-01 12:34:13 +05:00
Vitaly Gashkov 38ac098adb update workflow 2025-09-01 12:29:22 +05:00
Vitaly Gashkov 5240fe25d5 fix 2 2025-09-01 12:22:58 +05:00
Vitaly Gashkov 50267e58a6 fix 2025-09-01 12:21:10 +05:00
Vitaly Gashkov 06e004b173 update gitignore 2025-08-26 19:10:31 +05:00
Vitaly Gashkov 778dcc8098 1.3.0 2025-08-26 12:22:37 +05:00
Vitaly Gashkov 6fee13a6c9 update README 2025-08-26 12:22:32 +05:00
Vitaly Gashkov 03c74c53a3 fix: improve types 2025-08-26 12:22:10 +05:00
Vitaly Gashkov 6152873a50 feat: add pull to fetch credentials from json in repo 2025-08-26 12:21:50 +05:00
Vitaly Gashkov 096da33282 fix(workflow): allow to write files to the repo 2025-08-25 23:00:37 +05:00
Vitaly Gashkov c589d1d6da update README 2025-08-25 22:59:34 +05:00
Vitaly Gashkov 8550298dd1 feat: add workflow with schedule to run credentials extracting every week 2025-08-25 22:56:39 +05:00
Vitaly Gashkov 9e4306408a update README 2025-08-24 10:43:44 +05:00
Vitaly Gashkov dbdbe38471 update README 2025-08-24 10:42:03 +05:00
Vitaly Gashkov 8abe8eb654 update README 2025-08-24 10:40:33 +05:00
Vitaly Gashkov c286e2b501 update README 2025-08-24 10:40:11 +05:00
Vitaly Gashkov 99f5efca66 fix: remove build step 2025-08-24 10:32:03 +05:00
Vitaly Gashkov 41b71bffb5 1.2.1 2025-08-24 10:30:22 +05:00
Vitaly Gashkov 94be27e20f build: add publish workflow 2025-08-24 10:29:26 +05:00
Vitaly Gashkov d03e9cadeb fix: change mobile apk source 2025-08-24 10:26:32 +05:00
Vitaly Gashkov eba50dccd0 chore: add extract scripts to package.json 2025-08-24 10:26:19 +05:00
Vitaly Gashkov 345dcd1e3b fix: cleanup by default 2025-08-24 10:26:02 +05:00
Vitaly Gashkov 451eaa54eb 1.2.0 2025-08-23 23:49:51 +05:00
Vitaly Gashkov 9a9b713682 update static credentials 2025-08-23 23:49:42 +05:00
Vitaly Gashkov 163993824a update README 2025-08-23 23:49:21 +05:00
Vitaly Gashkov 34b033ef57 update gitignore 2025-08-23 23:49:15 +05:00
Vitaly Gashkov 9c96d6f696 feat: support Android TV app 2025-08-23 23:49:07 +05:00
Vitaly Gashkov 9f53d6af9c update README 2025-08-23 21:38:36 +05:00
Vitaly Gashkov 6acf203edb update README 2025-08-23 21:28:46 +05:00
Vitaly Gashkov 2cd3fddd77 update package.json 2025-08-23 21:27:17 +05:00
14 changed files with 522 additions and 105 deletions
+2
View File
@@ -0,0 +1,2 @@
ko_fi: vitalygashkov
custom: [ "pay.cloudtips.ru/p/e04763eb" ]
+41
View File
@@ -0,0 +1,41 @@
name: Extract
on:
workflow_dispatch:
schedule:
- cron: '0 6 1 * *' # Runs monthly on the 1st day at 06:00 UTC
jobs:
extract:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Install JADX
run: |
JADX_VERSION=$(curl -s "https://api.github.com/repos/skylot/jadx/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
echo "Installing JADX version ${JADX_VERSION}..."
curl -Lo jadx.zip "https://github.com/skylot/jadx/releases/download/v${JADX_VERSION}/jadx-${JADX_VERSION}.zip"
unzip -q jadx.zip -d jadx-dist
chmod +x jadx-dist/bin/jadx
echo "$(pwd)/jadx-dist/bin" >> $GITHUB_PATH
rm jadx.zip
- name: Install dependencies
run: npm install
- name: Extract app credentials
run: npm run extract:mobile && npm run extract:tv
- uses: stefanzweifel/git-auto-commit-action@v5
+51
View File
@@ -0,0 +1,51 @@
name: Publish
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
id-token: write
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
registry-url: https://registry.npmjs.org/
- run: npm install -g npm@latest
- run: npm ci
- run: npm run build --if-present
- name: Parse version and determine release channel
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT
if [[ $VERSION == *"-alpha."* ]]; then
echo "NPM_TAG=alpha" >> $GITHUB_OUTPUT
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
elif [[ $VERSION == *"-beta."* ]]; then
echo "NPM_TAG=beta" >> $GITHUB_OUTPUT
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
else
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
fi
- name: Publish new version
run: npm publish --tag ${{ steps.version.outputs.NPM_TAG }}
- name: Create release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
generate_release_notes: true
prerelease: ${{ steps.version.outputs.PRERELEASE == 'true' }}
token: ${{ secrets.GITHUB_TOKEN }}
+5
View File
@@ -1,2 +1,7 @@
/node_modules
.DS_Store
/jadx-dist
/jadx.zip
/crunchyroll
crunchyroll.apk
crunchyroll.xapk
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "all",
"tabWidth": 2,
"useTabs": false,
"semi": true,
"ignorePatterns": []
}
+45 -24
View File
@@ -1,37 +1,58 @@
# Crextractor
Utility for extracting secrets from Crunchyroll mobile app
Utility for extracting credentials from the Crunchyroll Android app (both TV and mobile versions).
## Prerequisites
The [credentials](https://github.com/vitalygashkov/crextractor/blob/main/credentials.tv.json) are [automatically](https://github.com/vitalygashkov/crextractor/actions/workflows/extract.yml) updated once a month (if there are any changes).
## Usage
### Fetch ready credentials from this GitHub repository
```js
// Supported targets: mobile, tv
async function fetchCredentials(target = 'tv') {
const url = `https://raw.githubusercontent.com/vitalygashkov/crextractor/refs/heads/main/credentials.${target}.json`;
return fetch(url).then((response) => response.json());
}
async function main() {
const credentials = fetchCredentials();
// You can use credentials to obtain access tokens for Crunchyroll APIs
// 3.54.5 (22304) -> 3.54.5_22304
const userAgentAppVersion = credentials.version
.replace(' ', '_')
.replace('(', '')
.replace(')', '');
const response = await fetch('https://beta-api.crunchyroll.com/auth/v1/token', {
headers: {
// Ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs
Authorization: credentials.authorization,
'User-Agent': `Crunchyroll/ANDROIDTV/${userAgentAppVersion} (Android 16; en-US; sdk_gphone64_x86_64)`,
// ...
},
method: 'POST',
body: JSON.stringify({
// ...
}),
});
}
```
### Extract fresh credentials from the latest APK using jadx
#### Prerequisites
- [Node.js](https://nodejs.org/en)
- [jadx](https://github.com/skylot/jadx)
## Installation
```bash
npm i crextractor
npx crextractor --target mobile --output ./credentials.mobile.json
```
## Usage
#### Library
```js
import { extractSecrets } from 'crextractor';
const { id, secret, encoded, header } = await extractSecrets();
// Do something with the extracted secrets
```
#### Command-line interface
```bash
npx crextractor
```
> Results will be printed to the console and saved to `secrets.json` file
> Results will be printed to the console and saved to `credentials.mobile.json` file. By default, the target is TV, but you can change it with `--target mobile` option.
## License
+23 -2
View File
@@ -1,5 +1,26 @@
#!/usr/bin/env node
const { extractSecrets } = require('../crextractor');
import { parseArgs } from 'node:util';
import { extract } from '../crextractor.js';
extractSecrets({ output: 'secrets.json' });
const args = parseArgs({
options: {
target: {
type: 'string',
default: 'tv',
},
output: {
type: 'string',
},
cleanup: {
type: 'boolean',
default: true,
},
},
});
extract({
target: args.values.target,
output: args.values.output ?? (args.values.target === 'tv' ? 'credentials.tv.json' : 'credentials.mobile.json'),
cleanup: args.values.cleanup,
});
+7
View File
@@ -0,0 +1,7 @@
{
"version": "3.103.2 (1086)",
"id": "cisobxghnlkmdsjohfjo",
"secret": "aWHXDdm951ZE47r0tTu4zJjzh84LyEaF",
"encoded": "Y2lzb2J4Z2hubGttZHNqb2hmam86YVdIWERkbTk1MVpFNDdyMHRUdTR6Smp6aDg0THlFYUY=",
"authorization": "Basic Y2lzb2J4Z2hubGttZHNqb2hmam86YVdIWERkbTk1MVpFNDdyMHRUdTR6Smp6aDg0THlFYUY="
}
+7
View File
@@ -0,0 +1,7 @@
{
"version": "3.66.1 (22349)",
"id": "mc240ce75w7nbdhbb0q6",
"secret": "EcysbbWdXo1R0WWCTE55DPlZnwW4-O5b",
"encoded": "bWMyNDBjZTc1dzduYmRoYmIwcTY6RWN5c2JiV2RYbzFSMFdXQ1RFNTVEUGxabndXNC1PNWI=",
"authorization": "Basic bWMyNDBjZTc1dzduYmRoYmIwcTY6RWN5c2JiV2RYbzFSMFdXQ1RFNTVEUGxabndXNC1PNWI="
}
+17 -3
View File
@@ -1,10 +1,24 @@
export function extractSecrets(): Promise<{
export type CrunchyrollAppCredentials = {
// Crunchyroll app ID
id: string;
// Crunchyroll app secret
secret: string;
// Base64 encoded `id:secret` string
encoded: string;
// HTTP header with Basic Authorization to access Crunchyroll mobile APIs
// Ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs
authorization: string;
}>;
};
/**
* Extract credentials from the Crunchyroll Android APK using jadx.
*/
export function extract(options?: {
target?: 'mobile' | 'tv';
output?: string;
cleanup?: boolean;
}): Promise<CrunchyrollAppCredentials>;
/**
* Fetch ready credentials from the GitHub repository.
*/
export function pull(options?: { target: 'mobile' | 'tv' }): Promise<CrunchyrollAppCredentials>;
+108 -39
View File
@@ -1,15 +1,40 @@
const { execSync } = require('node:child_process');
const { join } = require('node:path');
const { readdir, readFile, writeFile, rm } = require('node:fs/promises');
const { download } = require('molnia');
import { execSync } from 'node:child_process';
import { join } from 'node:path';
import { readdir, readFile, writeFile, rm } from 'node:fs/promises';
import { existsSync } from 'node:fs';
import { download } from 'molnia';
const downloadLatestApk = async () => {
const source = 'https://apkcombo.com/crunchyroll/com.crunchyroll.crunchyroid/download/apk';
const page = await fetch(source);
const html = await page.text();
const route = '/r2' + html.split('/r2')[1]?.split('"')[0];
const url = `https://apkcombo.com${route}`;
const filepath = join(process.cwd(), 'crunchyroll.xapk');
const downloadMobileApk = async () => {
const url = 'https://api.qqaoop.com/v11/apps/com.crunchyroll.crunchyroid/download?userId=1';
const filepath = join(process.cwd(), 'crunchyroll.apk');
await download(url, {
output: filepath,
onError: (error) => console.error(error),
});
return filepath;
};
const downloadTvApk = async () => {
const searchParams = new URLSearchParams();
searchParams.append('query', 'crunchyroll');
searchParams.append('cdn', 'web');
searchParams.append('q', 'bXlDUFU9YXJtNjQtdjhhLGFybWVhYmktdjdhLGFybWVhYmkmbGVhbmJhY2s9MA');
searchParams.append('aab', '1');
const searchUrl = `https://ws2-cache.aptoide.com/api/7/apps/search?${searchParams.toString()}`;
const searchResults = await fetch(searchUrl).then((r) => r.json());
const id = searchResults.datalist?.list?.[0]?.id;
if (!id) {
console.error('Unable to find ID for TV APK');
return;
}
const source = 'https://webservices.aptoide.com/webservices/3/getApkInfo';
const body = new FormData();
body.append('identif', `id:${id}`);
body.append('mode', 'json');
const response = await fetch(source, { method: 'POST', body });
const json = await response.json();
const url = json.apk.path;
const filepath = join(process.cwd(), 'crunchyroll.apk');
await download(url, {
output: filepath,
onError: (error) => console.error(error),
@@ -21,7 +46,7 @@ const decompileApk = (apkPath) => {
try {
execSync(`jadx ${apkPath}`, { stdio: 'inherit' });
} catch (error) {}
return apkPath.replace('.xapk', '');
return apkPath.replace('.xapk', '').replace('.apk', '');
};
const findConfigurationImpl = async (sourcesDir) => {
@@ -41,38 +66,73 @@ const findConfigurationImpl = async (sourcesDir) => {
}
};
const parseSecrets = (contents) => {
const lines = contents.split('\n');
const startIndex = lines.findIndex((line) => line.includes('https://sso.crunchyroll.com'));
const endIndex = lines.findIndex((line) => line.includes('CR-AndroidMobile-SSAI-Prod'));
const results = lines
.slice(startIndex, endIndex)
.map((line) => line.replaceAll(';', ''))
.map((line) => line.replaceAll('"', ''))
.map((line) => line.split('= ')[1])
.map((line) => line.trim());
const [, , id, secret] = results;
const encoded = Buffer.from(`${id}:${secret}`).toString('base64');
const authorization = `Basic ${encoded}`;
return { id, secret, encoded, authorization };
const parseCredentials = async (decompiledDir) => {
const sourcesDir = join(decompiledDir, 'sources');
const configurationImpl = await findConfigurationImpl(sourcesDir);
if (configurationImpl) {
const lines = configurationImpl.split('\n');
const startIndex = lines.findIndex((line) => line.includes('https://sso.crunchyroll.com'));
const endIndex = lines.findIndex((line) => line.includes('CR-AndroidMobile-SSAI-Prod'));
const results = lines
.slice(startIndex, endIndex)
.map((line) => line.replaceAll(';', ''))
.map((line) => line.replaceAll('"', ''))
.map((line) => line.split('= ')[1])
.map((line) => line.trim());
const [, , id, secret] = results;
if (id && secret) return { id, secret };
}
const constantsPath = join(
decompiledDir,
'sources',
'com',
'crunchyroll',
'api',
'util',
'Constants.java',
);
const constants = await readFile(constantsPath, 'utf8');
return {
id: constants.split(' PROD_CLIENT_ID = "')[1].split('"')[0],
secret: constants.split(' PROD_CLIENT_SECRET = "')[1].split('"')[0],
};
};
const extractSecrets = async ({ output, cleanup = true } = {}) => {
console.log('Downloading latest APK...');
const apkPath = await downloadLatestApk();
const parseVersion = async (decompiledDir) => {
const manifestJsonPath = join(decompiledDir, 'resources', 'manifest.json');
const manifestXmlPath = join(decompiledDir, 'resources', 'AndroidManifest.xml');
if (existsSync(manifestJsonPath)) {
const manifestContent = await readFile(manifestJsonPath, 'utf8');
const manifest = JSON.parse(manifestContent);
const version = `${manifest.version_name} (${manifest.version_code})`;
return version;
} else if (existsSync(manifestXmlPath)) {
const manifest = await readFile(manifestXmlPath, 'utf8');
const version = `${manifest.match(/versionName="([^"]+)"/)[1]} (${manifest.match(/versionCode="([^"]+)"/)[1]})`;
return version;
}
};
const extract = async ({ target = 'mobile', output, cleanup = false } = {}) => {
console.log('Downloading APK...');
const apkPath = target === 'tv' ? await downloadTvApk() : await downloadMobileApk();
if (!existsSync(apkPath)) {
console.error('Unable to find APK (possibly a download error)');
return;
}
console.log('Decompiling APK...');
const decompiledDir = decompileApk(apkPath);
console.log('Searching for secrets...');
const sourcesDir = join(decompiledDir, 'sources');
const manifest = require(join(decompiledDir, 'resources', 'manifest.json'));
const version = manifest.version_name;
const configurationImpl = await findConfigurationImpl(sourcesDir);
if (!configurationImpl) throw new Error('Could not find ConfigurationImpl.kt');
console.log('Parsing version...');
const version = await parseVersion(decompiledDir);
console.log('Parsing secrets...');
const { id, secret, encoded, authorization } = parseSecrets(configurationImpl);
console.log('Parsing credentials...');
const { id, secret } = await parseCredentials(decompiledDir);
const encoded = Buffer.from(`${id}:${secret}`).toString('base64');
const authorization = `Basic ${encoded}`;
console.log(`Cleaning up files...`);
if (cleanup) await rm(apkPath, { recursive: true, force: true });
@@ -85,10 +145,19 @@ const extractSecrets = async ({ output, cleanup = true } = {}) => {
console.log(`Authorization: ${authorization}`);
if (output) {
await writeFile(output, JSON.stringify({ version, id, secret, encoded, authorization }, null, 2));
await writeFile(
output,
JSON.stringify({ version, id, secret, encoded, authorization }, null, 2),
);
}
return { version, id, secret, encoded, authorization };
};
module.exports = { extractSecrets };
const pull = async ({ target = 'mobile' } = {}) => {
const url = `https://raw.githubusercontent.com/vitalygashkov/crextractor/refs/heads/main/credentials.${target}.json`;
const credentials = await fetch(url).then((response) => response.json());
return credentials;
};
export { extract, pull };
+163 -11
View File
@@ -1,12 +1,12 @@
{
"name": "crextractor",
"version": "1.1.0",
"version": "1.4.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "crextractor",
"version": "1.1.0",
"version": "1.4.0",
"funding": [
{
"type": "individual",
@@ -15,18 +15,131 @@
],
"license": "MIT",
"dependencies": {
"molnia": "^0.1.5"
"molnia": "^0.1.7"
},
"bin": {
"crextractor": "bin/cli.js"
},
"devDependencies": {
"typescript": "^5.9.2"
"oxfmt": "^0.28.0",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=20"
"node": ">=24"
}
},
"node_modules/@oxfmt/darwin-arm64": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/darwin-arm64/-/darwin-arm64-0.28.0.tgz",
"integrity": "sha512-jmUfF7cNJPw57bEK7sMIqrYRgn4LH428tSgtgLTCtjuGuu1ShREyrkeB7y8HtkXRfhBs4lVY+HMLhqElJvZ6ww==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@oxfmt/darwin-x64": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/darwin-x64/-/darwin-x64-0.28.0.tgz",
"integrity": "sha512-S6vlV8S7jbjzJOSjfVg2CimUC0r7/aHDLdUm/3+/B/SU/s1jV7ivqWkMv1/8EB43d1BBwT9JQ60ZMTkBqeXSFA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@oxfmt/linux-arm64-gnu": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/linux-arm64-gnu/-/linux-arm64-gnu-0.28.0.tgz",
"integrity": "sha512-TfJkMZjePbLiskmxFXVAbGI/OZtD+y+fwS0wyW8O6DWG0ARTf0AipY9zGwGoOdpFuXOJceXvN4SHGLbYNDMY4Q==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oxfmt/linux-arm64-musl": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/linux-arm64-musl/-/linux-arm64-musl-0.28.0.tgz",
"integrity": "sha512-7fyQUdW203v4WWGr1T3jwTz4L7KX9y5DeATryQ6fLT6QQp9GEuct8/k0lYhd+ys42iTV/IkJF20e3YkfSOOILg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oxfmt/linux-x64-gnu": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/linux-x64-gnu/-/linux-x64-gnu-0.28.0.tgz",
"integrity": "sha512-sRKqAvEonuz0qr1X1ncUZceOBJerKzkO2gZIZmosvy/JmqyffpIFL3OE2tqacFkeDhrC+dNYQpusO8zsfHo3pw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oxfmt/linux-x64-musl": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/linux-x64-musl/-/linux-x64-musl-0.28.0.tgz",
"integrity": "sha512-fW6czbXutX/tdQe8j4nSIgkUox9RXqjyxwyWXUDItpoDkoXllq17qbD7GVc0whrEhYQC6hFE1UEAcDypLJoSzw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oxfmt/win32-arm64": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/win32-arm64/-/win32-arm64-0.28.0.tgz",
"integrity": "sha512-D/HDeQBAQRjTbD9OLV6kRDcStrIfO+JsUODDCdGmhRfNX8LPCx95GpfyybpZfn3wVF8Jq/yjPXV1xLkQ+s7RcA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@oxfmt/win32-x64": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/@oxfmt/win32-x64/-/win32-x64-0.28.0.tgz",
"integrity": "sha512-4+S2j4OxOIyo8dz5osm5dZuL0yVmxXvtmNdHB5xyGwAWVvyWNvf7tCaQD7w2fdSsAXQLOvK7KFQrHFe33nJUCA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/fastq": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
@@ -37,9 +150,9 @@
}
},
"node_modules/molnia": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/molnia/-/molnia-0.1.5.tgz",
"integrity": "sha512-Kb3bhlvNVWJ9Z8tGZGkhmChpXQY8OLFPkxXFvLJb+foLwfH7JyyJl+DbKuUKAIK1vnxs5sBFuQb3wxOIwWBpiA==",
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/molnia/-/molnia-0.1.7.tgz",
"integrity": "sha512-wCezzcu2sRybrJb9ltrBEWwzO9NU2DRgxZw5Gr1g2QrnwrNo+olE3cAiD3Q1Y76rCde1qXBUmEuZ13aKXew+AQ==",
"funding": [
{
"type": "individual",
@@ -58,6 +171,35 @@
"node": ">=20"
}
},
"node_modules/oxfmt": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.28.0.tgz",
"integrity": "sha512-3+hhBqPE6Kp22KfJmnstrZbl+KdOVSEu1V0ABaFIg1rYLtrMgrupx9znnHgHLqKxAVHebjTdiCJDk30CXOt6cw==",
"dev": true,
"license": "MIT",
"dependencies": {
"tinypool": "2.1.0"
},
"bin": {
"oxfmt": "bin/oxfmt"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
},
"funding": {
"url": "https://github.com/sponsors/Boshen"
},
"optionalDependencies": {
"@oxfmt/darwin-arm64": "0.28.0",
"@oxfmt/darwin-x64": "0.28.0",
"@oxfmt/linux-arm64-gnu": "0.28.0",
"@oxfmt/linux-arm64-musl": "0.28.0",
"@oxfmt/linux-x64-gnu": "0.28.0",
"@oxfmt/linux-x64-musl": "0.28.0",
"@oxfmt/win32-arm64": "0.28.0",
"@oxfmt/win32-x64": "0.28.0"
}
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
@@ -68,10 +210,20 @@
"node": ">=0.10.0"
}
},
"node_modules/tinypool": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz",
"integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^20.0.0 || >=22.0.0"
}
},
"node_modules/typescript": {
"version": "5.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
+42 -19
View File
@@ -1,36 +1,59 @@
{
"name": "crextractor",
"version": "1.1.0",
"description": "Utility for extracting secrets from Crunchyroll mobile app",
"main": "crextractor.js",
"bin": {
"crextractor": "bin/cli.js"
},
"types": "crextractor.d.ts",
"type": "commonjs",
"scripts": {
"start": "node bin/cli.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.4.0",
"description": "Utility for extracting credentials from the Crunchyroll Android app",
"keywords": [
"crunchyroll"
],
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
"bugs": {
"url": "https://github.com/vitalygashkov/crextractor/issues",
"email": "vitalygashkov@vk.com"
},
"license": "MIT",
"readmeFilename": "README.md",
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/vitalygashkov/crextractor.git"
},
"funding": [
{
"type": "individual",
"url": "https://t.me/tribute/app?startapp=dqW2"
}
],
"engines": {
"node": ">=20"
"bin": {
"crextractor": "bin/cli.js"
},
"files": [
"bin",
"crextractor.d.ts",
"crextractor.js"
],
"type": "module",
"main": "crextractor.js",
"types": "crextractor.d.ts",
"exports": {
".": {
"types": "./crextractor.d.ts",
"import": "./crextractor.js",
"require": "./crextractor.js"
}
},
"scripts": {
"start": "node bin/cli.js",
"extract:mobile": "node bin/cli.js --target mobile --output ./credentials.mobile.json",
"extract:tv": "node bin/cli.js --target tv --output ./credentials.tv.json",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"molnia": "^0.1.5"
"molnia": "^0.1.7"
},
"devDependencies": {
"typescript": "^5.9.2"
}
"oxfmt": "^0.28.0",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=24"
},
"readmeFilename": "README.md"
}
-7
View File
@@ -1,7 +0,0 @@
{
"version": "3.89.1",
"id": "rybm7nqzc5zfynw7ayef",
"secret": "luDwBZArJNnVnGTJLuoXZufy5czXMWgr",
"encoded": "cnlibTducXpjNXpmeW53N2F5ZWY6bHVEd0JaQXJKTm5WbkdUSkx1b1hadWZ5NWN6WE1XZ3I=",
"authorization": "Basic cnlibTducXpjNXpmeW53N2F5ZWY6bHVEd0JaQXJKTm5WbkdUSkx1b1hadWZ5NWN6WE1XZ3I="
}