2025-08-23 21:14:56 +05:00
# Crextractor
2025-03-26 13:19:45 +05:00
2025-08-25 22:59:34 +05:00
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).
2025-03-26 13:19:45 +05:00
## Prerequisites
- [Node.js ](https://nodejs.org/en )
- [jadx ](https://github.com/skylot/jadx )
## Usage
2025-08-26 12:22:32 +05:00
### Library
```bash
npm i crextractor
```
#### Fetch ready credentials from this GitHub repository
2025-08-23 21:38:36 +05:00
```js
2025-08-26 12:22:32 +05:00
import { pull } from 'crextractor' ;
2025-08-23 21:38:36 +05:00
async function main () {
2025-08-26 12:22:32 +05:00
const credentials = await pull ( 'tv' );
2025-08-23 21:38:36 +05:00
2025-08-24 10:40:11 +05:00
// You can use the extracted credentials to obtain access tokens for Crunchyroll APIs
2025-08-23 21:38:36 +05:00
const response = await fetch ( 'https://beta-api.crunchyroll.com/auth/v1/token' , {
headers : {
2025-08-26 12:22:32 +05:00
Authorization : credentials . authorization , // Ready HTTP header in the format `Basic <encoded>`, can be used to access some Crunchyroll APIs
2025-08-23 23:49:21 +05:00
'User-Agent' : 'Crunchyroll/ANDROIDTV/3.42.1_22267 (Android 16; en-US; sdk_gphone64_x86_64)' ,
2025-08-23 21:38:36 +05:00
// ...
},
method : 'POST' ,
body : JSON . stringify ({
// ...
}),
});
}
```
2025-08-26 12:22:32 +05:00
#### Extract credentials from the latest APK using jadx
2025-08-24 10:40:33 +05:00
2025-08-26 12:22:32 +05:00
```js
import { extract } from 'crextractor' ;
2025-08-24 10:40:33 +05:00
2025-08-26 12:22:32 +05:00
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
2025-03-26 13:19:45 +05:00
2025-08-26 12:22:32 +05:00
// Do something with the extracted credentials
}
2025-08-24 10:43:44 +05:00
```
2025-08-26 12:22:32 +05:00
### Command-line interface
2025-03-26 13:19:45 +05:00
2025-08-26 12:22:32 +05:00
```bash
npx crextractor --target mobile --output ./credentials.mobile.json
2025-03-26 13:19:45 +05:00
```
2025-08-26 12:22:32 +05:00
> 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.
2025-03-26 13:19:45 +05:00
## License
MIT