mirror of
https://github.com/vitalygashkov/crextractor.git
synced 2026-07-15 17:40:03 +02:00
chore: update README
This commit is contained in:
@@ -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).
|
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
|
## 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
|
||||||
|
|||||||
Reference in New Issue
Block a user