23 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
10 changed files with 99 additions and 91 deletions
+2 -1
View File
@@ -1 +1,2 @@
custom: ['t.me/tribute/app?startapp=dqW2'] ko_fi: vitalygashkov
custom: [ "pay.cloudtips.ru/p/e04763eb" ]
+3 -2
View File
@@ -3,7 +3,7 @@ name: Extract
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '0 6 * * 6' # Runs every Saturday at 06:00 UTC - cron: '0 6 1 * *' # Runs monthly on the 1st day at 06:00 UTC
jobs: jobs:
extract: extract:
@@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 22 node-version-file: 'package.json'
- uses: actions/setup-java@v4 - uses: actions/setup-java@v4
with: with:
java-version: '21' java-version: '21'
@@ -28,6 +28,7 @@ jobs:
echo "Installing JADX version ${JADX_VERSION}..." echo "Installing JADX version ${JADX_VERSION}..."
curl -Lo jadx.zip "https://github.com/skylot/jadx/releases/download/v${JADX_VERSION}/jadx-${JADX_VERSION}.zip" 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 unzip -q jadx.zip -d jadx-dist
chmod +x jadx-dist/bin/jadx
echo "$(pwd)/jadx-dist/bin" >> $GITHUB_PATH echo "$(pwd)/jadx-dist/bin" >> $GITHUB_PATH
rm jadx.zip rm jadx.zip
+14 -14
View File
@@ -1,22 +1,28 @@
name: Publish name: Publish
on: on:
workflow_dispatch:
push: push:
tags: tags:
- 'v*' - "v*"
permissions:
id-token: write
contents: write
jobs: jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version: 22 node-version-file: 'package.json'
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
- run: npm install -g npm@latest
- run: npm ci - run: npm ci
- run: npm run build --if-present
# Extract version from package.json and determine release channel
- name: Parse version and determine release channel - name: Parse version and determine release channel
id: version id: version
run: | run: |
@@ -33,19 +39,13 @@ jobs:
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
fi fi
# Publish with the appropriate tag - name: Publish new version
- name: Publish to npm
run: npm publish --tag ${{ steps.version.outputs.NPM_TAG }} run: npm publish --tag ${{ steps.version.outputs.NPM_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Only create GitHub releases for stable versions - name: Create release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with: with:
generate_release_notes: true generate_release_notes: true
prerelease: ${{ steps.version.outputs.PRERELEASE == 'true' }} prerelease: ${{ steps.version.outputs.PRERELEASE == 'true' }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
+23 -33
View File
@@ -2,34 +2,35 @@
Utility for extracting credentials from the Crunchyroll Android app (both TV and mobile versions). Utility for extracting credentials from the Crunchyroll Android app (both TV and mobile versions).
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 week (if there are any changes). 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).
## Prerequisites
- [Node.js](https://nodejs.org/en)
- [jadx](https://github.com/skylot/jadx)
## Usage ## Usage
### Library ### Fetch ready credentials from this GitHub repository
```bash
npm i crextractor
```
#### Fetch ready credentials from this GitHub repository
```js ```js
import { pull } from 'crextractor'; // 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() { async function main() {
const credentials = await pull('tv'); 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(')', '');
// You can use the extracted credentials to obtain access tokens for Crunchyroll APIs
const response = await fetch('https://beta-api.crunchyroll.com/auth/v1/token', { const response = await fetch('https://beta-api.crunchyroll.com/auth/v1/token', {
headers: { headers: {
Authorization: credentials.authorization, // Ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs // Ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs
'User-Agent': 'Crunchyroll/ANDROIDTV/3.42.1_22267 (Android 16; en-US; sdk_gphone64_x86_64)', Authorization: credentials.authorization,
'User-Agent': `Crunchyroll/ANDROIDTV/${userAgentAppVersion} (Android 16; en-US; sdk_gphone64_x86_64)`,
// ... // ...
}, },
method: 'POST', method: 'POST',
@@ -40,23 +41,12 @@ async function main() {
} }
``` ```
#### Extract credentials from the latest APK using jadx ### Extract fresh credentials from the latest APK using jadx
```js #### Prerequisites
import { extract } from 'crextractor';
async function main() { - [Node.js](https://nodejs.org/en)
const { id, secret, encoded, authorization } = await extract(); - [jadx](https://github.com/skylot/jadx)
// id - Crunchyroll app ID
// secret - Crunchyroll app secret
// encoded - Base64 encoded `id:secret` string
// authorization - ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs
// Do something with the extracted credentials
}
```
### Command-line interface
```bash ```bash
npx crextractor --target mobile --output ./credentials.mobile.json npx crextractor --target mobile --output ./credentials.mobile.json
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env node #!/usr/bin/env node
const { parseArgs } = require('node:util'); import { parseArgs } from 'node:util';
const { extract } = require('../crextractor'); import { extract } from '../crextractor.js';
const args = parseArgs({ const args = parseArgs({
options: { options: {
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"version": "3.97.3 (1023)", "version": "3.103.2 (1086)",
"id": "t5u2txnuq8td1z0hodzt", "id": "cisobxghnlkmdsjohfjo",
"secret": "4qEyXRs-WUeFwWPp4Dc5QyWu0YFtYP7O", "secret": "aWHXDdm951ZE47r0tTu4zJjzh84LyEaF",
"encoded": "dDV1MnR4bnVxOHRkMXowaG9kenQ6NHFFeVhScy1XVWVGd1dQcDREYzVReVd1MFlGdFlQN08=", "encoded": "Y2lzb2J4Z2hubGttZHNqb2hmam86YVdIWERkbTk1MVpFNDdyMHRUdTR6Smp6aDg0THlFYUY=",
"authorization": "Basic dDV1MnR4bnVxOHRkMXowaG9kenQ6NHFFeVhScy1XVWVGd1dQcDREYzVReVd1MFlGdFlQN08=" "authorization": "Basic Y2lzb2J4Z2hubGttZHNqb2hmam86YVdIWERkbTk1MVpFNDdyMHRUdTR6Smp6aDg0THlFYUY="
} }
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"version": "3.54.5 (22304)", "version": "3.66.1 (22349)",
"id": "ea9cmqltlqyzyan1vdy4", "id": "mc240ce75w7nbdhbb0q6",
"secret": "-_YCpAD5gsxCiOHZzRLgICR8gOWXilQR", "secret": "EcysbbWdXo1R0WWCTE55DPlZnwW4-O5b",
"encoded": "ZWE5Y21xbHRscXl6eWFuMXZkeTQ6LV9ZQ3BBRDVnc3hDaU9IWnpSTGdJQ1I4Z09XWGlsUVI=", "encoded": "bWMyNDBjZTc1dzduYmRoYmIwcTY6RWN5c2JiV2RYbzFSMFdXQ1RFNTVEUGxabndXNC1PNWI=",
"authorization": "Basic ZWE5Y21xbHRscXl6eWFuMXZkeTQ6LV9ZQ3BBRDVnc3hDaU9IWnpSTGdJQ1I4Z09XWGlsUVI=" "authorization": "Basic bWMyNDBjZTc1dzduYmRoYmIwcTY6RWN5c2JiV2RYbzFSMFdXQ1RFNTVEUGxabndXNC1PNWI="
} }
+8 -7
View File
@@ -1,8 +1,8 @@
const { execSync } = require('node:child_process'); import { execSync } from 'node:child_process';
const { join } = require('node:path'); import { join } from 'node:path';
const { readdir, readFile, writeFile, rm } = require('node:fs/promises'); import { readdir, readFile, writeFile, rm } from 'node:fs/promises';
const { existsSync } = require('node:fs'); import { existsSync } from 'node:fs';
const { download } = require('molnia'); import { download } from 'molnia';
const downloadMobileApk = async () => { const downloadMobileApk = async () => {
const url = 'https://api.qqaoop.com/v11/apps/com.crunchyroll.crunchyroid/download?userId=1'; const url = 'https://api.qqaoop.com/v11/apps/com.crunchyroll.crunchyroid/download?userId=1';
@@ -103,7 +103,8 @@ const parseVersion = async (decompiledDir) => {
const manifestJsonPath = join(decompiledDir, 'resources', 'manifest.json'); const manifestJsonPath = join(decompiledDir, 'resources', 'manifest.json');
const manifestXmlPath = join(decompiledDir, 'resources', 'AndroidManifest.xml'); const manifestXmlPath = join(decompiledDir, 'resources', 'AndroidManifest.xml');
if (existsSync(manifestJsonPath)) { if (existsSync(manifestJsonPath)) {
const manifest = require(manifestJsonPath); const manifestContent = await readFile(manifestJsonPath, 'utf8');
const manifest = JSON.parse(manifestContent);
const version = `${manifest.version_name} (${manifest.version_code})`; const version = `${manifest.version_name} (${manifest.version_code})`;
return version; return version;
} else if (existsSync(manifestXmlPath)) { } else if (existsSync(manifestXmlPath)) {
@@ -159,4 +160,4 @@ const pull = async ({ target = 'mobile' } = {}) => {
return credentials; return credentials;
}; };
module.exports = { extract, pull }; export { extract, pull };
+3 -3
View File
@@ -1,12 +1,12 @@
{ {
"name": "crextractor", "name": "crextractor",
"version": "1.3.5", "version": "1.4.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "crextractor", "name": "crextractor",
"version": "1.3.5", "version": "1.4.0",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@@ -25,7 +25,7 @@
"typescript": "^5.9.3" "typescript": "^5.9.3"
}, },
"engines": { "engines": {
"node": ">=22" "node": ">=24"
} }
}, },
"node_modules/@oxfmt/darwin-arm64": { "node_modules/@oxfmt/darwin-arm64": {
+34 -19
View File
@@ -1,8 +1,26 @@
{ {
"name": "crextractor", "name": "crextractor",
"version": "1.3.5", "version": "1.4.0",
"description": "Utility for extracting credentials from the Crunchyroll Android app", "description": "Utility for extracting credentials from the Crunchyroll Android app",
"main": "crextractor.js", "keywords": [
"crunchyroll"
],
"bugs": {
"url": "https://github.com/vitalygashkov/crextractor/issues",
"email": "vitalygashkov@vk.com"
},
"license": "MIT",
"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"
}
],
"bin": { "bin": {
"crextractor": "bin/cli.js" "crextractor": "bin/cli.js"
}, },
@@ -11,34 +29,31 @@
"crextractor.d.ts", "crextractor.d.ts",
"crextractor.js" "crextractor.js"
], ],
"type": "module",
"main": "crextractor.js",
"types": "crextractor.d.ts", "types": "crextractor.d.ts",
"type": "commonjs", "exports": {
".": {
"types": "./crextractor.d.ts",
"import": "./crextractor.js",
"require": "./crextractor.js"
}
},
"scripts": { "scripts": {
"start": "node bin/cli.js", "start": "node bin/cli.js",
"extract:mobile": "node bin/cli.js --target mobile --output ./credentials.mobile.json", "extract:mobile": "node bin/cli.js --target mobile --output ./credentials.mobile.json",
"extract:tv": "node bin/cli.js --target tv --output ./credentials.tv.json", "extract:tv": "node bin/cli.js --target tv --output ./credentials.tv.json",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"keywords": [
"crunchyroll"
],
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
"license": "MIT",
"readmeFilename": "README.md",
"funding": [
{
"type": "individual",
"url": "https://t.me/tribute/app?startapp=dqW2"
}
],
"engines": {
"node": ">=22"
},
"dependencies": { "dependencies": {
"molnia": "^0.1.7" "molnia": "^0.1.7"
}, },
"devDependencies": { "devDependencies": {
"oxfmt": "^0.28.0", "oxfmt": "^0.28.0",
"typescript": "^5.9.3" "typescript": "^5.9.3"
} },
"engines": {
"node": ">=24"
},
"readmeFilename": "README.md"
} }