Widevine CDM API
- Install Python 3.6 or newer and Poetry
- Install Python package dependencies using
poetry install
- Activate the virtual environment using
poetry shell
- Run the Flask web app using
python wvproxy.py
(this part can run on any OS) - (Optional but recommended) Put the API behind a reverse proxy such as nginx for HTTPS support
- Open the web app on a Windows computer with Chrome and widevine-l3-guesser installed and leave it running
- Put one or more users and keys in
authorized_users.txt
in TSV (tab-separated values) format:
alice e50af8c5-02ef-4546-8449-77ab4cf8a271
bob 5fdb1375-e529-4f51-a8a4-9296bfadedfa
{
"method": "GetChallenge",
"params": {
"init": "<pssh as base64>",
"cert": "<service certificate as base64>"
},
"token": "<user key from authorized_users.txt>"
}
{
"status_code": 200,
"message": {
"session_id": "<unique session uuid>",
"challenge": "<license request as base64>"
}
}
{
"method": "GetKeys",
"params": {
"session_id": "<unique session uuid>",
"cdmkeyresponse": "<license response as base64>"
},
"token": "<user key from authorized_users.txt>"
}
{
"status_code": 200,
"message": {
"keys": [
{
"kid": "<key id as hex>",
"key": "<key as hex>"
},
{
"kid": "<key id as hex>",
"key": "<key as hex>"
},
...
]
}
}
{
"status_code": 4XX|5XX,
"message": "<error description>"
}
This project is purely for educational purposes. The author claims no responsibility for what you do with it.