mirror of
https://github.com/vitalygashkov/crextractor.git
synced 2026-07-15 17:40:03 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68b61b3dd2 | ||
|
|
49b208c9ec | ||
|
|
0372c520b0 | ||
|
|
41694bb0b9 | ||
|
|
6d2019cec7 | ||
|
|
9dec6c95a4 | ||
|
|
4175a41b73 | ||
|
|
ebad84b4e7 | ||
|
|
e7e1e3df4f | ||
|
|
d8f8586045 | ||
|
|
b42a8d29dc | ||
|
|
fc11a30c73 |
@@ -28,6 +28,7 @@ jobs:
|
||||
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
|
||||
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm install -g npm@latest
|
||||
- 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
|
||||
id: version
|
||||
run: |
|
||||
@@ -33,19 +39,13 @@ jobs:
|
||||
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Publish with the appropriate tag
|
||||
- name: Publish to npm
|
||||
- name: Publish new version
|
||||
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 GitHub Release
|
||||
- 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 }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -4,32 +4,33 @@ Utility for extracting credentials from the Crunchyroll Android app (both TV and
|
||||
|
||||
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).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Node.js](https://nodejs.org/en)
|
||||
- [jadx](https://github.com/skylot/jadx)
|
||||
|
||||
## Usage
|
||||
|
||||
### Library
|
||||
|
||||
```bash
|
||||
npm i crextractor
|
||||
```
|
||||
|
||||
#### Fetch ready credentials from this GitHub repository
|
||||
### Fetch ready credentials from this GitHub repository
|
||||
|
||||
```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() {
|
||||
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', {
|
||||
headers: {
|
||||
Authorization: credentials.authorization, // 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)',
|
||||
// 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',
|
||||
@@ -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
|
||||
import { extract } from 'crextractor';
|
||||
#### Prerequisites
|
||||
|
||||
async function main() {
|
||||
const { id, secret, encoded, authorization } = await extract();
|
||||
// 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
|
||||
- [Node.js](https://nodejs.org/en)
|
||||
- [jadx](https://github.com/skylot/jadx)
|
||||
|
||||
```bash
|
||||
npx crextractor --target mobile --output ./credentials.mobile.json
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { parseArgs } = require('node:util');
|
||||
const { extract } = require('../crextractor');
|
||||
import { parseArgs } from 'node:util';
|
||||
import { extract } from '../crextractor.js';
|
||||
|
||||
const args = parseArgs({
|
||||
options: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": "3.97.3 (1023)",
|
||||
"id": "t5u2txnuq8td1z0hodzt",
|
||||
"secret": "4qEyXRs-WUeFwWPp4Dc5QyWu0YFtYP7O",
|
||||
"encoded": "dDV1MnR4bnVxOHRkMXowaG9kenQ6NHFFeVhScy1XVWVGd1dQcDREYzVReVd1MFlGdFlQN08=",
|
||||
"authorization": "Basic dDV1MnR4bnVxOHRkMXowaG9kenQ6NHFFeVhScy1XVWVGd1dQcDREYzVReVd1MFlGdFlQN08="
|
||||
"version": "3.99.0 (1056)",
|
||||
"id": "xrpuo7pnmptovztigdfp",
|
||||
"secret": "VuGVUbd1ldRoBPzSdbD4uBcfnPjrlESn",
|
||||
"encoded": "eHJwdW83cG5tcHRvdnp0aWdkZnA6VnVHVlViZDFsZFJvQlB6U2RiRDR1QmNmblBqcmxFU24=",
|
||||
"authorization": "Basic eHJwdW83cG5tcHRvdnp0aWdkZnA6VnVHVlViZDFsZFJvQlB6U2RiRDR1QmNmblBqcmxFU24="
|
||||
}
|
||||
+8
-7
@@ -1,8 +1,8 @@
|
||||
const { execSync } = require('node:child_process');
|
||||
const { join } = require('node:path');
|
||||
const { readdir, readFile, writeFile, rm } = require('node:fs/promises');
|
||||
const { existsSync } = require('node:fs');
|
||||
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 downloadMobileApk = async () => {
|
||||
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 manifestXmlPath = join(decompiledDir, 'resources', 'AndroidManifest.xml');
|
||||
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})`;
|
||||
return version;
|
||||
} else if (existsSync(manifestXmlPath)) {
|
||||
@@ -159,4 +160,4 @@ const pull = async ({ target = 'mobile' } = {}) => {
|
||||
return credentials;
|
||||
};
|
||||
|
||||
module.exports = { extract, pull };
|
||||
export { extract, pull };
|
||||
|
||||
Generated
+3
-3
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "crextractor",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "crextractor",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.0",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -25,7 +25,7 @@
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
"node": ">=24"
|
||||
}
|
||||
},
|
||||
"node_modules/@oxfmt/darwin-arm64": {
|
||||
|
||||
+34
-19
@@ -1,8 +1,26 @@
|
||||
{
|
||||
"name": "crextractor",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.0",
|
||||
"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": {
|
||||
"crextractor": "bin/cli.js"
|
||||
},
|
||||
@@ -11,34 +29,31 @@
|
||||
"crextractor.d.ts",
|
||||
"crextractor.js"
|
||||
],
|
||||
"type": "module",
|
||||
"main": "crextractor.js",
|
||||
"types": "crextractor.d.ts",
|
||||
"type": "commonjs",
|
||||
"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"
|
||||
},
|
||||
"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": {
|
||||
"molnia": "^0.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"oxfmt": "^0.28.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
},
|
||||
"readmeFilename": "README.md"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user