Files
crextractor/README.md
T

60 lines
1.8 KiB
Markdown
Raw Normal View History

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
## Usage
2026-02-15 16:50:05 +05:00
### Fetch ready credentials from this GitHub repository
2025-08-23 21:38:36 +05:00
```js
2026-02-15 16:50:05 +05:00
// 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());
}
2025-08-26 12:22:32 +05:00
2025-08-23 21:38:36 +05:00
async function main() {
2026-02-15 16:50:05 +05:00
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(')', '');
2025-08-23 21:38:36 +05:00
const response = await fetch('https://beta-api.crunchyroll.com/auth/v1/token', {
headers: {
2026-02-15 16:50:05 +05:00
// 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)`,
2025-08-23 21:38:36 +05:00
// ...
},
method: 'POST',
body: JSON.stringify({
// ...
}),
});
}
```
2026-02-15 16:50:05 +05:00
### Extract fresh credentials from the latest APK using jadx
2025-08-24 10:40:33 +05:00
2026-02-15 16:50:05 +05:00
#### Prerequisites
2025-08-24 10:40:33 +05:00
2026-02-15 16:50:05 +05:00
- [Node.js](https://nodejs.org/en)
- [jadx](https://github.com/skylot/jadx)
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