Features 🔥
- Fully async (httpx)
- Python 3.7+ support
- Clean and modern code
- Updated to latest Crunchyroll API
Installation ⚙️
# Using Git
pip install -U git+https://github.com/stefanodvx/crunpyroll
# Using PyPi (Recommended)
pip install -U crunpyroll
Documentation 📄
The documentation page undergoes automatic updates with each push. To access the latest documentation page, kindly refer to our Read the Docs project.
Example Code ❓
import crunpyroll
import asyncio
client = crunpyroll.Client(
email="email",
password="password",
locale="it-IT"
)
async def main():
# Start client and login
await client.start()
# Search for Attack on Titan
query = await client.search("Attack On Titan")
series_id = query.items[0].id
print(series_id)
# Retrieve all seasons of the series
seasons = await client.get_seasons(series_id)
print(seasons)
asyncio.run(main())
Downloading content 🔑
Crunchyroll has recently implemented the Widevine and PlayReady Digital Rights Management (DRM) systems, which has led to challenges for certain users attempting to download content from the platform.
Subsequently, the following code provides an illustrative example of obtaining decryption keys through the utilities of the pywidevine library and an L3 Content Decryption Module (CDM).
from pywidevine.cdm import Cdm
from pywidevine.pssh import PSSH
from pywidevine.device import Device
...
device = Device.load("l3cdm.wvd")
cdm = Cdm.from_device(device)
# Get streams of the episode/movie
streams = await client.get_streams("GRVDQ1G4R")
# Get manifest of the format you prefer
manifest = await client.get_manifest(streams.hardsubs[0].url)
# print(manifest)
# Get Widevine PSSH from manifest
pssh = PSSH(manifest.content_protection.widevine.pssh)
session_id = cdm.open()
challenge = cdm.get_license_challenge(session_id, pssh)
license = await client.get_license(
streams.media_id,
challenge=challenge,
token=streams.token
)
cdm.parse_license(session_id, license)
for key in cdm.get_keys(session_id, "CONTENT"):
print(f"{key.kid.hex}:{key.key.hex()}")
cdm.close(session_id)
# Deleting active streams will prevent Crunchyroll HTTP 420 (too_many_queued_streams) error.
await client.delete_active_stream(
streams.media_id,
token=streams.token
)
Output:
056ec1ca849e350181753cacc9bd404b:2307a188ecd8de3859b71b30791f171d
Metadata
Release files for crunpyroll 2.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crunpyroll-2.4.5.tar.gz | 16.7 kB | Without provenance | Details for crunpyroll-2.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crunpyroll-2.4.5-py3-none-any.whl | Python 3 | none | any | Details for crunpyroll-2.4.5-py3-none-any.whl |
Total release size: 44.9 kB
Release files / crunpyroll-2.4.5.tar.gz
| Download URL | crunpyroll-2.4.5.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ea55df70f663b4fee4970a36702fdf60d7f89e1e33e4dcf8b85b1effe2c5f8b
|
|
BLAKE2b-256 checksum How to use checksums |
962a6128f040b5a28fede7d8216ec197c0a8a3c60d502caf0430c08a0d754f77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / crunpyroll-2.4.5-py3-none-any.whl
| Download URL | crunpyroll-2.4.5-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec8193d8a4f409e6d5001aa4696751af203c19a17c2dbba4aebe6878cc82115a
|
|
BLAKE2b-256 checksum How to use checksums |
d679be702be5eb4fc3357dd1b0dfbc4d1b36baf27d38107bfe91f1dc2f7a6102
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for crunpyroll 2.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.