update README

This commit is contained in:
Vitaly Gashkov
2025-08-26 12:22:32 +05:00
parent 03c74c53a3
commit 6fee13a6c9
+27 -22
View File
@@ -11,17 +11,24 @@ The [credentials](https://github.com/vitalygashkov/crextractor/blob/main/credent
## Usage ## Usage
### Fetching already extracted credentials ### Library
```bash
npm i crextractor
```
#### Fetch ready credentials from this GitHub repository
```js ```js
import { pull } from 'crextractor';
async function main() { async function main() {
const url = 'https://raw.githubusercontent.com/vitalygashkov/crextractor/refs/heads/main/credentials.tv.json'; const credentials = await pull('tv');
const credentials = await fetch(url).then((response) => response.json());
// You can use the extracted credentials to obtain access tokens for Crunchyroll APIs // 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, 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)', 'User-Agent': 'Crunchyroll/ANDROIDTV/3.42.1_22267 (Android 16; en-US; sdk_gphone64_x86_64)',
// ... // ...
}, },
@@ -33,6 +40,22 @@ async function main() {
} }
``` ```
#### Extract credentials from the latest APK using jadx
```js
import { extract } from 'crextractor';
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 ### Command-line interface
```bash ```bash
@@ -41,24 +64,6 @@ npx crextractor --target mobile --output ./credentials.mobile.json
> 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. > 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.
### Library
```bash
npm i crextractor
```
```js
import { extract } from 'crextractor';
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
```
## License ## License
MIT MIT