Compare commits

...

139 Commits
main ... dev

Author SHA1 Message Date
d6f05e73a7 Update README.md 2025-05-14 08:50:43 +00:00
chu23465
6f35e17fdd Small fixes 2025-05-12 14:47:54 +05:30
chu23465
3910a39571 MA + NF changes 2025-05-12 14:41:21 +05:30
chu23465
7766581007
Update README.md 2025-05-02 08:34:29 +05:30
chu23465
4a7b1b7377 Small change 2025-04-30 20:59:30 +05:30
chu23465
7f3b4e396c Update amazon.py 2025-04-30 20:27:22 +05:30
chu23465
d3e438b71d Update README 2025-04-30 20:21:07 +05:30
chu23465
f74fbdb82d Update netflix.yml 2025-04-30 20:01:20 +05:30
chu23465
7745c02e00 Added iTunes service 2025-04-30 19:50:29 +05:30
chu23465
91e9e2f579 Few changes
Added --match-forced flag
2025-04-30 19:32:28 +05:30
chu23465
f7bdd003c4
Update README.md 2025-04-30 19:25:51 +05:30
chu23465
bb3087750f Fix for m3u8 ATVP + DSNP 2025-04-30 18:44:40 +05:30
chu23465
b3601b2d12
Update README.md 2025-04-30 10:58:57 +05:30
chu23465
e018a7c615 Small fix 2025-04-30 10:36:32 +05:30
chu23465
e3eb83b4ae Another fix for ATVP m3u8 2025-04-30 09:48:47 +05:30
chu23465
bfcb36734b Small change 2025-04-30 08:44:32 +05:30
chu23465
0ba20cf636 Small change 2025-04-30 08:40:09 +05:30
chu23465
3dc940ac53 Small change 2025-04-30 08:34:34 +05:30
chu23465
34bf93c2d5 Fix
Fix for getting CSRF token for Germany region (Amazon)
2025-04-30 08:31:28 +05:30
chu23465
a80eb98e36 Few changes 2025-04-30 07:56:03 +05:30
chu23465
ece2b50cad Fix ATVP m3u8 parsing error. 2025-04-30 07:14:14 +05:30
chu23465
9f2b9c2788 Hybrid for DSNP (Beta) 2025-04-29 17:36:04 +05:30
chu23465
71f248eed0 DSNP service should be more stable with proxies now 2025-04-29 16:33:26 +05:30
chu23465
b1454b8b95 Few changes 2025-04-29 15:52:57 +05:30
chu23465
4eeda5414d DV+HDR test 2025-04-29 15:32:44 +05:30
chu23465
46fb3e7adf Netflix changes, add delay for subs 2025-04-29 12:35:39 +05:30
chu23465
fca2266d33 Few more netflix related changes 2025-04-29 11:54:44 +05:30
chu23465
18d70442e3 Few changes to netflix service 2025-04-29 10:58:07 +05:30
chu23465
91b146ca5b Max fixes, disable insecure request warning 2025-04-29 10:07:55 +05:30
chu23465
4443e0fe11 Fix for -vb track selection 2025-04-29 09:40:37 +05:30
chu23465
5ca267d05f Hotstar fix for track selection 2025-04-29 09:04:01 +05:30
chu23465
bbdcbb64b6 Small fix 2025-04-29 08:29:00 +05:30
chu23465
e4a0e7aab6
Update README.md 2025-04-29 08:27:24 +05:30
chu23465
a9207d263d Changes
Added custom m3u8 parser for DSNP.
Hybrid DV+HDR is to be tested.
Few miscellaneous fixes.
2025-04-29 08:16:38 +05:30
chu23465
4a773d1db0 Features
Max audio compatibility added. Changes for Hybrid DV/HDR.
2025-04-24 17:24:28 +05:30
chu23465
4fcd0748c0
Update README.md 2025-04-24 17:21:47 +05:30
chu23465
f42208cce0
Merge pull request #39 from MrHulk02/dev
SUNNXT service by MrHulk02
2025-04-24 10:45:07 +05:30
MrHulk
5da8c7ff21
sunnxt service 2025-04-24 10:30:43 +05:30
MrHulk
3eab5807a4
sunnxt service 2025-04-24 10:30:39 +05:30
chu23465
d8b223b184 Update tracks.py 2025-04-22 21:43:01 +05:30
chu23465
62030d9527 Minor changes 2025-04-22 21:37:18 +05:30
chu23465
3e3fb73516 Small fixes 2025-04-21 22:04:20 +05:30
chu23465
5f98f329af Feature and a fix
Fix: --atmos works now with AMZN even if not -q 2160 or -r DV
Feature: Selecting more than 1 track based on channels or codec. Not complete
2025-04-19 22:57:19 +05:30
chu23465
62972b20cf
Update README.md 2025-04-19 14:59:44 +05:30
chu23465
280c280d6d Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-19 00:12:51 +05:30
chu23465
1ace8c7e32 Few changes 2025-04-19 00:12:45 +05:30
chu23465
0a5c89bc07
Merge pull request #25 from Sihht/fix-codec
Fix codec
2025-04-18 23:17:34 +05:30
chu23465
22c0489a47
Merge branch 'dev' into fix-codec 2025-04-18 23:15:55 +05:30
chu23465
dd71f707f6 Changes
Implemented track download skip if file already exists.
A few Linux support changes.
Implemented caching cookies to profile cookies path.
2025-04-18 23:13:05 +05:30
chu23465
bffc9b0d7a removing some bad code 2025-04-18 18:13:11 +05:30
Sihht
98db15454c
Update dl.py 2025-04-17 11:30:55 -05:00
Sihht
16f267052d
fix audio codec 2025-04-17 10:54:12 -05:00
Sihht
31e81432e3
audio codec fix 2025-04-17 10:51:20 -05:00
chu23465
bfbda1dff4 Small change to resume download 2025-04-17 17:29:39 +05:30
chu23465
93fdfebc69 Update dl.py 2025-04-17 16:09:39 +05:30
chu23465
61d21e94e3 Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-17 15:53:57 +05:30
chu23465
59c6e7fb92 Update paramountplus.py 2025-04-17 15:53:39 +05:30
chu23465
6553e7f19e
Update README.md 2025-04-17 14:17:48 +05:30
chu23465
cf9f1cee2e
Update README.md 2025-04-17 14:07:53 +05:30
chu23465
3b1bbdb7fd Fixes for HULU 4K and HS AVC 4K 2025-04-17 14:03:47 +05:30
chu23465
3efc534b10 Another fix for HULU 2025-04-17 11:03:32 +05:30
chu23465
31aa7d19c7 Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-17 10:02:35 +05:30
chu23465
ac7c9902fb Small fix for HULU 2025-04-17 10:02:21 +05:30
chu23465
335cd2e567
Update README.md 2025-04-17 08:43:20 +05:30
chu23465
162fa17637
Update README.md 2025-04-17 08:26:36 +05:30
chu23465
163ac2096f
Update README.md 2025-04-16 22:49:32 +05:30
chu23465
1867fb9e5e Proper fix for DSNP
DSNP service is currently stable
2025-04-16 21:47:14 +05:30
chu23465
b01bbdb53f
Update README.md 2025-04-16 21:24:24 +05:30
chu23465
fc4bef6318
Update README.md 2025-04-16 21:15:35 +05:30
chu23465
3917330be7
Update README.md 2025-04-16 19:40:12 +05:30
chu23465
f2cf356418 Trial fix 2025-04-16 18:48:57 +05:30
chu23465
e3442d2793 I am Stupid 2025-04-16 18:23:59 +05:30
chu23465
b73b43163c Another possible fix for DSNP KID 2025-04-16 18:08:11 +05:30
chu23465
e3e5f7bedb Small change 2025-04-16 17:28:32 +05:30
chu23465
a8edede94b Fix for M3U8 Hotstar 2025-04-16 17:20:32 +05:30
chu23465
5b88624051 PyInstaller support
Currently builds but errors while executing
2025-04-16 16:09:35 +05:30
chu23465
5827a968b2 Add a max speed if Akamai for N_m3u8 2025-04-16 15:30:41 +05:30
chu23465
cd5a956e62
Update README.md 2025-04-16 15:26:41 +05:30
chu23465
8e7e45c14a Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-16 14:56:40 +05:30
chu23465
fe942132dd Support paths with spaces in them for N_m3u8 2025-04-16 14:56:36 +05:30
chu23465
cc30f5a6f6
Update README.md 2025-04-16 14:39:58 +05:30
chu23465
0b240e7308 Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-16 13:51:10 +05:30
chu23465
e1aeee8d36 Fix for DSNP incorrect kid 2025-04-16 13:51:04 +05:30
chu23465
9940292783
Update README.md 2025-04-15 19:16:44 +05:30
chu23465
11108223bc ISM Atmos fix for Amazon 2025-04-15 19:07:41 +05:30
chu23465
999c73d1e6 Remove base64 encode 2025-04-14 11:56:35 +05:30
chu23465
78b781e794 Debug license 2025-04-14 11:10:51 +05:30
chu23465
616ab317c1 Integrate subby 2025-04-14 08:39:57 +05:30
chu23465
0c92977f5a Remove decode in license challenge (DSNP) 2025-04-14 08:38:38 +05:30
chu23465
5b8c9a0fb2 Added a strip-sdh flag 2025-04-14 08:27:08 +05:30
chu23465
ca9c9a0cf8 Another DSNP fix 2025-04-13 15:19:36 +05:30
chu23465
3b894cd31a
Update disneyplus.py 2025-04-13 13:22:20 +05:30
chu23465
375320f0c4
Update README.md 2025-04-13 07:55:35 +05:30
chu23465
4eb7ddedb8 Fix DSNP 2025-04-13 07:52:20 +05:30
chu23465
c9e04e3499 Wrong check 2025-04-13 07:30:15 +05:30
chu23465
dc9cfc4676 Another fix for DSNP 2025-04-13 07:28:11 +05:30
chu23465
3bb39a9b64 Fix DSNP error and vbitrate error 2025-04-13 07:03:31 +05:30
chu23465
762610427e Another fix for vbitrate min 2025-04-13 05:26:43 +05:30
chu23465
56769a537d Small fix for bitrate select 2025-04-13 03:31:20 +05:30
chu23465
debc33f62e Added DSNP service 2025-04-13 03:22:05 +05:30
chu23465
f90eaff39b License decode fix 2025-04-12 23:18:27 +05:30
chu23465
5290850dc6 Fix vbitrate == "min" 2025-04-11 06:26:41 +05:30
chu23465
ca46bd4906
Update README.md 2025-04-10 11:06:46 +05:30
chu23465
21c327a6aa
Update README.md 2025-04-10 11:06:30 +05:30
chu23465
2f6e521d75 Added Cache path clear for AMZN 2025-04-10 01:03:28 +05:30
chu23465
8a08433ff8 Fixed NoneType vbitrate error 2025-04-10 01:01:19 +05:30
chu23465
8e1387db8e
Update README.md 2025-04-09 12:05:36 +05:30
chu23465
633653807e Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-09 11:57:54 +05:30
chu23465
dffb6afec9 Added a minimum video bitrate select feature 2025-04-09 11:57:44 +05:30
chu23465
70d56c1000
Update README.md 2025-04-09 11:39:50 +05:30
chu23465
d7b3b4ff81 Merge branch 'dev' of https://github.com/chu23465/VT-PR into dev 2025-04-09 11:37:26 +05:30
chu23465
49d2dcffd2 Added --closest-resolution flag 2025-04-09 11:37:22 +05:30
chu23465
b439e4ea07
Update README.md 2025-04-09 11:34:31 +05:30
chu23465
46ef234784
Update README.md
Added credits
2025-04-09 11:17:16 +05:30
chu23465
05a9fbd497
Update README.md 2025-04-09 11:04:40 +05:30
chu23465
35dfeb8f7d Fixed 640kbps audio AMZN 2025-04-09 10:38:13 +05:30
chu23465
88a682d1ef Changes
Possible fix for Amazon refresh token
Basic install.sh for Linux
Removed unnecessary requirements.txt
2025-04-09 07:13:09 +05:30
chu23465
1d94ecef7f Update README.md
Added more To-Do, some organization
2025-04-09 07:13:09 +05:30
Aswin
5ac64b0348 Fixed Amazon
Amazon should be back to normal
2025-04-08 18:28:33 +05:30
Aswin
0bc8c533fd Error
This version is erroring for Amazon. Hotstar still works fine. Committed a few more devices.
2025-04-08 09:48:20 +05:30
chu23465
9e7f45a42e
Update README.md
Small change to proxy instructions.
2025-04-07 19:40:35 +05:30
Aswin
73d53c3efe Changes
Added a `--latest-episode` flag. Updated README to include correct ASIN display script. Fixed MAX seasons length.
2025-04-07 19:31:40 +05:30
Aswin
09e03b47f7 Hotstar with DRM
I forgot to test Hotstar with DRM. Made changes to support DRM correctly.
2025-04-07 00:45:16 +05:30
chu23465
1c15375821
Update README.md 2025-04-06 21:52:59 +05:30
chu23465
15fee8704b
Update README.md
Hotstar information
2025-04-06 21:51:56 +05:30
Aswin
dd67896a9f Small change 2025-04-06 20:53:27 +05:30
Aswin
96e36e7a05 Hotstar
Hotstar (HS) service has been tested and added.
2025-04-06 20:27:22 +05:30
chu23465
4b4ed735ef
Update pyproject.toml
Forgot to resolve dependencies. Updated - should work now.
2025-04-03 17:01:25 +05:30
chu23465
4c82b3a29e
Update README.md
Grammar
2025-04-01 14:10:40 +05:30
Aswin
fb7b303760 Small change 2025-04-01 02:43:03 +05:30
Aswin
ecb26968da Start support for Hotstar
Hotstar is currently throwing errors when getting tracks, will be fixed with next commit.
Fixed error when loading Widevine Device.
2025-04-01 02:41:59 +05:30
chu23465
ddcb82a853 Update README.md
Proxy stuff
Update README.md - Grammar
Update issue templates
Update amazon.py
Star history dark theme
2025-04-01 00:56:19 +05:30
Aswin
05ed9d57df Changes
Add default device
Switch to requests to get manifest.
Import peacock service
2025-03-23 09:56:39 +05:30
chu23465
82cfd1c484
Update README.md 2025-03-21 00:41:14 +05:30
Aswin
d7c4f1e71f Merge remote-tracking branch 'origin/dev' into dev 2025-03-21 00:39:53 +05:30
Aswin
13a9a72b80 Linux support WIP 2025-03-21 00:39:48 +05:30
chu23465
ba1963a03e
Update README.md 2025-03-20 17:01:46 +05:30
chu23465
a8f2f9bf62
Update to default vquality to HD in amazon.py 2025-03-20 02:46:37 +05:30
chu23465
0e1b8a1f54
Fix error max.py 2025-03-20 01:41:02 +05:30
146 changed files with 16795 additions and 4038 deletions

21
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: chu23465
---
**Describe the bug**
A clear and concise description of what the bug is.
Command used - `[your command]`
**Log**
Add the appropriate log(s) from `vinetrimmer/Logs/` directory. Either add them as text to the issue like below:
```
......Log......
```
Or upload them as attachments to the issue.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

4
.gitignore vendored
View File

@ -4,7 +4,8 @@
/vinetrimmer/Cache/
/vinetrimmer/Cookies/
/vinetrimmer/Logs/
.DS_Store
key_store.db
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python
@ -182,7 +183,6 @@ pyrightconfig.json
# End of https://www.toptal.com/developers/gitignore/api/python
devices/
scalable/43.xml
scalable/40.xml

359
README.md
View File

@ -1,20 +1,81 @@
# VineTrimmer-PlayReady
A tool to download and remove DRM from streaming services. A version of an old fork of [devine](https://github.com/devine-dl/devine).
Modified to remove Playready DRM instead of Widevine.
# VineTrimmer-PlayReady
A tool to download and remove DRM from streaming services. Modified to remove Playready DRM in addition to Widevine DRM.
The name `VineTrimmer` comes from `Vine` as in `WideVine` and `Trimmer` as in remove.
## Read the README thoroughly atleast twice. I cannot stress how important this is. There is a reason why this README is so verbose.
## This project is under active development. Expect bugs and errors.
## Disclaimer!!!
This project is ONLY for educational/archival/personal purposes. I do not condone piracy in any form.
By using this project you agree that:
`The developer shall not be held responsible for any account suspensions, terminations, penalties or legal action taken/imposed by third-party platforms. The User acknowledges and agrees that they are solely responsible for complying with all terms, policies, copyright and guidelines of any such platforms.`
I AM NOT taking credit for the entirety of this project. This project is based on a version of an old fork of [devine](https://github.com/devine-dl/devine) that was found floating around online. I AM taking credit for about 20% of the additional stuff that I personally worked on.
Support for Sport replays (VOD) or live streams is not planned. It's a whole thing with OTT panels and restreaming and whatnot. It's a can of worms that I don't plan on opening.
## Supporters
[@m41c0n](https://github.com/m41c0n)
## Features
- Progress Bars for decryption ([mp4decrypt](https://github.com/chu23465/bentoOldFork), Shaka)
- Refresh Token fixed for Amazon service
- Reprovision .prd after a week
- ISM manifest support (Microsoft Smooth Streaming) (Few features to be added)
- N_m3u8DL-RE downloader support
- Reprovision .prd automatically after 2 days
- ISM manifest support (Microsoft Smooth Streaming) (WIP/Experimental)
- N_m3u8DL-RE downloader support (Experimental)
- Atmos audio with ISM manifest (Amazon) is Fixed
- Resume failed download has been implemented. If a track has been successfully downloaded previously and exists in `Temp` directory (encrypted or decrypted), VT will not download said track again.
- Hybrid creation with [dovi_tool](https://github.com/quietvoid/dovi_tool/). This feature is in Beta. Only tested so far on DisneyPlus. Needs more work. Ex: filenaming needs correction, temp directory is a mess after hybrid creation, use another tool insteal of `dovi_tool` to get Profile 8.1 DV-HDR10+ instead of DV Profile 5 HDR10 compatible.
## Usage
1. Run `install.bat`
### Windows
1. Install Microsoft Visual C++ Redistributable - [link](https://aka.ms/vs/17/release/vc_redist.x64.exe).
2. Activate venv using `venv.cmd`.
2. Ensure Python is installed in your system (cannot be from the the Microsoft Store). Refer to [link](https://www.python.org/downloads/) or on Ubuntu -> `sudo apt install python3`. I recommend python 3.10.11 (or higher). Python 3.13 does not work.
3. Make sure git is installed in your system by running `git --version`. If not refer to [link](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
4. Choose a branch, either `dev` or `main`. Use below command to download. (Recommended instead of downloading zip)
```bash
git clone -b <branch-name> --single-branch https://github.com/chu23465/VT-PR
```
5. Navigate and find `install.bat`.
6. Run `install.bat`.
7. Activate venv using `venv.cmd`.
8. Run desired command using poetry.
### Linux
This is in beta for Linux.
Command:
```
wget https://github.com/chu23465/VT-PR/raw/refs/heads/dev/install.sh && chmod +x install.sh && bash install.sh
```
## Updating
1. Backup your `vinetrimmer/Cookies/`, `vinetrimmer/Cache/`, `Downloads` directories just in case.
2. Open a command prompt and navigate your `VT-PR` directory.
3. Recall the branch you downloaded and modify below command accordingly:
```bash
git pull origin <branch-name>
```
Make sure `git pull` is successful. If not do `git stash` and try again.
### Config
@ -23,7 +84,7 @@ Modified to remove Playready DRM instead of Widevine.
`decryptor:` either `mp4decrypt` or `packager`
(shaka-packager fails to decrypt files downloaded from MSS manifests)
(shaka-packager fails to decrypt files downloaded from ISM/Microsoft Smooth Streaming manifests)
`tag:` tag for your release group
@ -46,14 +107,18 @@ Options:
|----------------------------|-----------------------------------------------------------------------------------------------|-----------------------------------|
| -d, --debug | Flag to enable debug logging | False |
| -p, --profile | Profile to use when multiple profiles are defined for a service. | "default" |
| -q, --quality | Download Resolution | 1080 |
| -q, --quality | Download Resolution ie Height of Video Track wanted | 1080 |
| -cr, --closest-resolution | If resolution specified is not found, defaults to closest resolution available | False |
| -v, --vcodec | Video Codec | H264 |
| -a, --acodec | Audio Codec | None |
| -vb, --vbitrate | Video Bitrate | Max |
| -vb, --vbitrate | Video Bitrate, `Min` or a number based on output of --list | Max |
| -ab, --abitrate | Audio Bitrate | Max |
| -ac, --audio-channels | Select Audio by Channels Configuration, e.g `2.0`, `5.1`, `2.0,5.1` | None |
| -mac, --max-audio-compatability | Select multiple audios for maximum compatibility with all devices | False |
| -aa, --atmos | Prefer Atmos Audio | False |
| -r, --range | Video Color Range `HDR`, `HDR10`, `DV`, `SDR` | SDR |
| -w, --wanted | Wanted episodes, e.g. `S01-S05,S07`, `S01E01-S02E03`, `S02-S02E03` | Default to all |
| -le, --latest-episode | Download only the latest episode on episodes list | False |
| -al, --alang | Language wanted for audio. | Defaults to original language |
| -sl, --slang | Language wanted for subtitles. | Defaults to original language |
| --proxy | Proxy URI to use. If a 2-letter country is provided, it will try get a proxy from the config. | None |
@ -74,17 +139,36 @@ Options:
| --no-proxy | Force disable all proxy use. | False |
| -nm, --no-mux | Do not mux the downloaded and decrypted tracks. | False |
| --mux | Force muxing when using --audio-only/--subs-only/--chapters-only. | False |
| -?, -h, --help | Show this message and exit. | |
| -ss, --strip-sdh | Stip SDH subtitles and convert them to CC. Plus fix common errors. | False |
| -mf, --match-forced | Only select forced subtitles matching with specified audio language | False |
| -?, -h, --help | Show this message and exit. | False |
Currently supported platforms:
COMMAND :-
| Alaias | Command | Service Link |
|--------|---------------|--------------------------------------------|
| AMZN | Amazon | https://amazon.com, https://primevideo.com |
| ATVP | AppleTVPlus | https://tv.apple.com |
| DSNP | DisneyPlus | https://disneyplus.com/ |
| HS | Hotstar | https://www.hotstar.com/ |
| HULU | Hulu | https://hulu.com |
| iT | iTunes | https://itunes.apple.com |
| MAX | Max | https://max.com |
| PCOK | Peacock | https://peacocktv.com/ |
Untested or not fully implemeted services:
| Alaias | Command | Service Link |
|--------|-----------------|-----------------------------|
| JC | JioCinema | https://www.jiocinema.com |
| MA | MoviesAnywhere | https://moviesanywhere.com |
| NF | Netflix | https://netflix.com |
| PMTP | ParamountPlus | https://paramountplus.com |
| SL | SonyLiv | https://sonyliv.com |
### Amazon Specific Options
@ -107,12 +191,12 @@ Usage: vt.cmd AMZN [OPTIONS] [TITLE]
Region is chosen automatically based on domain extension found in cookies.
Prime Video specific code will be run if the ASIN is detected to be a prime video variant.
Use 'Amazon Video ASIN Display' for Tampermonkey addon for ASIN
https://greasyfork.org/en/scripts/381997-amazon-video-asin-display
vt dl --list -z uk -q 1080 Amazon B09SLGYLK8
https://greasyfork.org/en/scripts/496577-amazon-video-asin-display
Below flags to be passed after the `AMZN` or `Amazon` keyword in command.
ARGS:
| Command Line Switch | Description |
|-------------------------------------|-----------------------------------------------------------------------------------------------------|
| -b, --bitrate | Video Bitrate Mode to download in. CVBR=Constrained Variable Bitrate, CBR=Constant Bitrate. (CVBR or CBR or CVBR+CBR) |
@ -124,32 +208,87 @@ Below flags to be passed after the `AMZN` or `Amazon` keyword in command.
| -ism, --ism | Set manifest override to SmoothStreaming. Defaults to DASH w/o this flag. |
| -?, -h, --help | Show this message and exit. |
To get UHD/4k with Amazon, navigate to -
To get Atmos/UHD/4k with Amazon, navigate to -
```
https://www.primevideo.com/region/eu/ontv/code?ref_=atv_auth_red_aft
https://www.primevideo.com/mytv
```
Remember that not all titles have 4K/Atmos/HDR/DV.
Login and get to the code pair page. Extract cookies from that page using [Open Cookies.txt](https://chromewebstore.google.com/detail/open-cookiestxt/gdocmgbfkjnnpapoeobnolbbkoibbcif).
Save it to the path `vinetrimmer/Cookies/Amazon/default.txt`.
Save it to the path `vinetrimmer/Cookies/Amazon/default.txt`. Pay attention to path if you are on Linux. Path is case sensitive.
When caching cookies, use a profile without PIN. Otherwise it causes errors.
When caching cookies, use a profile without PIN. Otherwise it may cause errors.
If you are facing 403 or 400 errors even after saving fresh cookies and clearing `Cache` folder, try logging out of your Amazon account in the browser and logging back in. Then save cookies.
Some titles say `UHD/2160p` is available and if VT is saying `no 2160p track available`, then `UHD/2160p` is only available via renting. As in some titles advertise UHD but UHD will not be available to PrimeVideo customers. You will have to rent the title using the Rent button on the title page in UHD quality.
If you are getting an `AssertionError` with Amazon, then try reprovisioning the device. I have included a batch script in the `vinetrimmer/devices/` directory to do this. Simply execute the script and try again.
If you are getting `TooManyDevices` error or Amazon is giving you trouble with some weird error, then logout in the browser, log back in, extract and use fresh cookies. Try also deleting `vinetrimmer/Cache/AMZN/`.
If you want to try a different CDM, you will need the corresponding DeviceTypeID (DTID) put into `amazon.yml`. As far as I know, you would need to sniff the traffic from the device (with the CDM) to get the DTID.
If you are getting `PRS.NoRights` error, then there are 3 possible explantations for it. One, CDM simply needs to be reprovisioned. Two, you are using the incorrect DTID for the given CDM. Three, the Amazon has revoked or downgraded the CDM to only HD/SD quality.
If your region has ad-free subscription tier, you will need the ad-free subscription tier for 4K/HDR/DV.
Newer titles only have 4k in ISM manifest. So you will need to use the `--ism` flag.
### Peacock
- PCOK bans leaked certs quickly (for 4k), be cautious.
- Authorization - cookies saved to `vinetrimmer/Cookies/Peacock/default.txt`
### Hotstar
- To use, login to Hotstar and navigate to https://www.hotstar.com/{region}/home. Extract cookies from that page and save to path `vinetrimmer\Cookies\Hotstar\default.txt` (Case sensitive).
- Otherwise add credentials to `vinetrimmer.yml`. An example is given.
- A free account has access to lots of content.
- Hotstar requires an Indian (+91) phone number to signup to Indian region, even for free account.
- Hates VPN's, get a residential proxy of some sort.
- All content is licensed via Widevine L3 or has no DRM.
### DisneyPlus
- Needs only credentials added to `vinetrimmer.yml`.
- Requires you to use `-m` or `--movie` flag if you are downloading a movie. Append flag to end of your command.
- From my testing, when using with VPN, it causes lots of issues, mainly needing to clear `Cache` folder and login repeatedly. Use residential proxies if available. Don't hammer service. Try waiting a minute or two before logging in again.
- If you are getting `No 2160p track found` error for a title you know has 4k, then try passing `-r DV` or `-r HDR`. Make sure your account can access highest qualities.
- Should be more stable now when using proxy. But do be careful. We don't use proxy for downloading segments, which means your IP could get temporarily banned from DSNP servers (i.e persistent 403 errors). If you download the same title multiple times or many titles/episodes at once/too quickly your IP address could get banned. Happened to me while testing.
### Hulu
- Authorization: cookies saved to `vinetrimmer/Cookies/Hulu/default.txt`
- Windscribe VPN sometimes fails. Simply try again.
### iTunes
```
Authorization: Cookies saved to default.txt
Security: UHD@L1 FHD@L1 HD@L1 SD@L3
```
This is iTunes via rential channel on AppleTVPlus.
Login to iTunes in a browser. Try playing a movie. It'll redirect you to `tv.apple.com`. Cache cookies from that page to `vinetrimmer/Cookies/iTunes/default.txt`.
Requires you to use `-m` or `--movie` flag if you are downloading a movie. Append flag to end of your command.
### Example Command
Amazon Example:
```bash
poetry run vt dl -al en -sl en --selected -q 2160 -r HDR -w S01E18-S01E25 AMZN -b CBR --ism 0IQZZIJ6W6TT2CXPT6ZOZYX396
poetry run vt dl -al en -sl all --selected -q 2160 -r HDR -w S01E18-S01E25 AMZN -b CBR --ism 0IQZZIJ6W6TT2CXPT6ZOZYX396
```
Above command:
- gets english subtitles + audio,
- gets english audio,
- gets all available subtitles,
- selects the HDR + 4K track,
- gets episodes from S01E18 to S01E25 from Amazon
- with CBR bitrate,
@ -159,24 +298,68 @@ Above command:
AppleTV Example:
```bash
poetry run vt dl -al en -sl en --list -q 720 --proxy http://192.168.0.99:9766 -w S01E01 ATVP umc.cmc.1nfdfd5zlk05fo1bwwetzldy3
poetry run vt dl -al en,it -sl en,es -q 720 --proxy http://192.168.0.99:9766 -w S01E01 ATVP umc.cmc.1nfdfd5zlk05fo1bwwetzldy3
```
Above command:
- gets english subtitles + audio,
- gets english, italian audio
- gets english, spanish subtitles,
- lists all possible qualities,
- selects 720p video track,
- uses the proxy for licensing,
- gets the first episode of first season (i.e S01E01)
- of the title umc.cmc.1nfdfd5zlk05fo1bwwetzldy3
- of the title-ID umc.cmc.1nfdfd5zlk05fo1bwwetzldy3
Max Example:
```bash
poetry run vt dl -al en -sl en --keys --proxy http://192.168.0.99:9766 MAX https://play.max.com/show/5756c2bf-36f8-4890-b1f9-ef168f1d8e9c
```
Above command:
- gets english subtitles + audio,
- skips download and only gets the content keys,
- from MAX
- uses specified proxy
- defaulting to HD for video
- title-ID is 5756c2bf-36f8-4890-b1f9-ef168f1d8e9c
Hotstar Example:
```bash
poetry run vt dl -al en -sl en -q 2160 -v H265 HS https://www.hotstar.com/in/movies/hridayam/1260083403
```
Above command:
- gets english subtitles + audio,
- sets video codec to H265 codec,
- sets video quality (ie. resolution) to 2160p,
- Gets highest quality video/audio available.
- title-ID is 1271342309
## Max Audio Compatability (MAC)
I have added a special flag called `--max-audio-compatability` or `-mac` for maximum compatibility with all devices. If passed with `--acodec aac,ec3 -ac 2.0,5.1` will select 3 audios like below
```
2025-04-24 16:54:23 [I] Tracks : ├─ AUD | [E-AC3] | [ec-3] | 5.1 | 640 kb/s | en-US | [Original]
2025-04-24 16:54:23 [I] Tracks : ├─ AUD | [E-AC3] | [ec-3] | 2.0 | 224 kb/s | en-US | [Original]
2025-04-24 16:54:23 [I] Tracks : ├─ AUD | [AAC] | [mp4a] | 2.0 | 128 kb/s | en-US | [Original]
```
If `-mac` not passed but only `--acodec aac,ec3 -ac 2.0,5.1` passed, will select 2 audios.
```
2025-04-24 17:10:04 [I] Tracks : ├─ AUD | [E-AC3] | [ec-3] | 5.1 | 640 kb/s | en-US | [Original]
2025-04-24 17:10:04 [I] Tracks : ├─ AUD | [AAC] | [mp4a] | 2.0 | 128 kb/s | en-US | [Original]
```
## Proxy
I recommend [Windscribe](https://windscribe.com/). You can sign up, getting 10 GB of traffic credit every month for free. We use the VPN for everything except downloading video/audio.
Tested so far on Amazon, AppleTVPlus, Max.
Tested so far on Amazon, AppleTVPlus, Max, and DisneyPlus.
### Steps:
1. For each service, within get_tracks() function we do this below.
1. For each service, within get_tracks() function we do this below. Below is only when you are integrating a new service yourself. Set needs_proxy to True if your service needs proxy to get manifest (Ex - Netflix, Hotstar).
```python
for track in tracks:
track.needs_proxy = False
@ -192,7 +375,7 @@ Tested so far on Amazon, AppleTVPlus, Max.
5. Go to `Options` -> `Connection` -> `Proxy Gateway`. Enable it. Select `Proxy Type` as `HTTP`.
Copy the `IP` field (will look something like `192.168.0.141:9766`)
Copy the `IP` field (will look something like `192.168.0.141:9766`).
Pass above copied to Vinetrimmer with the proxy flag like below.
@ -200,11 +383,125 @@ Tested so far on Amazon, AppleTVPlus, Max.
...(other flags)... --proxy http://192.168.0.141:9766 .......
```
If you are using other VPNs, extract the proxy (use the browser extension to do this). It will look something like `http(s)://username:pass@host/IP:PORT`. Ex -> `https://user:pass@domain.com:443`. Pass it like below:
```bash
...(other flags)... --proxy https://user:pass@domain.com:443 .......
```
## Other
- For `--keys` to work with ATVP you need to pass the `--no-subs` flag also
- Nuikta compile is an option to run on various linux distributions.
- Errors arise when running VT within Docker or Conda like python distributions. Make sure to use proper python3.
- For `--keys` to work with ATVP you need to pass the `--no-subs` flag.
- Errors arise when running VT within Docker or Conda like python environments. Make sure to use proper python3.
- To use programs in `scripts` folder, first activate venv then, then -
```bash
poetry run python scripts/ParseKeybox.py
```
- There is another way of running this instead of using `poetry`. In root folder of VT-PR there is a `vt.py` (which is essentially the same as `vinetrimmer/vinetrimmer.py`). Activate venv, then:
```bash
python vt.py dl ......(rest of the command as before).......
```
This is useful for debugging/stepping through in IDE's without having to deal with poetry.
- Nuitka compile:
- Activate venv, then
- `python -m pip install nuitka`
- Verify using command `nuitka --version`
- Then:
```bash
nuitka --standalone --output-dir=dist --windows-console-mode=force vt.py --include-data-dir=./vinetrimmer/=vinetrimmer/ --include-data-dir=./binaries/=binaries
```
- `--standalone` will give a folder of compiled pythonic objects. Zip it to distribute. This is recommended.
- If you don't want to carry around/deal with a zip, instead use `--onefile`. This has the drawback of setting the default folders to the temp folder in whatever OS you are using. This could be fixed with some extra code but that is currently not implemented.
- Refer to [link](https://nuitka.net/user-documentation/user-manual.html) if anything errors out.
## Broken / To-Do (Descending order of priority)
- [ ] First stable release
- [ ] Shaka with progress bar repository
- [ ] Add download speed limit to avoid IP bans.
- [ ] Linux support - Debian/Ubuntu/Mint + Fix service config load for Linux.
- [ ] Single script that installs, and if already installed checks for and applies updates
- [ ] Replace poetry with uv
- [ ] Add [m4ffdecrypt](https://github.com/Eyevinn/mp4ff)
- [ ] Add a version.py
- [ ] Downloader field in config, per service.
- [ ] Make a script to download latest binaries for vt automatically at startup.
- [ ] Detect if running as Nuikta compiled binary, then in vt.py set directories relative to binary path
- [ ] Find a way to estimate final file size for a track. Check if enough space is left on disc for double the amount of selected tracks - since mp4decrypt and Nm3u8 both make copies of the files
- [ ] Merge DB script
- [ ] Latest mkvtoolnix for linux
- [ ] Modify aria2c to include a progress bar ?
- [ ] Github Actions Python script that builds and publishes release for every commit to not readme.md
- [ ] MAX - Fix HDR10/DV --list
- [ ] Fix original language (Was removed as workaround for a bug)
- [ ] Fix `-sl all` and `-al all`
- [ ] Make a windscribe.py for proxies modelled after nordvpn.py. Refer to the chrome extension for the code.
- [ ] Move to requests, curl or otherwise to download subtitles (?)
- [ ] Replace track.dv, track.hdr10 with track.PQ. Value will be an enum. This will require a major-ish rewrite.
- [ ] Netflix service is currently broken (will probably be fixed Soon™)
- [ ] Integrate [subby](https://github.com/vevv/subby)
- [ ] Licensing before download (?)
- [ ] Test and fix MoviesAnywhere, ParamountPlus, services.
- [ ] Guide for writing a service + debugging
- [ ] Implement a scan/hammer/cache keys for each service - pass string of zeros as title id. Then copy and rework dl.py to iterate over returned list of titles from scan function
### Amazon Specific
- [ ] Refresh Token for Amazon service
- [ ] Pythonic implementation of init.mp4 builder for ism manifest for avc, hvcc, dv, ac3, eac3, eac3-joc codecs
- [ ] Make a pure python requests based downloader for ISM/MSS manifest. Write init.mp4 then download each segment to memory, decrypt in memory and write it to a binary merged file. Download segments in batches. Batch size based on thread count passed to program. Download has to be sequentially written.
- [ ] `--bitrate CVBR+CBR` is currently broken
- [ ] Get highest quality CBR and CVBR MPD+ISM by default to AMZN
- [ ] Specify devices in config for MPD or ISM then load one based on command
- [ ] For videos, download init.mp4 using N_m3u8, mediainfo it to get FPS, HDR info
- [ ] Manifest url caching system for every key/Track object.
If anyone has any idea how to fix above issues, feel free to open a pull request.
## Donating
I am an independent developer right now. I work on this project in my free time. If you could support me that would be immensely helpful. All supporters will get a special mention in the README. Thank you in advance.
My BuyMeACoffee account was suspended so contact me on discord to donate.
My Discord is `@crapola` or `@chupola`. You will need to join a server I'm in to message me. Join one of the servers mentioned below.
## Credits
[@rlaphoenix](https://github.com/rlaphoenix) for [pywidevine](https://github.com/devine-dl/pywidevine)
[@rlaphoenix](https://github.com/rlaphoenix) again as he was the original developer behind the `VineTrimmer` base `Widevine` version (later renamed to `devine`) .
[@DevLARLEY](https://github.com/DevLARLEY) for [pyplayready](https://git.gay/ready-dl/pyplayready)
[@FieryFly](https://github.com/FieryFly) for an additional MAX fix.
[@vevv](https://github.com/vevv) for [subby](https://github.com/vevv/subby)
[@globocom](https://github.com/globocom/) for [m3u8](https://github.com/globocom/m3u8)
`@Wiesiek` on Discord for a few ideas
[DRM-Lab-Project](https://discord.gg/xHjetwZP) for numerous bug fixes and support.
[Playready-Discord](https://discord.gg/aNNKxurrU6) for numerous bug fixes and support.
Various members of the above mentioned Discord servers for testing, bug reporting, fixes etc. Thank You :)
[CDRM-Project](https://discord.cdrm-project.com/) and `@TPD94`, `@radizu` for getting me started on this journey, being a source of inspiration and for keeping a community well and alive.
[@m0ck69](https://github.com/m0ck69) for sharing a DisneyPlus account for testing purposes.
[@methflix](https://github.com/methflix) for sharing a Hulu account for testing purposes.
The services included here were not written by me. They were either found in the mentioned Discord servers or shared by an individual. If anyone feels like they deserve a credit in the README, open an issue and I'll add you.
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=chu23465/VT-PR&type=Date)](https://www.star-history.com/#chu23465/VT-PR&Date)

Binary file not shown.

BIN
binaries/dovi_tool.exe Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,8 +15,6 @@ poetry run vt dl -al en -sl en -q 2160 -r HDR --selected -w S05E08-S05E24 AMZN -
python vinetrimmer1.py dl -al en -sl en -q 2160 -r HDR --selected -w S05E09-S05E24 AMZN -b CBR 0IQZZIJ6W6TT2CXPT6ZOZYX396
poetry run vt dl -al en -sl en --selected -q 2160 -r HDR -w S01E18-S01E25 AMZN -b CBR --ism 0IQZZIJ6W6TT2CXPT6ZOZYX396
Atmos audio download AMZN to fix --> poetry run vt dl -al en -aa -sl en --selected --debug -w S01E01 -A AMZN -b CBR --ism 0HAQAA7JM43QWX0H6GUD3IOF70
http://ABHIRCQAAAAAAAAMCX3W7WLVKL54A.s3-bom-ww.cf.smooth.row.aiv-cdn.net/e5b0/2fe1/032c/4fae-b896-aca9d8bef3d4/170b36b1-856d-4c69-bbf6-feb6c979185a.ism/manifest
poetry run vt dl -al en -sl en -r HDR -w S01E01 --list -q 2160 AMZN https://www.primevideo.com/detail/0HU52DR3U1R0FGI3KSUL00XYY7
https://www.primevideo.com/detail/0HU52DR3U1R0FGI3KSUL00XYY7/

25
install.sh Normal file
View File

@ -0,0 +1,25 @@
git clone -b dev --single-branch https://github.com/chu23465/VT-PR
cd VT-PR
python -m pip install poetry==1.8.5
poetry config virtualenvs.in-project true
poetry lock --no-update
poetry install
sudo add-apt-repository ppa:ubuntuhandbook1/apps -y
sudo apt update
sudo apt-get install ffmpeg aria2 mkvtoolnix libmediainfo0v5
ffmpeg --version
ffprobe --version
ffplay --version
aria2c --version
mkvmerge --version
rm -r ./binaries/
mkdir ./binaries/
mv -v ./linux_binaries/* ./binaries/
which aria2c | xargs -I{} cp {} ./binaries/
which ffmpeg | xargs -I{} cp {} ./binaries/
which ffprobe | xargs -I{} cp {} ./binaries/
which ffplay | xargs -I{} cp {} ./binaries/
which mkvmerge | xargs -I{} cp {} ./binaries/
cd ./binaries/
find . -type f -print0 | xargs -0 chmod +x
chmod +x *

BIN
linux_binaries/N_m3u8DL-RE Normal file

Binary file not shown.

BIN
linux_binaries/dovi_tool Normal file

Binary file not shown.

Binary file not shown.

BIN
linux_binaries/mp4decrypt Normal file

Binary file not shown.

BIN
linux_binaries/mp4dump Normal file

Binary file not shown.

BIN
linux_binaries/packager Normal file

Binary file not shown.

14
make.ps1 Normal file
View File

@ -0,0 +1,14 @@
# Tip: add argument `run` to directly run after build for fast testing
Write-Output 'Creating Python Wheel package via Poetry'
& 'poetry' build -f wheel
Write-Output 'Building to self-contained folder/app via PyInstaller'
& 'poetry' run python pyinstaller.py
if ($args[0] -eq 'run') {
& 'dist/vinetrimmer/vinetrimmer.exe' ($args | Select-Object -Skip 1)
exit
}
Write-Output 'Done! See /dist for output files.'

17
make.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# Tip: add argument `run` to directly run after build for fast testing
echo 'Creating Python Wheel package via Poetry'
poetry build -f wheel
echo 'Building to self-contained folder/app via PyInstaller'
poetry run python pyinstaller.py
if [ "$1" = 'run' ]; then
shift
./dist/vinetrimmer/vinetrimmer "$@"
exit
fi
echo 'Done! See /dist for output files.'

773
poetry.lock generated
View File

@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
[[package]]
name = "altgraph"
@ -44,198 +44,84 @@ files = [
{file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"},
]
[[package]]
name = "backports-datetime-fromisoformat"
version = "2.0.3"
description = "Backport of Python 3.11's datetime.fromisoformat"
optional = false
python-versions = ">3"
files = [
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f681f638f10588fa3c101ee9ae2b63d3734713202ddfcfb6ec6cea0778a29d4"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:cd681460e9142f1249408e5aee6d178c6d89b49e06d44913c8fdfb6defda8d1c"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:ee68bc8735ae5058695b76d3bb2aee1d137c052a11c8303f1e966aa23b72b65b"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8273fe7932db65d952a43e238318966eab9e49e8dd546550a41df12175cc2be4"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39d57ea50aa5a524bb239688adc1d1d824c31b6094ebd39aa164d6cadb85de22"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ac6272f87693e78209dc72e84cf9ab58052027733cd0721c55356d3c881791cf"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:44c497a71f80cd2bcfc26faae8857cf8e79388e3d5fbf79d2354b8c360547d58"},
{file = "backports_datetime_fromisoformat-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:6335a4c9e8af329cb1ded5ab41a666e1448116161905a94e054f205aa6d263bc"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2e4b66e017253cdbe5a1de49e0eecff3f66cd72bcb1229d7db6e6b1832c0443"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:43e2d648e150777e13bbc2549cc960373e37bf65bd8a5d2e0cef40e16e5d8dd0"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:4ce6326fd86d5bae37813c7bf1543bae9e4c215ec6f5afe4c518be2635e2e005"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7c8fac333bf860208fd522a5394369ee3c790d0aa4311f515fcc4b6c5ef8d75"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24a4da5ab3aa0cc293dc0662a0c6d1da1a011dc1edcbc3122a288cfed13a0b45"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:58ea11e3bf912bd0a36b0519eae2c5b560b3cb972ea756e66b73fb9be460af01"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8a375c7dbee4734318714a799b6c697223e4bbb57232af37fbfff88fb48a14c6"},
{file = "backports_datetime_fromisoformat-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:ac677b1664c4585c2e014739f6678137c8336815406052349c85898206ec7061"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:66ce47ee1ba91e146149cf40565c3d750ea1be94faf660ca733d8601e0848147"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:8b7e069910a66b3bba61df35b5f879e5253ff0821a70375b9daf06444d046fa4"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_x86_64.whl", hash = "sha256:a3b5d1d04a9e0f7b15aa1e647c750631a873b298cdd1255687bb68779fe8eb35"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec1b95986430e789c076610aea704db20874f0781b8624f648ca9fb6ef67c6e1"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffe5f793db59e2f1d45ec35a1cf51404fdd69df9f6952a0c87c3060af4c00e32"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:620e8e73bd2595dfff1b4d256a12b67fce90ece3de87b38e1dde46b910f46f4d"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4cf9c0a985d68476c1cabd6385c691201dda2337d7453fb4da9679ce9f23f4e7"},
{file = "backports_datetime_fromisoformat-2.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:d144868a73002e6e2e6fef72333e7b0129cecdd121aa8f1edba7107fd067255d"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e81b26497a17c29595bc7df20bc6a872ceea5f8c9d6537283945d4b6396aec10"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:5ba00ead8d9d82fd6123eb4891c566d30a293454e54e32ff7ead7644f5f7e575"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:24d574cb4072e1640b00864e94c4c89858033936ece3fc0e1c6f7179f120d0a8"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9735695a66aad654500b0193525e590c693ab3368478ce07b34b443a1ea5e824"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63d39709e17eb72685d052ac82acf0763e047f57c86af1b791505b1fec96915d"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:1ea2cc84224937d6b9b4c07f5cb7c667f2bde28c255645ba27f8a675a7af8234"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4024e6d35a9fdc1b3fd6ac7a673bd16cb176c7e0b952af6428b7129a70f72cce"},
{file = "backports_datetime_fromisoformat-2.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:5e2dcc94dc9c9ab8704409d86fcb5236316e9dcef6feed8162287634e3568f4c"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fa2de871801d824c255fac7e5e7e50f2be6c9c376fd9268b40c54b5e9da91f42"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:1314d4923c1509aa9696712a7bc0c7160d3b7acf72adafbbe6c558d523f5d491"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:b750ecba3a8815ad8bc48311552f3f8ab99dd2326d29df7ff670d9c49321f48f"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2d5117dce805d8a2f78baeddc8c6127281fa0a5e2c40c6dd992ba6b2b367876"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb35f607bd1cbe37b896379d5f5ed4dc298b536f4b959cb63180e05cacc0539d"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:61c74710900602637d2d145dda9720c94e303380803bf68811b2a151deec75c2"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:ece59af54ebf67ecbfbbf3ca9066f5687879e36527ad69d8b6e3ac565d565a62"},
{file = "backports_datetime_fromisoformat-2.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:d0a7c5f875068efe106f62233bc712d50db4d07c13c7db570175c7857a7b5dbd"},
{file = "backports_datetime_fromisoformat-2.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90e202e72a3d5aae673fcc8c9a4267d56b2f532beeb9173361293625fe4d2039"},
{file = "backports_datetime_fromisoformat-2.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2df98ef1b76f5a58bb493dda552259ba60c3a37557d848e039524203951c9f06"},
{file = "backports_datetime_fromisoformat-2.0.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7100adcda5e818b5a894ad0626e38118bb896a347f40ebed8981155675b9ba7b"},
{file = "backports_datetime_fromisoformat-2.0.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e410383f5d6a449a529d074e88af8bc80020bb42b402265f9c02c8358c11da5"},
{file = "backports_datetime_fromisoformat-2.0.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2797593760da6bcc32c4a13fa825af183cd4bfd333c60b3dbf84711afca26ef"},
{file = "backports_datetime_fromisoformat-2.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35a144fd681a0bea1013ccc4cd3fd4dc758ea17ee23dca019c02b82ec46fc0c4"},
{file = "backports_datetime_fromisoformat-2.0.3.tar.gz", hash = "sha256:b58edc8f517b66b397abc250ecc737969486703a66eb97e01e6d51291b1a139d"},
]
[[package]]
name = "beautifulsoup4"
version = "4.8.2"
version = "4.13.3"
description = "Screen-scraping library"
optional = false
python-versions = "*"
python-versions = ">=3.7.0"
files = [
{file = "beautifulsoup4-4.8.2-py2-none-any.whl", hash = "sha256:e1505eeed31b0f4ce2dbb3bc8eb256c04cc2b3b72af7d551a4ab6efd5cbe5dae"},
{file = "beautifulsoup4-4.8.2-py3-none-any.whl", hash = "sha256:9fbb4d6e48ecd30bcacc5b63b94088192dcda178513b2ae3c394229f8911b887"},
{file = "beautifulsoup4-4.8.2.tar.gz", hash = "sha256:05fd825eb01c290877657a56df4c6e4c311b3965bda790c613a3d6fb01a5462a"},
{file = "beautifulsoup4-4.13.3-py3-none-any.whl", hash = "sha256:99045d7d3f08f91f0d656bc9b7efbae189426cd913d830294a15eefa0ea4df16"},
{file = "beautifulsoup4-4.13.3.tar.gz", hash = "sha256:1bd32405dacc920b42b83ba01644747ed77456a65760e285fbc47633ceddaf8b"},
]
[package.dependencies]
soupsieve = ">=1.2"
soupsieve = ">1.2"
typing-extensions = ">=4.0.0"
[package.extras]
cchardet = ["cchardet"]
chardet = ["chardet"]
charset-normalizer = ["charset-normalizer"]
html5lib = ["html5lib"]
lxml = ["lxml"]
[[package]]
name = "brotli"
version = "1.1.0"
description = "Python bindings for the Brotli compression library"
optional = false
python-versions = "*"
files = [
{file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e1140c64812cb9b06c922e77f1c26a75ec5e3f0fb2bf92cc8c58720dec276752"},
{file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8fd5270e906eef71d4a8d19b7c6a43760c6abcfcc10c9101d14eb2357418de9"},
{file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ae56aca0402a0f9a3431cddda62ad71666ca9d4dc3a10a142b9dce2e3c0cda3"},
{file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43ce1b9935bfa1ede40028054d7f48b5469cd02733a365eec8a329ffd342915d"},
{file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7c4855522edb2e6ae7fdb58e07c3ba9111e7621a8956f481c68d5d979c93032e"},
{file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:38025d9f30cf4634f8309c6874ef871b841eb3c347e90b0851f63d1ded5212da"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e6a904cb26bfefc2f0a6f240bdf5233be78cd2488900a2f846f3c3ac8489ab80"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"},
{file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"},
{file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"},
{file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"},
{file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c8146669223164fc87a7e3de9f81e9423c67a79d6b3447994dfb9c95da16e2d6"},
{file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30924eb4c57903d5a7526b08ef4a584acc22ab1ffa085faceb521521d2de32dd"},
{file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ceb64bbc6eac5a140ca649003756940f8d6a7c444a68af170b3187623b43bebf"},
{file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a469274ad18dc0e4d316eefa616d1d0c2ff9da369af19fa6f3daa4f09671fd61"},
{file = "Brotli-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524f35912131cc2cabb00edfd8d573b07f2d9f21fa824bd3fb19725a9cf06327"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5b3cc074004d968722f51e550b41a27be656ec48f8afaeeb45ebf65b561481dd"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"},
{file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"},
{file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f4bf76817c14aa98cc6697ac02f3972cb8c3da93e9ef16b9c66573a68014f91"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0c5516f0aed654134a2fc936325cc2e642f8a0e096d075209672eb321cff408"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c3020404e0b5eefd7c9485ccf8393cfb75ec38ce75586e046573c9dc29967a0"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4ed11165dd45ce798d99a136808a794a748d5dc38511303239d4e2363c0695dc"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"},
{file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"},
{file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"},
{file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"},
{file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"},
{file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"},
{file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"},
{file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"},
{file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"},
{file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"},
{file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"},
{file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"},
{file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"},
{file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"},
{file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"},
{file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4d4a848d1837973bf0f4b5e54e3bec977d99be36a7895c61abb659301b02c112"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:fdc3ff3bfccdc6b9cc7c342c03aa2400683f0cb891d46e94b64a197910dc4064"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:5eeb539606f18a0b232d4ba45adccde4125592f3f636a6182b4a8a436548b914"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"},
{file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"},
{file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"},
{file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"},
{file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f733d788519c7e3e71f0855c96618720f5d3d60c3cb829d8bbb722dddce37985"},
{file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:929811df5462e182b13920da56c6e0284af407d1de637d8e536c5cd00a7daf60"},
{file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b63b949ff929fbc2d6d3ce0e924c9b93c9785d877a21a1b678877ffbbc4423a"},
{file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d192f0f30804e55db0d0e0a35d83a9fead0e9a359a9ed0285dbacea60cc10a84"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f296c40e23065d0d6650c4aefe7470d2a25fffda489bcc3eb66083f3ac9f6643"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"},
{file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"},
{file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"},
{file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"},
{file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:03d20af184290887bdea3f0f78c4f737d126c74dc2f3ccadf07e54ceca3bf208"},
{file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6172447e1b368dcbc458925e5ddaf9113477b0ed542df258d84fa28fc45ceea7"},
{file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a743e5a28af5f70f9c080380a5f908d4d21d40e8f0e0c8901604d15cfa9ba751"},
{file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0541e747cce78e24ea12d69176f6a7ddb690e62c425e01d31cc065e69ce55b48"},
{file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cdbc1fc1bc0bff1cef838eafe581b55bfbffaed4ed0318b724d0b71d4d377619"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:890b5a14ce214389b2cc36ce82f3093f96f4cc730c1cffdbefff77a7c71f2a97"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"},
{file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"},
{file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"},
{file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"},
{file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7905193081db9bfa73b1219140b3d315831cbff0d8941f22da695832f0dd188f"},
{file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a77def80806c421b4b0af06f45d65a136e7ac0bdca3c09d9e2ea4e515367c7e9"},
{file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dadd1314583ec0bf2d1379f7008ad627cd6336625d6679cf2f8e67081b83acf"},
{file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:901032ff242d479a0efa956d853d16875d42157f98951c0230f69e69f9c09bac"},
{file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22fc2a8549ffe699bfba2256ab2ed0421a7b8fadff114a3d201794e45a9ff578"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ae15b066e5ad21366600ebec29a7ccbc86812ed267e4b28e860b8ca16a2bc474"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"},
{file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"},
{file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"},
{file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"},
]
[[package]]
name = "brotlicffi"
version = "1.1.0.0"
description = "Python CFFI bindings to the Brotli library"
optional = false
python-versions = ">=3.7"
files = [
{file = "brotlicffi-1.1.0.0-cp37-abi3-macosx_10_9_x86_64.whl", hash = "sha256:9b7ae6bd1a3f0df532b6d67ff674099a96d22bc0948955cb338488c31bfb8851"},
{file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19ffc919fa4fc6ace69286e0a23b3789b4219058313cf9b45625016bf7ff996b"},
{file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9feb210d932ffe7798ee62e6145d3a757eb6233aa9a4e7db78dd3690d7755814"},
{file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84763dbdef5dd5c24b75597a77e1b30c66604725707565188ba54bab4f114820"},
{file = "brotlicffi-1.1.0.0-cp37-abi3-win32.whl", hash = "sha256:1b12b50e07c3911e1efa3a8971543e7648100713d4e0971b13631cce22c587eb"},
{file = "brotlicffi-1.1.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:994a4f0681bb6c6c3b0925530a1926b7a189d878e6e5e38fae8efa47c5d9c613"},
{file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2e4aeb0bd2540cb91b069dbdd54d458da8c4334ceaf2d25df2f4af576d6766ca"},
{file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b7b0033b0d37bb33009fb2fef73310e432e76f688af76c156b3594389d81391"},
{file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54a07bb2374a1eba8ebb52b6fafffa2afd3c4df85ddd38fcc0511f2bb387c2a8"},
{file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7901a7dc4b88f1c1475de59ae9be59799db1007b7d059817948d8e4f12e24e35"},
{file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce01c7316aebc7fce59da734286148b1d1b9455f89cf2c8a4dfce7d41db55c2d"},
{file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:246f1d1a90279bb6069de3de8d75a8856e073b8ff0b09dcca18ccc14cec85979"},
{file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc4bc5d82bc56ebd8b514fb8350cfac4627d6b0743382e46d033976a5f80fab6"},
{file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37c26ecb14386a44b118ce36e546ce307f4810bc9598a6e6cb4f7fca725ae7e6"},
{file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca72968ae4eaf6470498d5c2887073f7efe3b1e7d7ec8be11a06a79cc810e990"},
{file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:add0de5b9ad9e9aa293c3aa4e9deb2b61e99ad6c1634e01d01d98c03e6a354cc"},
{file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9b6068e0f3769992d6b622a1cd2e7835eae3cf8d9da123d7f51ca9c1e9c333e5"},
{file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8557a8559509b61e65083f8782329188a250102372576093c88930c875a69838"},
{file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a7ae37e5d79c5bdfb5b4b99f2715a6035e6c5bf538c3746abc8e26694f92f33"},
{file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391151ec86bb1c683835980f4816272a87eaddc46bb91cbf44f62228b84d8cca"},
{file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:2f3711be9290f0453de8eed5275d93d286abe26b08ab4a35d7452caa1fef532f"},
{file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a807d760763e398bbf2c6394ae9da5815901aa93ee0a37bca5efe78d4ee3171"},
{file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fa8ca0623b26c94fccc3a1fdd895be1743b838f3917300506d04aa3346fd2a14"},
{file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3de0cf28a53a3238b252aca9fed1593e9d36c1d116748013339f0949bfc84112"},
{file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6be5ec0e88a4925c91f3dea2bb0013b3a2accda6f77238f76a34a1ea532a1cb0"},
{file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:d9eb71bb1085d996244439154387266fd23d6ad37161f6f52f1cd41dd95a3808"},
{file = "brotlicffi-1.1.0.0.tar.gz", hash = "sha256:b77827a689905143f87915310b93b273ab17888fd43ef350d4832c4a71083c13"},
]
[package.dependencies]
cffi = ">=1.0.0"
[[package]]
name = "build"
version = "1.2.2.post1"
@ -915,28 +801,6 @@ perf = ["ipython"]
test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"]
type = ["pytest-mypy"]
[[package]]
name = "importlib-resources"
version = "6.4.5"
description = "Read resources from Python packages"
optional = false
python-versions = ">=3.8"
files = [
{file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"},
{file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"},
]
[package.dependencies]
zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""}
[package.extras]
check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"]
cover = ["pytest-cov"]
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
enabler = ["pytest-enabler (>=2.2)"]
test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "zipp (>=3.17)"]
type = ["pytest-mypy"]
[[package]]
name = "installer"
version = "0.7.0"
@ -948,17 +812,6 @@ files = [
{file = "installer-0.7.0.tar.gz", hash = "sha256:a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631"},
]
[[package]]
name = "iso8601"
version = "2.1.0"
description = "Simple module to parse ISO 8601 dates"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "iso8601-2.1.0-py3-none-any.whl", hash = "sha256:aac4145c4dcb66ad8b648a02830f5e2ff6c24af20f4f482689be402db2429242"},
{file = "iso8601-2.1.0.tar.gz", hash = "sha256:6b1d3829ee8921c4301998c909f7829fa9ed3cbdac0d3b16af2d743aed1ba8df"},
]
[[package]]
name = "isodate"
version = "0.6.1"
@ -1049,7 +902,6 @@ files = [
[package.dependencies]
importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""}
importlib-resources = {version = "*", markers = "python_version < \"3.9\""}
"jaraco.classes" = "*"
jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""}
pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""}
@ -1098,125 +950,173 @@ test = ["pytest", "pytest-cov"]
[[package]]
name = "lxml"
version = "4.9.4"
version = "5.3.2"
description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*"
python-versions = ">=3.6"
files = [
{file = "lxml-4.9.4-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e214025e23db238805a600f1f37bf9f9a15413c7bf5f9d6ae194f84980c78722"},
{file = "lxml-4.9.4-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:ec53a09aee61d45e7dbe7e91252ff0491b6b5fee3d85b2d45b173d8ab453efc1"},
{file = "lxml-4.9.4-cp27-cp27m-win32.whl", hash = "sha256:7d1d6c9e74c70ddf524e3c09d9dc0522aba9370708c2cb58680ea40174800013"},
{file = "lxml-4.9.4-cp27-cp27m-win_amd64.whl", hash = "sha256:cb53669442895763e61df5c995f0e8361b61662f26c1b04ee82899c2789c8f69"},
{file = "lxml-4.9.4-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:647bfe88b1997d7ae8d45dabc7c868d8cb0c8412a6e730a7651050b8c7289cf2"},
{file = "lxml-4.9.4-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:4d973729ce04784906a19108054e1fd476bc85279a403ea1a72fdb051c76fa48"},
{file = "lxml-4.9.4-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:056a17eaaf3da87a05523472ae84246f87ac2f29a53306466c22e60282e54ff8"},
{file = "lxml-4.9.4-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:aaa5c173a26960fe67daa69aa93d6d6a1cd714a6eb13802d4e4bd1d24a530644"},
{file = "lxml-4.9.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:647459b23594f370c1c01768edaa0ba0959afc39caeeb793b43158bb9bb6a663"},
{file = "lxml-4.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:bdd9abccd0927673cffe601d2c6cdad1c9321bf3437a2f507d6b037ef91ea307"},
{file = "lxml-4.9.4-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:00e91573183ad273e242db5585b52670eddf92bacad095ce25c1e682da14ed91"},
{file = "lxml-4.9.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:a602ed9bd2c7d85bd58592c28e101bd9ff9c718fbde06545a70945ffd5d11868"},
{file = "lxml-4.9.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:de362ac8bc962408ad8fae28f3967ce1a262b5d63ab8cefb42662566737f1dc7"},
{file = "lxml-4.9.4-cp310-cp310-win32.whl", hash = "sha256:33714fcf5af4ff7e70a49731a7cc8fd9ce910b9ac194f66eaa18c3cc0a4c02be"},
{file = "lxml-4.9.4-cp310-cp310-win_amd64.whl", hash = "sha256:d3caa09e613ece43ac292fbed513a4bce170681a447d25ffcbc1b647d45a39c5"},
{file = "lxml-4.9.4-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:359a8b09d712df27849e0bcb62c6a3404e780b274b0b7e4c39a88826d1926c28"},
{file = "lxml-4.9.4-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:43498ea734ccdfb92e1886dfedaebeb81178a241d39a79d5351ba2b671bff2b2"},
{file = "lxml-4.9.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4855161013dfb2b762e02b3f4d4a21cc7c6aec13c69e3bffbf5022b3e708dd97"},
{file = "lxml-4.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c71b5b860c5215fdbaa56f715bc218e45a98477f816b46cfde4a84d25b13274e"},
{file = "lxml-4.9.4-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:9a2b5915c333e4364367140443b59f09feae42184459b913f0f41b9fed55794a"},
{file = "lxml-4.9.4-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d82411dbf4d3127b6cde7da0f9373e37ad3a43e89ef374965465928f01c2b979"},
{file = "lxml-4.9.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:273473d34462ae6e97c0f4e517bd1bf9588aa67a1d47d93f760a1282640e24ac"},
{file = "lxml-4.9.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:389d2b2e543b27962990ab529ac6720c3dded588cc6d0f6557eec153305a3622"},
{file = "lxml-4.9.4-cp311-cp311-win32.whl", hash = "sha256:8aecb5a7f6f7f8fe9cac0bcadd39efaca8bbf8d1bf242e9f175cbe4c925116c3"},
{file = "lxml-4.9.4-cp311-cp311-win_amd64.whl", hash = "sha256:c7721a3ef41591341388bb2265395ce522aba52f969d33dacd822da8f018aff8"},
{file = "lxml-4.9.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:dbcb2dc07308453db428a95a4d03259bd8caea97d7f0776842299f2d00c72fc8"},
{file = "lxml-4.9.4-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:01bf1df1db327e748dcb152d17389cf6d0a8c5d533ef9bab781e9d5037619229"},
{file = "lxml-4.9.4-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:e8f9f93a23634cfafbad6e46ad7d09e0f4a25a2400e4a64b1b7b7c0fbaa06d9d"},
{file = "lxml-4.9.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3f3f00a9061605725df1816f5713d10cd94636347ed651abdbc75828df302b20"},
{file = "lxml-4.9.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:953dd5481bd6252bd480d6ec431f61d7d87fdcbbb71b0d2bdcfc6ae00bb6fb10"},
{file = "lxml-4.9.4-cp312-cp312-win32.whl", hash = "sha256:266f655d1baff9c47b52f529b5f6bec33f66042f65f7c56adde3fcf2ed62ae8b"},
{file = "lxml-4.9.4-cp312-cp312-win_amd64.whl", hash = "sha256:f1faee2a831fe249e1bae9cbc68d3cd8a30f7e37851deee4d7962b17c410dd56"},
{file = "lxml-4.9.4-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:23d891e5bdc12e2e506e7d225d6aa929e0a0368c9916c1fddefab88166e98b20"},
{file = "lxml-4.9.4-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e96a1788f24d03e8d61679f9881a883ecdf9c445a38f9ae3f3f193ab6c591c66"},
{file = "lxml-4.9.4-cp36-cp36m-macosx_11_0_x86_64.whl", hash = "sha256:5557461f83bb7cc718bc9ee1f7156d50e31747e5b38d79cf40f79ab1447afd2d"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:fdb325b7fba1e2c40b9b1db407f85642e32404131c08480dd652110fc908561b"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d74d4a3c4b8f7a1f676cedf8e84bcc57705a6d7925e6daef7a1e54ae543a197"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ac7674d1638df129d9cb4503d20ffc3922bd463c865ef3cb412f2c926108e9a4"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:ddd92e18b783aeb86ad2132d84a4b795fc5ec612e3545c1b687e7747e66e2b53"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2bd9ac6e44f2db368ef8986f3989a4cad3de4cd55dbdda536e253000c801bcc7"},
{file = "lxml-4.9.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:bc354b1393dce46026ab13075f77b30e40b61b1a53e852e99d3cc5dd1af4bc85"},
{file = "lxml-4.9.4-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:f836f39678cb47c9541f04d8ed4545719dc31ad850bf1832d6b4171e30d65d23"},
{file = "lxml-4.9.4-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:9c131447768ed7bc05a02553d939e7f0e807e533441901dd504e217b76307745"},
{file = "lxml-4.9.4-cp36-cp36m-win32.whl", hash = "sha256:bafa65e3acae612a7799ada439bd202403414ebe23f52e5b17f6ffc2eb98c2be"},
{file = "lxml-4.9.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6197c3f3c0b960ad033b9b7d611db11285bb461fc6b802c1dd50d04ad715c225"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:7b378847a09d6bd46047f5f3599cdc64fcb4cc5a5a2dd0a2af610361fbe77b16"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:1343df4e2e6e51182aad12162b23b0a4b3fd77f17527a78c53f0f23573663545"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:6dbdacf5752fbd78ccdb434698230c4f0f95df7dd956d5f205b5ed6911a1367c"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:506becdf2ecaebaf7f7995f776394fcc8bd8a78022772de66677c84fb02dd33d"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ca8e44b5ba3edb682ea4e6185b49661fc22b230cf811b9c13963c9f982d1d964"},
{file = "lxml-4.9.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:9d9d5726474cbbef279fd709008f91a49c4f758bec9c062dfbba88eab00e3ff9"},
{file = "lxml-4.9.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:bbdd69e20fe2943b51e2841fc1e6a3c1de460d630f65bde12452d8c97209464d"},
{file = "lxml-4.9.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8671622256a0859f5089cbe0ce4693c2af407bc053dcc99aadff7f5310b4aa02"},
{file = "lxml-4.9.4-cp37-cp37m-win32.whl", hash = "sha256:dd4fda67f5faaef4f9ee5383435048ee3e11ad996901225ad7615bc92245bc8e"},
{file = "lxml-4.9.4-cp37-cp37m-win_amd64.whl", hash = "sha256:6bee9c2e501d835f91460b2c904bc359f8433e96799f5c2ff20feebd9bb1e590"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:1f10f250430a4caf84115b1e0f23f3615566ca2369d1962f82bef40dd99cd81a"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:3b505f2bbff50d261176e67be24e8909e54b5d9d08b12d4946344066d66b3e43"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:1449f9451cd53e0fd0a7ec2ff5ede4686add13ac7a7bfa6988ff6d75cff3ebe2"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:4ece9cca4cd1c8ba889bfa67eae7f21d0d1a2e715b4d5045395113361e8c533d"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:59bb5979f9941c61e907ee571732219fa4774d5a18f3fa5ff2df963f5dfaa6bc"},
{file = "lxml-4.9.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b1980dbcaad634fe78e710c8587383e6e3f61dbe146bcbfd13a9c8ab2d7b1192"},
{file = "lxml-4.9.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9ae6c3363261021144121427b1552b29e7b59de9d6a75bf51e03bc072efb3c37"},
{file = "lxml-4.9.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bcee502c649fa6351b44bb014b98c09cb00982a475a1912a9881ca28ab4f9cd9"},
{file = "lxml-4.9.4-cp38-cp38-win32.whl", hash = "sha256:a8edae5253efa75c2fc79a90068fe540b197d1c7ab5803b800fccfe240eed33c"},
{file = "lxml-4.9.4-cp38-cp38-win_amd64.whl", hash = "sha256:701847a7aaefef121c5c0d855b2affa5f9bd45196ef00266724a80e439220e46"},
{file = "lxml-4.9.4-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:f610d980e3fccf4394ab3806de6065682982f3d27c12d4ce3ee46a8183d64a6a"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:aa9b5abd07f71b081a33115d9758ef6077924082055005808f68feccb27616bd"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:365005e8b0718ea6d64b374423e870648ab47c3a905356ab6e5a5ff03962b9a9"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:16b9ec51cc2feab009e800f2c6327338d6ee4e752c76e95a35c4465e80390ccd"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:a905affe76f1802edcac554e3ccf68188bea16546071d7583fb1b693f9cf756b"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fd814847901df6e8de13ce69b84c31fc9b3fb591224d6762d0b256d510cbf382"},
{file = "lxml-4.9.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:91bbf398ac8bb7d65a5a52127407c05f75a18d7015a270fdd94bbcb04e65d573"},
{file = "lxml-4.9.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f99768232f036b4776ce419d3244a04fe83784bce871b16d2c2e984c7fcea847"},
{file = "lxml-4.9.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bb5bd6212eb0edfd1e8f254585290ea1dadc3687dd8fd5e2fd9a87c31915cdab"},
{file = "lxml-4.9.4-cp39-cp39-win32.whl", hash = "sha256:88f7c383071981c74ec1998ba9b437659e4fd02a3c4a4d3efc16774eb108d0ec"},
{file = "lxml-4.9.4-cp39-cp39-win_amd64.whl", hash = "sha256:936e8880cc00f839aa4173f94466a8406a96ddce814651075f95837316369899"},
{file = "lxml-4.9.4-pp310-pypy310_pp73-macosx_11_0_x86_64.whl", hash = "sha256:f6c35b2f87c004270fa2e703b872fcc984d714d430b305145c39d53074e1ffe0"},
{file = "lxml-4.9.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:606d445feeb0856c2b424405236a01c71af7c97e5fe42fbc778634faef2b47e4"},
{file = "lxml-4.9.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1bdcbebd4e13446a14de4dd1825f1e778e099f17f79718b4aeaf2403624b0f7"},
{file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:0a08c89b23117049ba171bf51d2f9c5f3abf507d65d016d6e0fa2f37e18c0fc5"},
{file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:232fd30903d3123be4c435fb5159938c6225ee8607b635a4d3fca847003134ba"},
{file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:231142459d32779b209aa4b4d460b175cadd604fed856f25c1571a9d78114771"},
{file = "lxml-4.9.4-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:520486f27f1d4ce9654154b4494cf9307b495527f3a2908ad4cb48e4f7ed7ef7"},
{file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:562778586949be7e0d7435fcb24aca4810913771f845d99145a6cee64d5b67ca"},
{file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a9e7c6d89c77bb2770c9491d988f26a4b161d05c8ca58f63fb1f1b6b9a74be45"},
{file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:786d6b57026e7e04d184313c1359ac3d68002c33e4b1042ca58c362f1d09ff58"},
{file = "lxml-4.9.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:95ae6c5a196e2f239150aa4a479967351df7f44800c93e5a975ec726fef005e2"},
{file = "lxml-4.9.4-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:9b556596c49fa1232b0fff4b0e69b9d4083a502e60e404b44341e2f8fb7187f5"},
{file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:cc02c06e9e320869d7d1bd323df6dd4281e78ac2e7f8526835d3d48c69060683"},
{file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:857d6565f9aa3464764c2cb6a2e3c2e75e1970e877c188f4aeae45954a314e0c"},
{file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c42ae7e010d7d6bc51875d768110c10e8a59494855c3d4c348b068f5fb81fdcd"},
{file = "lxml-4.9.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f10250bb190fb0742e3e1958dd5c100524c2cc5096c67c8da51233f7448dc137"},
{file = "lxml-4.9.4.tar.gz", hash = "sha256:b1541e50b78e15fa06a2670157a1962ef06591d4c998b998047fff5e3236880e"},
{file = "lxml-5.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c4b84d6b580a9625dfa47269bf1fd7fbba7ad69e08b16366a46acb005959c395"},
{file = "lxml-5.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b4c08ecb26e4270a62f81f81899dfff91623d349e433b126931c9c4577169666"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef926e9f11e307b5a7c97b17c5c609a93fb59ffa8337afac8f89e6fe54eb0b37"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:017ceeabe739100379fe6ed38b033cd244ce2da4e7f6f07903421f57da3a19a2"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dae97d9435dc90590f119d056d233c33006b2fd235dd990d5564992261ee7ae8"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:910f39425c6798ce63c93976ae5af5fff6949e2cb446acbd44d6d892103eaea8"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9780de781a0d62a7c3680d07963db3048b919fc9e3726d9cfd97296a65ffce1"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:1a06b0c6ba2e3ca45a009a78a4eb4d6b63831830c0a83dcdc495c13b9ca97d3e"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_28_ppc64le.whl", hash = "sha256:4c62d0a34d1110769a1bbaf77871a4b711a6f59c4846064ccb78bc9735978644"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_28_s390x.whl", hash = "sha256:8f961a4e82f411b14538fe5efc3e6b953e17f5e809c463f0756a0d0e8039b700"},
{file = "lxml-5.3.2-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:3dfc78f5f9251b6b8ad37c47d4d0bfe63ceb073a916e5b50a3bf5fd67a703335"},
{file = "lxml-5.3.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e690bc03214d3537270c88e492b8612d5e41b884f232df2b069b25b09e6711"},
{file = "lxml-5.3.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:aa837e6ee9534de8d63bc4c1249e83882a7ac22bd24523f83fad68e6ffdf41ae"},
{file = "lxml-5.3.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:da4c9223319400b97a2acdfb10926b807e51b69eb7eb80aad4942c0516934858"},
{file = "lxml-5.3.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:dc0e9bdb3aa4d1de703a437576007d366b54f52c9897cae1a3716bb44fc1fc85"},
{file = "lxml-5.3.2-cp310-cp310-win32.whl", hash = "sha256:5f94909a1022c8ea12711db7e08752ca7cf83e5b57a87b59e8a583c5f35016ad"},
{file = "lxml-5.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:d64ea1686474074b38da13ae218d9fde0d1dc6525266976808f41ac98d9d7980"},
{file = "lxml-5.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9d61a7d0d208ace43986a92b111e035881c4ed45b1f5b7a270070acae8b0bfb4"},
{file = "lxml-5.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:856dfd7eda0b75c29ac80a31a6411ca12209183e866c33faf46e77ace3ce8a79"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7a01679e4aad0727bedd4c9407d4d65978e920f0200107ceeffd4b019bd48529"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b6b37b4c3acb8472d191816d4582379f64d81cecbdce1a668601745c963ca5cc"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3df5a54e7b7c31755383f126d3a84e12a4e0333db4679462ef1165d702517477"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c09a40f28dcded933dc16217d6a092be0cc49ae25811d3b8e937c8060647c353"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1ef20f1851ccfbe6c5a04c67ec1ce49da16ba993fdbabdce87a92926e505412"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:f79a63289dbaba964eb29ed3c103b7911f2dce28c36fe87c36a114e6bd21d7ad"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_28_ppc64le.whl", hash = "sha256:75a72697d95f27ae00e75086aed629f117e816387b74a2f2da6ef382b460b710"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_28_s390x.whl", hash = "sha256:b9b00c9ee1cc3a76f1f16e94a23c344e0b6e5c10bec7f94cf2d820ce303b8c01"},
{file = "lxml-5.3.2-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:77cbcab50cbe8c857c6ba5f37f9a3976499c60eada1bf6d38f88311373d7b4bc"},
{file = "lxml-5.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:29424058f072a24622a0a15357bca63d796954758248a72da6d512f9bd9a4493"},
{file = "lxml-5.3.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:7d82737a8afe69a7c80ef31d7626075cc7d6e2267f16bf68af2c764b45ed68ab"},
{file = "lxml-5.3.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:95473d1d50a5d9fcdb9321fdc0ca6e1edc164dce4c7da13616247d27f3d21e31"},
{file = "lxml-5.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:2162068f6da83613f8b2a32ca105e37a564afd0d7009b0b25834d47693ce3538"},
{file = "lxml-5.3.2-cp311-cp311-win32.whl", hash = "sha256:f8695752cf5d639b4e981afe6c99e060621362c416058effd5c704bede9cb5d1"},
{file = "lxml-5.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:d1a94cbb4ee64af3ab386c2d63d6d9e9cf2e256ac0fd30f33ef0a3c88f575174"},
{file = "lxml-5.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:16b3897691ec0316a1aa3c6585f61c8b7978475587c5b16fc1d2c28d283dc1b0"},
{file = "lxml-5.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a8d4b34a0eeaf6e73169dcfd653c8d47f25f09d806c010daf074fba2db5e2d3f"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9cd7a959396da425022e1e4214895b5cfe7de7035a043bcc2d11303792b67554"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cac5eaeec3549c5df7f8f97a5a6db6963b91639389cdd735d5a806370847732b"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29b5f7d77334877c2146e7bb8b94e4df980325fab0a8af4d524e5d43cd6f789d"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13f3495cfec24e3d63fffd342cc8141355d1d26ee766ad388775f5c8c5ec3932"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e70ad4c9658beeff99856926fd3ee5fde8b519b92c693f856007177c36eb2e30"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:507085365783abd7879fa0a6fa55eddf4bdd06591b17a2418403bb3aff8a267d"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_28_ppc64le.whl", hash = "sha256:5bb304f67cbf5dfa07edad904732782cbf693286b9cd85af27059c5779131050"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_28_s390x.whl", hash = "sha256:3d84f5c093645c21c29a4e972b84cb7cf682f707f8706484a5a0c7ff13d7a988"},
{file = "lxml-5.3.2-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:bdc13911db524bd63f37b0103af014b7161427ada41f1b0b3c9b5b5a9c1ca927"},
{file = "lxml-5.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1ec944539543f66ebc060ae180d47e86aca0188bda9cbfadff47d86b0dc057dc"},
{file = "lxml-5.3.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:59d437cc8a7f838282df5a199cf26f97ef08f1c0fbec6e84bd6f5cc2b7913f6e"},
{file = "lxml-5.3.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:0e275961adbd32e15672e14e0cc976a982075208224ce06d149c92cb43db5b93"},
{file = "lxml-5.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:038aeb6937aa404480c2966b7f26f1440a14005cb0702078c173c028eca72c31"},
{file = "lxml-5.3.2-cp312-cp312-win32.whl", hash = "sha256:3c2c8d0fa3277147bff180e3590be67597e17d365ce94beb2efa3138a2131f71"},
{file = "lxml-5.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:77809fcd97dfda3f399102db1794f7280737b69830cd5c961ac87b3c5c05662d"},
{file = "lxml-5.3.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:77626571fb5270ceb36134765f25b665b896243529eefe840974269b083e090d"},
{file = "lxml-5.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:78a533375dc7aa16d0da44af3cf6e96035e484c8c6b2b2445541a5d4d3d289ee"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a6f62b2404b3f3f0744bbcabb0381c5fe186fa2a9a67ecca3603480f4846c585"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ea918da00091194526d40c30c4996971f09dacab032607581f8d8872db34fbf"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c35326f94702a7264aa0eea826a79547d3396a41ae87a70511b9f6e9667ad31c"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3bef90af21d31c4544bc917f51e04f94ae11b43156356aff243cdd84802cbf2"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:52fa7ba11a495b7cbce51573c73f638f1dcff7b3ee23697467dc063f75352a69"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:ad131e2c4d2c3803e736bb69063382334e03648de2a6b8f56a878d700d4b557d"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_28_ppc64le.whl", hash = "sha256:00a4463ca409ceacd20490a893a7e08deec7870840eff33dc3093067b559ce3e"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_28_s390x.whl", hash = "sha256:87e8d78205331cace2b73ac8249294c24ae3cba98220687b5b8ec5971a2267f1"},
{file = "lxml-5.3.2-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:bf6389133bb255e530a4f2f553f41c4dd795b1fbb6f797aea1eff308f1e11606"},
{file = "lxml-5.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b3709fc752b42fb6b6ffa2ba0a5b9871646d97d011d8f08f4d5b3ee61c7f3b2b"},
{file = "lxml-5.3.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:abc795703d0de5d83943a4badd770fbe3d1ca16ee4ff3783d7caffc252f309ae"},
{file = "lxml-5.3.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:98050830bb6510159f65d9ad1b8aca27f07c01bb3884ba95f17319ccedc4bcf9"},
{file = "lxml-5.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6ba465a91acc419c5682f8b06bcc84a424a7aa5c91c220241c6fd31de2a72bc6"},
{file = "lxml-5.3.2-cp313-cp313-win32.whl", hash = "sha256:56a1d56d60ea1ec940f949d7a309e0bff05243f9bd337f585721605670abb1c1"},
{file = "lxml-5.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:1a580dc232c33d2ad87d02c8a3069d47abbcdce974b9c9cc82a79ff603065dbe"},
{file = "lxml-5.3.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:1a59f7fe888d0ec1916d0ad69364c5400cfa2f885ae0576d909f342e94d26bc9"},
{file = "lxml-5.3.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d67b50abc2df68502a26ed2ccea60c1a7054c289fb7fc31c12e5e55e4eec66bd"},
{file = "lxml-5.3.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cb08d2cb047c98d6fbbb2e77d6edd132ad6e3fa5aa826ffa9ea0c9b1bc74a84"},
{file = "lxml-5.3.2-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:495ddb7e10911fb4d673d8aa8edd98d1eadafb3b56e8c1b5f427fd33cadc455b"},
{file = "lxml-5.3.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:884d9308ac7d581b705a3371185282e1b8eebefd68ccf288e00a2d47f077cc51"},
{file = "lxml-5.3.2-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:37f3d7cf7f2dd2520df6cc8a13df4c3e3f913c8e0a1f9a875e44f9e5f98d7fee"},
{file = "lxml-5.3.2-cp36-cp36m-win32.whl", hash = "sha256:e885a1bf98a76dff0a0648850c3083b99d9358ef91ba8fa307c681e8e0732503"},
{file = "lxml-5.3.2-cp36-cp36m-win_amd64.whl", hash = "sha256:b45f505d0d85f4cdd440cd7500689b8e95110371eaa09da0c0b1103e9a05030f"},
{file = "lxml-5.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b53cd668facd60b4f0dfcf092e01bbfefd88271b5b4e7b08eca3184dd006cb30"},
{file = "lxml-5.3.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5dea998c891f082fe204dec6565dbc2f9304478f2fc97bd4d7a940fec16c873"},
{file = "lxml-5.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d46bc3e58b01e4f38d75e0d7f745a46875b7a282df145aca9d1479c65ff11561"},
{file = "lxml-5.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:661feadde89159fd5f7d7639a81ccae36eec46974c4a4d5ccce533e2488949c8"},
{file = "lxml-5.3.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:43af2a69af2cacc2039024da08a90174e85f3af53483e6b2e3485ced1bf37151"},
{file = "lxml-5.3.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:1539f962d82436f3d386eb9f29b2a29bb42b80199c74a695dff51b367a61ec0a"},
{file = "lxml-5.3.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:6673920bf976421b5fac4f29b937702eef4555ee42329546a5fc68bae6178a48"},
{file = "lxml-5.3.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:9fa722a9cd8845594593cce399a49aa6bfc13b6c83a7ee05e2ab346d9253d52f"},
{file = "lxml-5.3.2-cp37-cp37m-win32.whl", hash = "sha256:2eadd4efa487f4710755415aed3d6ae9ac8b4327ea45226ffccb239766c8c610"},
{file = "lxml-5.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:83d8707b1b08cd02c04d3056230ec3b771b18c566ec35e723e60cdf037064e08"},
{file = "lxml-5.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc6e8678bfa5ccba370103976ccfcf776c85c83da9220ead41ea6fd15d2277b4"},
{file = "lxml-5.3.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0bed509662f67f719119ad56006cd4a38efa68cfa74383060612044915e5f7ad"},
{file = "lxml-5.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e3925975fadd6fd72a6d80541a6ec75dfbad54044a03aa37282dafcb80fbdfa"},
{file = "lxml-5.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83c0462dedc5213ac586164c6d7227da9d4d578cf45dd7fbab2ac49b63a008eb"},
{file = "lxml-5.3.2-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:53e3f9ca72858834688afa17278649d62aa768a4b2018344be00c399c4d29e95"},
{file = "lxml-5.3.2-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:32ba634ef3f1b20f781019a91d78599224dc45745dd572f951adbf1c0c9b0d75"},
{file = "lxml-5.3.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:1b16504c53f41da5fcf04868a80ac40a39d3eec5329caf761114caec6e844ad1"},
{file = "lxml-5.3.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:1f9682786138549da44ca4c49b20e7144d063b75f2b2ba611f4cff9b83db1062"},
{file = "lxml-5.3.2-cp38-cp38-win32.whl", hash = "sha256:d8f74ef8aacdf6ee5c07566a597634bb8535f6b53dc89790db43412498cf6026"},
{file = "lxml-5.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:49f1cee0fa27e1ee02589c696a9bdf4027e7427f184fa98e6bef0c6613f6f0fa"},
{file = "lxml-5.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:741c126bcf9aa939e950e64e5e0a89c8e01eda7a5f5ffdfc67073f2ed849caea"},
{file = "lxml-5.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ab6e9e6aca1fd7d725ffa132286e70dee5b9a4561c5ed291e836440b82888f89"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58e8c9b9ed3c15c2d96943c14efc324b69be6352fe5585733a7db2bf94d97841"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7811828ddfb8c23f4f1fbf35e7a7b2edec2f2e4c793dee7c52014f28c4b35238"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:72968623efb1e12e950cbdcd1d0f28eb14c8535bf4be153f1bfffa818b1cf189"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ebfceaa2ea588b54efb6160e3520983663d45aed8a3895bb2031ada080fb5f04"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d685d458505b2bfd2e28c812749fe9194a2b0ce285a83537e4309a187ffa270b"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:334e0e414dab1f5366ead8ca34ec3148415f236d5660e175f1d640b11d645847"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_28_ppc64le.whl", hash = "sha256:02e56f7de72fa82561eae69628a7d6febd7891d72248c7ff7d3e7814d4031017"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_28_s390x.whl", hash = "sha256:638d06b4e1d34d1a074fa87deed5fb55c18485fa0dab97abc5604aad84c12031"},
{file = "lxml-5.3.2-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:354dab7206d22d7a796fa27c4c5bffddd2393da2ad61835355a4759d435beb47"},
{file = "lxml-5.3.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d9d9f82ff2c3bf9bb777cb355149f7f3a98ec58f16b7428369dc27ea89556a4c"},
{file = "lxml-5.3.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:95ad58340e3b7d2b828efc370d1791856613c5cb62ae267158d96e47b3c978c9"},
{file = "lxml-5.3.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:30fe05f4b7f6e9eb32862745512e7cbd021070ad0f289a7f48d14a0d3fc1d8a9"},
{file = "lxml-5.3.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:34c688fef86f73dbca0798e0a61bada114677006afa524a8ce97d9e5fabf42e6"},
{file = "lxml-5.3.2-cp39-cp39-win32.whl", hash = "sha256:4d6d3d1436d57f41984920667ec5ef04bcb158f80df89ac4d0d3f775a2ac0c87"},
{file = "lxml-5.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:2996e1116bbb3ae2a1fbb2ba4da8f92742290b4011e7e5bce2bd33bbc9d9485a"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:521ab9c80b98c30b2d987001c3ede2e647e92eeb2ca02e8cb66ef5122d792b24"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f1231b0f9810289d41df1eacc4ebb859c63e4ceee29908a0217403cddce38d0"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:271f1a4d5d2b383c36ad8b9b489da5ea9c04eca795a215bae61ed6a57cf083cd"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:6fca8a5a13906ba2677a5252752832beb0f483a22f6c86c71a2bb320fba04f61"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:ea0c3b7922209160faef194a5b6995bfe7fa05ff7dda6c423ba17646b7b9de10"},
{file = "lxml-5.3.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:0a006390834603e5952a2ff74b9a31a6007c7cc74282a087aa6467afb4eea987"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:eae4136a3b8c4cf76f69461fc8f9410d55d34ea48e1185338848a888d71b9675"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d48e06be8d8c58e7feaedd8a37897a6122637efb1637d7ce00ddf5f11f9a92ad"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d4b83aed409134093d90e114007034d2c1ebcd92e501b71fd9ec70e612c8b2eb"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7a0e77edfe26d3703f954d46bed52c3ec55f58586f18f4b7f581fc56954f1d84"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:19f6fcfd15b82036b4d235749d78785eb9c991c7812012dc084e0d8853b4c1c0"},
{file = "lxml-5.3.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:d49919c95d31ee06eefd43d8c6f69a3cc9bdf0a9b979cc234c4071f0eb5cb173"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2d0a60841410123c533990f392819804a8448853f06daf412c0f383443925e89"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b7f729e03090eb4e3981f10efaee35e6004b548636b1a062b8b9a525e752abc"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:579df6e20d8acce3bcbc9fb8389e6ae00c19562e929753f534ba4c29cfe0be4b"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:2abcf3f3b8367d6400b908d00d4cd279fc0b8efa287e9043820525762d383699"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:348c06cb2e3176ce98bee8c397ecc89181681afd13d85870df46167f140a305f"},
{file = "lxml-5.3.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:617ecaccd565cbf1ac82ffcaa410e7da5bd3a4b892bb3543fb2fe19bd1c4467d"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:c3eb4278dcdb9d86265ed2c20b9ecac45f2d6072e3904542e591e382c87a9c00"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:258b6b53458c5cbd2a88795557ff7e0db99f73a96601b70bc039114cd4ee9e02"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0a9d8d25ed2f2183e8471c97d512a31153e123ac5807f61396158ef2793cb6e"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:73bcb635a848c18a3e422ea0ab0092f2e4ef3b02d8ebe87ab49748ebc8ec03d8"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1545de0a69a16ced5767bae8cca1801b842e6e49e96f5e4a8a5acbef023d970b"},
{file = "lxml-5.3.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:165fcdc2f40fc0fe88a3c3c06c9c2a097388a90bda6a16e6f7c9199c903c9b8e"},
{file = "lxml-5.3.2.tar.gz", hash = "sha256:773947d0ed809ddad824b7b14467e1a481b8976e87278ac4a730c2f7c7fcddc1"},
]
[package.extras]
cssselect = ["cssselect (>=0.7)"]
html-clean = ["lxml_html_clean"]
html5 = ["html5lib"]
htmlsoup = ["BeautifulSoup4"]
source = ["Cython (==0.29.37)"]
source = ["Cython (>=3.0.11,<3.1.0)"]
[[package]]
name = "m3u8"
version = "0.9.0"
version = "6.0.0"
description = "Python m3u8 parser"
optional = false
python-versions = ">=3.5"
files = [
{file = "m3u8-0.9.0-py3-none-any.whl", hash = "sha256:7dde0a20cf985422593810006dd371a1e3e7afd33a76277111eba3f220288902"},
{file = "m3u8-0.9.0.tar.gz", hash = "sha256:3ee058855c430dc364db6b8026269d2b4c1894b198bcc5c824039c551c05f497"},
]
python-versions = ">=3.9"
files = []
develop = true
[package.dependencies]
iso8601 = "*"
backports-datetime-fromisoformat = {version = "*", markers = "python_version < \"3.11\""}
[package.source]
type = "directory"
url = "scripts/m3u8"
[[package]]
name = "macholib"
@ -1418,17 +1318,6 @@ files = [
{file = "msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"},
]
[[package]]
name = "mutagen"
version = "1.47.0"
description = "read and write audio tags for many formats"
optional = false
python-versions = ">=3.7"
files = [
{file = "mutagen-1.47.0-py3-none-any.whl", hash = "sha256:edd96f50c5907a9539d8e5bba7245f62c9f520aef333d13392a79a4f70aca719"},
{file = "mutagen-1.47.0.tar.gz", hash = "sha256:719fadef0a978c31b4cf3c956261b3c58b6948b32023078a2117b1de09f0fc99"},
]
[[package]]
name = "packaging"
version = "24.2"
@ -1513,7 +1402,6 @@ cleo = ">=2.1.0,<3.0.0"
crashtest = ">=0.4.1,<0.5.0"
dulwich = ">=0.21.2,<0.22.0"
fastjsonschema = ">=2.18.0,<3.0.0"
importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""}
installer = ">=0.7.0,<0.8.0"
keyring = ">=24.0.0,<25.0.0"
packaging = ">=23.1"
@ -1652,6 +1540,17 @@ files = [
{file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"},
]
[[package]]
name = "pycountry"
version = "24.6.1"
description = "ISO country, subdivision, language, currency and script definitions and their translations"
optional = false
python-versions = ">=3.8"
files = [
{file = "pycountry-24.6.1-py3-none-any.whl", hash = "sha256:f1a4fb391cd7214f8eefd39556d740adcc233c778a27f8942c8dca351d6ce06f"},
{file = "pycountry-24.6.1.tar.gz", hash = "sha256:b61b3faccea67f87d10c1f2b0fc0be714409e8fcdcc1315613174f6466c10221"},
]
[[package]]
name = "pycparser"
version = "2.22"
@ -1772,27 +1671,32 @@ requests = "*"
[[package]]
name = "pyinstaller"
version = "4.5.1"
version = "5.13.2"
description = "PyInstaller bundles a Python application and all its dependencies into a single package."
optional = false
python-versions = ">=3.6"
python-versions = "<3.13,>=3.7"
files = [
{file = "pyinstaller-4.5.1-py3-none-macosx_10_13_universal2.whl", hash = "sha256:ecc2baadeeefd2b6fbf39d13c65d4aa603afdda1c6aaaebc4577ba72893fee9e"},
{file = "pyinstaller-4.5.1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:4d848cd782ee0893d7ad9fe2bfe535206a79f0b6760cecc5f2add831258b9322"},
{file = "pyinstaller-4.5.1-py3-none-manylinux2014_i686.whl", hash = "sha256:8f747b190e6ad30e2d2fd5da9a64636f61aac8c038c0b7f685efa92c782ea14f"},
{file = "pyinstaller-4.5.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:c587da8f521a7ce1b9efb4e3d0117cd63c92dc6cedff24590aeef89372f53012"},
{file = "pyinstaller-4.5.1-py3-none-win32.whl", hash = "sha256:fed9f5e4802769a416a8f2ca171c6be961d1861cc05a0b71d20dfe05423137e9"},
{file = "pyinstaller-4.5.1-py3-none-win_amd64.whl", hash = "sha256:aae456205c68355f9597411090576bb31b614e53976b4c102d072bbe5db8392a"},
{file = "pyinstaller-4.5.1.tar.gz", hash = "sha256:30733baaf8971902286a0ddf77e5499ac5f7bf8e7c39163e83d4f8c696ef265e"},
{file = "pyinstaller-5.13.2-py3-none-macosx_10_13_universal2.whl", hash = "sha256:16cbd66b59a37f4ee59373a003608d15df180a0d9eb1a29ff3bfbfae64b23d0f"},
{file = "pyinstaller-5.13.2-py3-none-manylinux2014_aarch64.whl", hash = "sha256:8f6dd0e797ae7efdd79226f78f35eb6a4981db16c13325e962a83395c0ec7420"},
{file = "pyinstaller-5.13.2-py3-none-manylinux2014_i686.whl", hash = "sha256:65133ed89467edb2862036b35d7c5ebd381670412e1e4361215e289c786dd4e6"},
{file = "pyinstaller-5.13.2-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:7d51734423685ab2a4324ab2981d9781b203dcae42839161a9ee98bfeaabdade"},
{file = "pyinstaller-5.13.2-py3-none-manylinux2014_s390x.whl", hash = "sha256:2c2fe9c52cb4577a3ac39626b84cf16cf30c2792f785502661286184f162ae0d"},
{file = "pyinstaller-5.13.2-py3-none-manylinux2014_x86_64.whl", hash = "sha256:c63ef6133eefe36c4b2f4daf4cfea3d6412ece2ca218f77aaf967e52a95ac9b8"},
{file = "pyinstaller-5.13.2-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:aadafb6f213549a5906829bb252e586e2cf72a7fbdb5731810695e6516f0ab30"},
{file = "pyinstaller-5.13.2-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:b2e1c7f5cceb5e9800927ddd51acf9cc78fbaa9e79e822c48b0ee52d9ce3c892"},
{file = "pyinstaller-5.13.2-py3-none-win32.whl", hash = "sha256:421cd24f26144f19b66d3868b49ed673176765f92fa9f7914cd2158d25b6d17e"},
{file = "pyinstaller-5.13.2-py3-none-win_amd64.whl", hash = "sha256:ddcc2b36052a70052479a9e5da1af067b4496f43686ca3cdda99f8367d0627e4"},
{file = "pyinstaller-5.13.2-py3-none-win_arm64.whl", hash = "sha256:27cd64e7cc6b74c5b1066cbf47d75f940b71356166031deb9778a2579bb874c6"},
{file = "pyinstaller-5.13.2.tar.gz", hash = "sha256:c8e5d3489c3a7cc5f8401c2d1f48a70e588f9967e391c3b06ddac1f685f8d5d2"},
]
[package.dependencies]
altgraph = "*"
macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
pefile = {version = ">=2017.8.1", markers = "sys_platform == \"win32\""}
pyinstaller-hooks-contrib = ">=2020.6"
pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""}
setuptools = "*"
pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""}
pyinstaller-hooks-contrib = ">=2021.4"
pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""}
setuptools = ">=42.0.0"
[package.extras]
encryption = ["tinyaes (>=1.0.0)"]
@ -1810,7 +1714,6 @@ files = [
]
[package.dependencies]
importlib_metadata = {version = ">=4.6", markers = "python_version < \"3.10\""}
packaging = ">=22.0"
setuptools = ">=42.0.0"
@ -1861,7 +1764,7 @@ rsa = ["cryptography"]
[[package]]
name = "pyplayready"
version = "0.5.0"
version = "0.6.0"
description = "pyplayready CDM (Content Decryption Module) implementation in Python."
optional = false
python-versions = ">=3.8,<4.0"
@ -1870,7 +1773,7 @@ develop = true
[package.dependencies]
click = "^8.1.7"
construct = "^2.8.8"
construct = "2.8.8"
ECPy = "^1.2.5"
pycryptodome = "^3.21.0"
PyYAML = "^6.0.1"
@ -2292,6 +2195,51 @@ files = [
{file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"},
]
[[package]]
name = "srt"
version = "3.5.3"
description = "A tiny library for parsing, modifying, and composing SRT files."
optional = false
python-versions = ">=2.7"
files = [
{file = "srt-3.5.3.tar.gz", hash = "sha256:4884315043a4f0740fd1f878ed6caa376ac06d70e135f306a6dc44632eed0cc0"},
]
[[package]]
name = "subby"
version = "0.3.19"
description = "Advanced subtitle converter and processor"
optional = false
python-versions = "^3.8"
files = []
develop = true
[package.dependencies]
beautifulsoup4 = "^4.8.2"
click = "^8.1.3"
langcodes = "^3.4.0"
lxml = "^5.3.0"
pymp4 = "~1.4.0"
srt = "^3.5.3"
tinycss = "^0.4"
[package.source]
type = "directory"
url = "scripts/subby"
[[package]]
name = "tinycss"
version = "0.4"
description = "tinycss is a complete yet simple CSS parser for Python."
optional = false
python-versions = "*"
files = [
{file = "tinycss-0.4.tar.gz", hash = "sha256:12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e"},
]
[package.extras]
test = ["pytest-cov", "pytest-flake8", "pytest-isort", "pytest-runner"]
[[package]]
name = "tldextract"
version = "3.5.0"
@ -2443,6 +2391,16 @@ h2 = ["h2 (>=4,<5)"]
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "ushlex"
version = "0.99.1"
description = "Replacement for shlex (that works with unicode) for Python 2.X."
optional = false
python-versions = "*"
files = [
{file = "ushlex-0.99.1.tar.gz", hash = "sha256:6d681561545a9781430d5254eab9a648bade78c82ffd127d56c9228ae8887d46"},
]
[[package]]
name = "validators"
version = "0.18.2"
@ -2497,101 +2455,6 @@ docs = ["Sphinx (>=6.0)", "myst-parser (>=2.0.0)", "sphinx-rtd-theme (>=1.1.0)"]
optional = ["python-socks", "wsaccel"]
test = ["websockets"]
[[package]]
name = "websockets"
version = "13.1"
description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
optional = false
python-versions = ">=3.8"
files = [
{file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"},
{file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"},
{file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"},
{file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"},
{file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"},
{file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"},
{file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"},
{file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"},
{file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"},
{file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"},
{file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"},
{file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"},
{file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"},
{file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"},
{file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"},
{file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"},
{file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"},
{file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"},
{file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"},
{file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"},
{file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"},
{file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"},
{file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"},
{file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"},
{file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"},
{file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"},
{file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"},
{file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"},
{file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"},
{file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"},
{file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"},
{file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"},
{file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"},
{file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"},
{file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"},
{file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"},
{file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"},
{file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"},
{file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"},
{file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"},
{file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"},
{file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"},
{file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"},
{file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"},
{file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"},
{file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"},
{file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"},
{file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"},
{file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"},
{file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"},
{file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"},
{file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"},
{file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"},
{file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"},
{file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"},
{file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"},
{file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"},
{file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"},
{file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"},
{file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"},
{file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"},
{file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"},
{file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"},
{file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"},
{file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"},
{file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"},
{file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"},
{file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"},
{file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"},
{file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"},
{file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"},
{file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"},
{file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"},
{file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"},
{file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"},
{file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"},
{file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"},
{file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"},
{file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"},
{file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"},
{file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"},
{file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"},
{file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"},
{file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"},
{file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"},
{file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"},
]
[[package]]
name = "xattr"
version = "1.1.4"
@ -2690,22 +2553,24 @@ files = [
[[package]]
name = "yt-dlp"
version = "2022.11.11"
description = "A youtube-dl fork with additional features and patches"
version = "2024.12.23"
description = "A feature-rich command-line audio/video downloader"
optional = false
python-versions = ">=3.7"
python-versions = ">=3.9"
files = [
{file = "yt-dlp-2022.11.11.tar.gz", hash = "sha256:f6b962023c17a77151476f0f6ed71be87d017629ba5d9994528bc548521191b6"},
{file = "yt_dlp-2022.11.11-py2.py3-none-any.whl", hash = "sha256:8bb7bd9ab2e6ecf4db7627e9151ce00572ae7ee24dedc78f611e7467b0ccd7d9"},
{file = "yt_dlp-2024.12.23-py3-none-any.whl", hash = "sha256:2fc08a5221a0379628ac4e7324c6c69a95b9fdfa7a7ca3187444b3b7451e38be"},
{file = "yt_dlp-2024.12.23.tar.gz", hash = "sha256:ac0e72b5a9017ba104b4258546201a7cedc38e8bd20727e0c63b77c829b425e9"},
]
[package.dependencies]
brotli = {version = "*", markers = "platform_python_implementation == \"CPython\""}
brotlicffi = {version = "*", markers = "platform_python_implementation != \"CPython\""}
certifi = "*"
mutagen = "*"
pycryptodomex = "*"
websockets = "*"
[package.extras]
build = ["build", "hatchling", "pip", "setuptools (>=71.0.2)", "wheel"]
curl-cffi = ["curl-cffi (==0.5.10)", "curl-cffi (>=0.5.10,!=0.6.*,<0.7.2)"]
default = ["brotli", "brotlicffi", "certifi", "mutagen", "pycryptodomex", "requests (>=2.32.2,<3)", "urllib3 (>=1.26.17,<3)", "websockets (>=13.0)"]
dev = ["autopep8 (>=2.0,<3.0)", "pre-commit", "pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)", "ruff (>=0.8.0,<0.9.0)"]
pyinstaller = ["pyinstaller (>=6.11.1)"]
secretstorage = ["cffi", "secretstorage"]
static-analysis = ["autopep8 (>=2.0,<3.0)", "ruff (>=0.8.0,<0.9.0)"]
test = ["pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)"]
[[package]]
name = "zipp"
@ -2728,5 +2593,5 @@ type = ["pytest-mypy"]
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "3e35149e73c237381b87aa360390154341cf8dcd84a45219e0c9c743fef46686"
python-versions = ">=3.10,<3.13"
content-hash = "5cb44b9ebe6b4d0faf53bf5e8f527e501801c6d34c8820a206faa64b66867038"

96
pyinstaller.py Normal file
View File

@ -0,0 +1,96 @@
#!/usr/bin/env python3
import itertools
import os
import shutil
import sys
import toml
from PyInstaller.__main__ import run
if sys.platform == "win32":
from PyInstaller.utils.win32.versioninfo import (FixedFileInfo, StringFileInfo, StringStruct,
StringTable, VarFileInfo, VarStruct, VSVersionInfo)
#from PyInstaller.utils.win32.versioninfo import SetVersion
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
"""Load pyproject.toml information."""
project = toml.load(os.path.join(SCRIPT_PATH, "pyproject.toml"))
poetry = project["tool"]["poetry"]
"""Configuration options that may be changed or referenced often."""
DEBUG = False # When False, removes un-needed data after build has finished
NAME = poetry["name"]
AUTHOR = "vinetrimmer contributors"
VERSION = poetry["version"]
ICON_FILE = "assets/icon.ico" # pass None to use default icon
ONE_FILE = False # Must be False if using setup.iss
CONSOLE = True # If build is intended for GUI, set to False
ADDITIONAL_DATA = [
# (local file path, destination in build output)
]
HIDDEN_IMPORTS = []
EXTRA_ARGS = [
"-y", "--win-private-assemblies", "--win-no-prefer-redirects"
]
"""Prepare environment to ensure output data is fresh."""
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist/vinetrimmer", ignore_errors=True)
# we don't want to use any spec, only the configuration set in this file
try:
os.unlink(f"{NAME}.spec")
except FileNotFoundError:
pass
"""Run PyInstaller with the provided configuration."""
run([
"vinetrimmer/vinetrimmer.py",
"-n", NAME,
"-i", ["NONE", ICON_FILE][bool(ICON_FILE)],
["-D", "-F"][ONE_FILE],
["-w", "-c"][CONSOLE],
*itertools.chain(*[["--add-data", os.pathsep.join(x)] for x in ADDITIONAL_DATA]),
*itertools.chain(*[["--hidden-import", x] for x in HIDDEN_IMPORTS]),
*EXTRA_ARGS
])
if sys.platform == "win32":
"""Set Version Info Structure."""
VERSION_4_TUP = tuple(map(int, f"{VERSION}.0".split(".")))
VERSION_4_STR = ".".join(map(str, VERSION_4_TUP))
#SetVersion(
# "dist/{0}/{0}.exe".format(NAME),
# VSVersionInfo(
# ffi=FixedFileInfo(
# filevers=VERSION_4_TUP,
# prodvers=VERSION_4_TUP
# ),
# kids=[
# StringFileInfo([StringTable(
# "040904B0", # ?
# [
# StringStruct("Comments", NAME),
# StringStruct("CompanyName", AUTHOR),
# StringStruct("FileDescription", "Widevine DRM downloader and decrypter"),
# StringStruct("FileVersion", VERSION_4_STR),
# StringStruct("InternalName", NAME),
# StringStruct("LegalCopyright", f"Copyright (C) 2019-2021 {AUTHOR}"),
# StringStruct("OriginalFilename", ""),
# StringStruct("ProductName", NAME),
# StringStruct("ProductVersion", VERSION_4_STR)
# ]
# )]),
# VarFileInfo([VarStruct("Translation", [0, 1200])]) # ?
# ]
# )
#)
if not DEBUG:
shutil.rmtree("build", ignore_errors=True)
# we don't want to keep the generated spec
try:
os.unlink(f"{NAME}.spec")
except FileNotFoundError:
pass

View File

@ -5,13 +5,13 @@ build-backend = 'poetry.core.masonry.api'
[tool.poetry]
name = 'vinetrimmer'
version = '0.1.0'
description = 'Playready DRM downloader and decrypter'
description = 'Widevine and Playready DRM downloader and decrypter'
authors = []
[tool.poetry.dependencies]
python = "^3.8"
python = ">=3.10,<3.13"
appdirs = "^1.4.4"
beautifulsoup4 = "~4.8.2"
beautifulsoup4 = "^4.8.2"
click = "^8.0.1"
cffi = "^1.16.0"
coloredlogs = "^15.0"
@ -23,12 +23,13 @@ httpx = "^0.23.0"
isodate = "^0.6.1"
jsonpickle = "^2.0.0"
langcodes = { extras = ["data"], version = "^3.1.0" }
lxml = "^4.6.3"
m3u8 = "^0.9.0"
lxml = "^5.3.0"
m3u8 = { path = "./scripts/m3u8", develop = true }
marisa-trie = "^1.1.0"
poetry = "1.8.5"
pproxy = "^2.7.7"
protobuf3 = { path = "./scripts/protobuf3", develop = true }
pycountry = "^24.6.1"
pycaption = "^2.1.1"
pycryptodome = "^3.21.0"
pycryptodomex = "^3.4.3"
@ -41,19 +42,21 @@ pywidevine = { path = "./scripts/pywidevine", develop = true }
pysubs2 = "^1.6.1"
PyYAML = "^6.0.1"
requests = { extras = ["socks"], version = "2.32.3" }
subby = { path = "./scripts/subby", develop = true }
tldextract = "^3.1.0"
toml = "^0.10.2"
tqdm = "^4.67.0"
Unidecode = "^1.2.0"
validators = "^0.18.2"
websocket-client = "^1.1.0"
xmltodict = "^0.14.0"
yt-dlp = "^2022.11.11"
xmltodict = "^0.14.2"
yt-dlp = "^2024.11.11"
ushlex = "^0.99.1"
[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
flake8 = "^3.8.4"
isort = "^5.9.2"
pyinstaller = "^4.4"
pyinstaller = "5.13.2"
[tool.poetry.scripts]
vt = 'vinetrimmer.vinetrimmer:main'

View File

@ -1,5 +0,0 @@
requests
pycryptodome
ecpy
construct
click

19
scripts/dsnp_kid_fix.py Normal file
View File

@ -0,0 +1,19 @@
import uuid
import base64
import xmltodict
psshPR = """
xAEAAAEAAQC6ATwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ATAA0AGkAWQBTAHIAaQB2AGEARQAyAFQASwBHAFAAZQBlADkAYgB1AGcAZwA9AD0APAAvAEsASQBEAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=
"""
xml_str = base64.b64decode(psshPR).decode("utf-16-le", "ignore")
xml_str = xml_str[xml_str.index("<"):]
kids = []
try:
kids = [uuid.UUID(base64.b64decode(kid_xml['@VALUE']).hex()).bytes_le.hex().upper() for kid_xml in xmltodict.parse(xml_str)['WRMHEADER']['DATA']['CUSTOMATTRIBUTES']['KIDS']['KID']]
except:
another_kid = uuid.UUID(base64.b64decode(xmltodict.parse(xml_str)['WRMHEADER']['DATA']["KID"]).hex()).bytes_le.hex().upper()
if another_kid not in kids:
kids.append(another_kid.upper())
print(kids)

View File

@ -0,0 +1,14 @@
# https://editorconfig.org
root = true
[*.py]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[Makefile]
indent_style = tab
indent_size = 4

40
scripts/m3u8/.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
# You can use PyPy versions in python-version.
# For example, pypy2 and pypy3
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Runs a single command using the runners shell
- name: Run all tests
run: ./runtests

19
scripts/m3u8/.github/workflows/ruff.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Ruff
run-name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
ruff_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
with:
args: format --check --diff

17
scripts/m3u8/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
*.pyc
*.egg-info
tests/server.stdout
dist/
build/
bin/
include/
lib/
lib64/
local/
.coverage
.cache
.python-version
.idea/
.vscode/
venv/
pyvenv.cfg

11
scripts/m3u8/LICENSE Normal file
View File

@ -0,0 +1,11 @@
m3u8 is licensed under the MIT License:
The MIT License
Copyright (c) 2012 globo.com webmedia@corp.globo.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
scripts/m3u8/MANIFEST.in Normal file
View File

@ -0,0 +1,3 @@
include requirements.txt
include LICENSE
include README.md

104
scripts/m3u8/README.md Normal file
View File

@ -0,0 +1,104 @@
![image](https://github.com/globocom/m3u8/actions/workflows/main.yml/badge.svg) [![image](https://badge.fury.io/py/m3u8.svg)](https://badge.fury.io/py/m3u8)
# m3u8
Python [m3u8](https://tools.ietf.org/html/rfc8216) parser.
# Documentation
## Loading a playlist
To load a playlist into an object from uri, file path or directly from
string, use the `load/loads` functions:
```python
import m3u8
playlist = m3u8.load('http://videoserver.com/playlist.m3u8') # this could also be an absolute filename
print(playlist.segments)
print(playlist.target_duration)
# if you already have the content as string, use
playlist = m3u8.loads('#EXTM3U8 ... etc ... ')
```
## Dumping a playlist
To dump a playlist from an object to the console or a file, use the
`dump/dumps` functions:
``` python
import m3u8
playlist = m3u8.load('http://videoserver.com/playlist.m3u8')
print(playlist.dumps())
# if you want to write a file from its content
playlist.dump('playlist.m3u8')
```
# Supported tags
- [\#EXT-X-TARGETDURATION](https://tools.ietf.org/html/rfc8216#section-4.3.3.1)
- [\#EXT-X-MEDIA-SEQUENCE](https://tools.ietf.org/html/rfc8216#section-4.3.3.2)
- [\#EXT-X-DISCONTINUITY-SEQUENCE](https://tools.ietf.org/html/rfc8216#section-4.3.3.3)
- [\#EXT-X-PROGRAM-DATE-TIME](https://tools.ietf.org/html/rfc8216#section-4.3.2.6)
- [\#EXT-X-MEDIA](https://tools.ietf.org/html/rfc8216#section-4.3.4.1)
- [\#EXT-X-PLAYLIST-TYPE](https://tools.ietf.org/html/rfc8216#section-4.3.3.5)
- [\#EXT-X-KEY](https://tools.ietf.org/html/rfc8216#section-4.3.2.4)
- [\#EXT-X-STREAM-INF](https://tools.ietf.org/html/rfc8216#section-4.3.4.2)
- [\#EXT-X-VERSION](https://tools.ietf.org/html/rfc8216#section-4.3.1.2)
- [\#EXT-X-ALLOW-CACHE](https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-07#section-3.3.6)
- [\#EXT-X-ENDLIST](https://tools.ietf.org/html/rfc8216#section-4.3.3.4)
- [\#EXTINF](https://tools.ietf.org/html/rfc8216#section-4.3.2.1)
- [\#EXT-X-I-FRAMES-ONLY](https://tools.ietf.org/html/rfc8216#section-4.3.3.6)
- [\#EXT-X-BITRATE](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.4.8)
- [\#EXT-X-BYTERANGE](https://tools.ietf.org/html/rfc8216#section-4.3.2.2)
- [\#EXT-X-I-FRAME-STREAM-INF](https://tools.ietf.org/html/rfc8216#section-4.3.4.3)
- [\#EXT-X-IMAGES-ONLY](https://github.com/image-media-playlist/spec/blob/master/image_media_playlist_v0_4.pdf)
- [\#EXT-X-IMAGE-STREAM-INF](https://github.com/image-media-playlist/spec/blob/master/image_media_playlist_v0_4.pdf)
- [\#EXT-X-TILES](https://github.com/image-media-playlist/spec/blob/master/image_media_playlist_v0_4.pdf)
- [\#EXT-X-DISCONTINUITY](https://tools.ietf.org/html/rfc8216#section-4.3.2.3)
- \#EXT-X-CUE-OUT
- \#EXT-X-CUE-OUT-CONT
- \#EXT-X-CUE-IN
- \#EXT-X-CUE-SPAN
- \#EXT-OATCLS-SCTE35
- [\#EXT-X-INDEPENDENT-SEGMENTS](https://tools.ietf.org/html/rfc8216#section-4.3.5.1)
- [\#EXT-X-MAP](https://tools.ietf.org/html/rfc8216#section-4.3.2.5)
- [\#EXT-X-START](https://tools.ietf.org/html/rfc8216#section-4.3.5.2)
- [\#EXT-X-SERVER-CONTROL](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.3.8)
- [\#EXT-X-PART-INF](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.3.7)
- [\#EXT-X-PART](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.4.9)
- [\#EXT-X-RENDITION-REPORT](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.5.4)
- [\#EXT-X-SKIP](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-4.4.5.2)
- [\#EXT-X-SESSION-DATA](https://tools.ietf.org/html/rfc8216#section-4.3.4.4)
- [\#EXT-X-PRELOAD-HINT](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.5.3)
- [\#EXT-X-SESSION-KEY](https://tools.ietf.org/html/rfc8216#section-4.3.4.5)
- [\#EXT-X-DATERANGE](https://tools.ietf.org/html/rfc8216#section-4.3.2.7)
- [\#EXT-X-GAP](https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-05#section-4.4.2.7)
- [\#EXT-X-CONTENT-STEERING](https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-10#section-4.4.6.64)
# Frequently Asked Questions
- [FAQ](https://github.com/globocom/m3u8/wiki/FAQ)
# Running Tests
``` bash
$ ./runtests
```
# Contributing
All contributions are welcome, but we will merge a pull request if, and
only if, it
- Has tests
- Follows the code conventions
If you plan to implement a new feature or something that will take more
than a few minutes, please open an issue to make sure we don't work on
the same thing.

View File

@ -0,0 +1,105 @@
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import os
from urllib.parse import urljoin, urlsplit
from m3u8.httpclient import DefaultHTTPClient
from m3u8.model import (
M3U8,
ContentSteering,
DateRange,
DateRangeList,
IFramePlaylist,
ImagePlaylist,
Key,
Media,
MediaList,
PartialSegment,
PartialSegmentList,
PartInformation,
Playlist,
PlaylistList,
PreloadHint,
RenditionReport,
RenditionReportList,
Segment,
SegmentList,
ServerControl,
Skip,
Start,
Tiles,
)
from m3u8.parser import ParseError, parse
__all__ = (
"M3U8",
"Segment",
"SegmentList",
"PartialSegment",
"PartialSegmentList",
"Key",
"Playlist",
"IFramePlaylist",
"Media",
"MediaList",
"PlaylistList",
"Start",
"RenditionReport",
"RenditionReportList",
"ServerControl",
"Skip",
"PartInformation",
"PreloadHint",
"DateRange",
"DateRangeList",
"ContentSteering",
"ImagePlaylist",
"Tiles",
"loads",
"load",
"parse",
"ParseError",
)
def loads(content, uri=None, custom_tags_parser=None):
"""
Given a string with a m3u8 content, returns a M3U8 object.
Optionally parses a uri to set a correct base_uri on the M3U8 object.
Raises ValueError if invalid content
"""
if uri is None:
return M3U8(content, custom_tags_parser=custom_tags_parser)
else:
base_uri = urljoin(uri, ".")
return M3U8(content, base_uri=base_uri, custom_tags_parser=custom_tags_parser)
def load(
uri,
timeout=None,
headers={},
custom_tags_parser=None,
http_client=DefaultHTTPClient(),
verify_ssl=True,
):
"""
Retrieves the content from a given URI and returns a M3U8 object.
Raises ValueError if invalid content or IOError if request fails.
"""
base_uri_parts = urlsplit(uri)
if base_uri_parts.scheme and base_uri_parts.netloc:
content, base_uri = http_client.download(uri, timeout, headers, verify_ssl)
return M3U8(content, base_uri=base_uri, custom_tags_parser=custom_tags_parser)
else:
return _load_from_file(uri, custom_tags_parser)
def _load_from_file(uri, custom_tags_parser=None):
with open(uri, encoding="utf8") as fileobj:
raw_content = fileobj.read().strip()
base_uri = os.path.dirname(uri)
return M3U8(raw_content, base_uri=base_uri, custom_tags_parser=custom_tags_parser)

View File

@ -0,0 +1,36 @@
import gzip
import ssl
import urllib.request
from urllib.parse import urljoin
class DefaultHTTPClient:
def __init__(self, proxies=None):
self.proxies = proxies
def download(self, uri, timeout=None, headers={}, verify_ssl=True):
proxy_handler = urllib.request.ProxyHandler(self.proxies)
https_handler = HTTPSHandler(verify_ssl=verify_ssl)
opener = urllib.request.build_opener(proxy_handler, https_handler)
opener.addheaders = headers.items()
resource = opener.open(uri, timeout=timeout)
base_uri = urljoin(resource.geturl(), ".")
if resource.info().get("Content-Encoding") == "gzip":
content = gzip.decompress(resource.read()).decode(
resource.headers.get_content_charset(failobj="utf-8")
)
else:
content = resource.read().decode(
resource.headers.get_content_charset(failobj="utf-8")
)
return content, base_uri
class HTTPSHandler:
def __new__(self, verify_ssl=True):
context = ssl.create_default_context()
if not verify_ssl:
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
return urllib.request.HTTPSHandler(context=context)

View File

@ -0,0 +1,52 @@
from os.path import dirname
from urllib.parse import urljoin, urlsplit
class BasePathMixin:
@property
def absolute_uri(self):
if self.uri is None:
return None
ret = urljoin(self.base_uri, self.uri)
if self.base_uri:
base_uri_parts = urlsplit(self.base_uri)
if (not base_uri_parts.scheme) and (not base_uri_parts.netloc):
return ret
if not urlsplit(ret).scheme:
raise ValueError("There can not be `absolute_uri` with no `base_uri` set")
return ret
@property
def base_path(self):
if self.uri is None:
return None
return dirname(self.get_path_from_uri())
def get_path_from_uri(self):
"""Some URIs have a slash in the query string."""
return self.uri.split("?")[0]
@base_path.setter
def base_path(self, newbase_path):
if self.uri is not None:
if not self.base_path:
self.uri = f"{newbase_path}/{self.uri}"
else:
self.uri = self.uri.replace(self.base_path, newbase_path)
class GroupedBasePathMixin:
def _set_base_uri(self, new_base_uri):
for item in self:
item.base_uri = new_base_uri
base_uri = property(None, _set_base_uri)
def _set_base_path(self, newbase_path):
for item in self:
item.base_path = newbase_path
base_path = property(None, _set_base_path)

1673
scripts/m3u8/m3u8/model.py Normal file

File diff suppressed because it is too large Load Diff

795
scripts/m3u8/m3u8/parser.py Normal file
View File

@ -0,0 +1,795 @@
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import itertools
import re
from datetime import datetime, timedelta
try:
from backports.datetime_fromisoformat import MonkeyPatch
MonkeyPatch.patch_fromisoformat()
except ImportError:
pass
from m3u8 import protocol, version_matching
"""
http://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.2
http://stackoverflow.com/questions/2785755/how-to-split-but-ignore-separators-in-quoted-strings-in-python
"""
ATTRIBUTELISTPATTERN = re.compile(r"""((?:[^,"']|"[^"]*"|'[^']*')+)""")
def cast_date_time(value):
return datetime.fromisoformat(value)
def format_date_time(value, **kwargs):
return value.isoformat(**kwargs)
class ParseError(Exception):
def __init__(self, lineno, line):
self.lineno = lineno
self.line = line
def __str__(self):
return "Syntax error in manifest on line %d: %s" % (self.lineno, self.line)
def parse(content, strict=False, custom_tags_parser=None):
"""
Given a M3U8 playlist content returns a dictionary with all data found
"""
data = {
"media_sequence": 0,
"is_variant": False,
"is_endlist": False,
"is_i_frames_only": False,
"is_independent_segments": False,
"is_images_only": False,
"playlist_type": None,
"playlists": [],
"segments": [],
"iframe_playlists": [],
"image_playlists": [],
"tiles": [],
"media": [],
"keys": [],
"rendition_reports": [],
"skip": {},
"part_inf": {},
"session_data": [],
"session_keys": [],
"segment_map": [],
}
state = {
"expect_segment": False,
"expect_playlist": False,
"current_key": None,
"current_segment_map": None,
}
lines = string_to_lines(content)
if strict:
found_errors = version_matching.validate(lines)
if len(found_errors) > 0:
raise Exception(found_errors)
for lineno, line in enumerate(lines, 1):
line = line.strip()
parse_kwargs = {
"line": line,
"lineno": lineno,
"data": data,
"state": state,
"strict": strict,
}
# Call custom parser if needed
if line.startswith("#") and callable(custom_tags_parser):
go_to_next_line = custom_tags_parser(line, lineno, data, state)
# Do not try to parse other standard tags on this line if custom_tags_parser
# function returns `True`
if go_to_next_line:
continue
if line.startswith(protocol.ext_x_byterange):
_parse_byterange(**parse_kwargs)
continue
elif line.startswith(protocol.ext_x_bitrate):
_parse_bitrate(**parse_kwargs)
elif line.startswith(protocol.ext_x_targetduration):
_parse_targetduration(**parse_kwargs)
elif line.startswith(protocol.ext_x_media_sequence):
_parse_media_sequence(**parse_kwargs)
elif line.startswith(protocol.ext_x_discontinuity_sequence):
_parse_discontinuity_sequence(**parse_kwargs)
elif line.startswith(protocol.ext_x_program_date_time):
_parse_program_date_time(**parse_kwargs)
elif line.startswith(protocol.ext_x_discontinuity):
_parse_discontinuity(**parse_kwargs)
elif line.startswith(protocol.ext_x_cue_out_cont):
_parse_cueout_cont(**parse_kwargs)
elif line.startswith(protocol.ext_x_cue_out):
_parse_cueout(**parse_kwargs)
elif line.startswith(f"{protocol.ext_oatcls_scte35}:"):
_parse_oatcls_scte35(**parse_kwargs)
elif line.startswith(f"{protocol.ext_x_asset}:"):
_parse_asset(**parse_kwargs)
elif line.startswith(protocol.ext_x_cue_in):
_parse_cue_in(**parse_kwargs)
elif line.startswith(protocol.ext_x_cue_span):
_parse_cue_span(**parse_kwargs)
elif line.startswith(protocol.ext_x_version):
_parse_version(**parse_kwargs)
elif line.startswith(protocol.ext_x_allow_cache):
_parse_allow_cache(**parse_kwargs)
elif line.startswith(protocol.ext_x_key):
_parse_key(**parse_kwargs)
elif line.startswith(protocol.extinf):
_parse_extinf(**parse_kwargs)
elif line.startswith(protocol.ext_x_stream_inf):
_parse_stream_inf(**parse_kwargs)
elif line.startswith(protocol.ext_x_i_frame_stream_inf):
_parse_i_frame_stream_inf(**parse_kwargs)
elif line.startswith(protocol.ext_x_media):
_parse_media(**parse_kwargs)
elif line.startswith(protocol.ext_x_playlist_type):
_parse_playlist_type(**parse_kwargs)
elif line.startswith(protocol.ext_i_frames_only):
_parse_i_frames_only(**parse_kwargs)
elif line.startswith(protocol.ext_is_independent_segments):
_parse_is_independent_segments(**parse_kwargs)
elif line.startswith(protocol.ext_x_endlist):
_parse_endlist(**parse_kwargs)
elif line.startswith(protocol.ext_x_map):
_parse_x_map(**parse_kwargs)
elif line.startswith(protocol.ext_x_start):
_parse_start(**parse_kwargs)
elif line.startswith(protocol.ext_x_server_control):
_parse_server_control(**parse_kwargs)
elif line.startswith(protocol.ext_x_part_inf):
_parse_part_inf(**parse_kwargs)
elif line.startswith(protocol.ext_x_rendition_report):
_parse_rendition_report(**parse_kwargs)
elif line.startswith(protocol.ext_x_part):
_parse_part(**parse_kwargs)
elif line.startswith(protocol.ext_x_skip):
_parse_skip(**parse_kwargs)
elif line.startswith(protocol.ext_x_session_data):
_parse_session_data(**parse_kwargs)
elif line.startswith(protocol.ext_x_session_key):
_parse_session_key(**parse_kwargs)
elif line.startswith(protocol.ext_x_preload_hint):
_parse_preload_hint(**parse_kwargs)
elif line.startswith(protocol.ext_x_daterange):
_parse_daterange(**parse_kwargs)
elif line.startswith(protocol.ext_x_gap):
_parse_gap(**parse_kwargs)
elif line.startswith(protocol.ext_x_content_steering):
_parse_content_steering(**parse_kwargs)
elif line.startswith(protocol.ext_x_image_stream_inf):
_parse_image_stream_inf(**parse_kwargs)
elif line.startswith(protocol.ext_x_images_only):
_parse_is_images_only(**parse_kwargs)
elif line.startswith(protocol.ext_x_tiles):
_parse_tiles(**parse_kwargs)
# #EXTM3U should be present.
elif line.startswith(protocol.ext_m3u):
pass
# Blank lines are ignored.
elif line.strip() == "":
pass
# Lines that don't start with # are either segments or playlists.
elif (not line.startswith("#")) and (state["expect_segment"]):
_parse_ts_chunk(**parse_kwargs)
elif (not line.startswith("#")) and (state["expect_playlist"]):
_parse_variant_playlist(**parse_kwargs)
# Lines that haven't been recognized by any of the parsers above are illegal
# in strict mode.
elif strict:
raise ParseError(lineno, line)
# Handle remaining partial segments.
if "segment" in state:
data["segments"].append(state.pop("segment"))
return data
def _parse_key(line, data, state, **kwargs):
params = ATTRIBUTELISTPATTERN.split(line.replace(protocol.ext_x_key + ":", ""))[
1::2
]
key = {}
for param in params:
name, value = param.split("=", 1)
key[normalize_attribute(name)] = remove_quotes(value)
state["current_key"] = key
if key not in data["keys"]:
data["keys"].append(key)
def _parse_extinf(line, state, lineno, strict, **kwargs):
chunks = line.replace(protocol.extinf + ":", "").split(",", 1)
if len(chunks) == 2:
duration, title = chunks
elif len(chunks) == 1:
if strict:
raise ParseError(lineno, line)
else:
duration = chunks[0]
title = ""
if "segment" not in state:
state["segment"] = {}
state["segment"]["duration"] = float(duration)
state["segment"]["title"] = title
state["expect_segment"] = True
def _parse_ts_chunk(line, data, state, **kwargs):
segment = state.pop("segment")
if state.get("program_date_time"):
segment["program_date_time"] = state.pop("program_date_time")
if state.get("current_program_date_time"):
segment["current_program_date_time"] = state["current_program_date_time"]
state["current_program_date_time"] += timedelta(seconds=segment["duration"])
segment["uri"] = line
segment["cue_in"] = state.pop("cue_in", False)
segment["cue_out"] = state.pop("cue_out", False)
segment["cue_out_start"] = state.pop("cue_out_start", False)
segment["cue_out_explicitly_duration"] = state.pop(
"cue_out_explicitly_duration", False
)
scte_op = state.get if segment["cue_out"] else state.pop
segment["scte35"] = scte_op("current_cue_out_scte35", None)
segment["oatcls_scte35"] = scte_op("current_cue_out_oatcls_scte35", None)
segment["scte35_duration"] = scte_op("current_cue_out_duration", None)
segment["scte35_elapsedtime"] = scte_op("current_cue_out_elapsedtime", None)
segment["asset_metadata"] = scte_op("asset_metadata", None)
segment["discontinuity"] = state.pop("discontinuity", False)
if state.get("current_key"):
segment["key"] = state["current_key"]
else:
# For unencrypted segments, the initial key would be None
if None not in data["keys"]:
data["keys"].append(None)
if state.get("current_segment_map"):
segment["init_section"] = state["current_segment_map"]
segment["dateranges"] = state.pop("dateranges", None)
segment["gap_tag"] = state.pop("gap", None)
data["segments"].append(segment)
state["expect_segment"] = False
def _parse_attribute_list(prefix, line, attribute_parser, default_parser=None):
params = ATTRIBUTELISTPATTERN.split(line.replace(prefix + ":", ""))[1::2]
attributes = {}
if not line.startswith(prefix + ":"):
return attributes
for param in params:
param_parts = param.split("=", 1)
if len(param_parts) == 1:
name = ""
value = param_parts[0]
else:
name, value = param_parts
name = normalize_attribute(name)
if name in attribute_parser:
value = attribute_parser[name](value)
elif default_parser is not None:
value = default_parser(value)
attributes[name] = value
return attributes
def _parse_stream_inf(line, data, state, **kwargs):
state["expect_playlist"] = True
data["is_variant"] = True
data["media_sequence"] = None
attribute_parser = remove_quotes_parser(
"codecs",
"audio",
"video",
"video_range",
"subtitles",
"pathway_id",
"stable_variant_id",
)
attribute_parser["program_id"] = int
attribute_parser["bandwidth"] = lambda x: int(float(x))
attribute_parser["average_bandwidth"] = int
attribute_parser["frame_rate"] = float
attribute_parser["hdcp_level"] = str
state["stream_info"] = _parse_attribute_list(
protocol.ext_x_stream_inf, line, attribute_parser
)
def _parse_i_frame_stream_inf(line, data, **kwargs):
attribute_parser = remove_quotes_parser(
"codecs", "uri", "pathway_id", "stable_variant_id"
)
attribute_parser["program_id"] = int
attribute_parser["bandwidth"] = int
attribute_parser["average_bandwidth"] = int
attribute_parser["hdcp_level"] = str
iframe_stream_info = _parse_attribute_list(
protocol.ext_x_i_frame_stream_inf, line, attribute_parser
)
iframe_playlist = {
"uri": iframe_stream_info.pop("uri"),
"iframe_stream_info": iframe_stream_info,
}
data["iframe_playlists"].append(iframe_playlist)
def _parse_image_stream_inf(line, data, **kwargs):
attribute_parser = remove_quotes_parser(
"codecs", "uri", "pathway_id", "stable_variant_id"
)
attribute_parser["program_id"] = int
attribute_parser["bandwidth"] = int
attribute_parser["average_bandwidth"] = int
attribute_parser["resolution"] = str
image_stream_info = _parse_attribute_list(
protocol.ext_x_image_stream_inf, line, attribute_parser
)
image_playlist = {
"uri": image_stream_info.pop("uri"),
"image_stream_info": image_stream_info,
}
data["image_playlists"].append(image_playlist)
def _parse_is_images_only(line, data, **kwargs):
data["is_images_only"] = True
def _parse_tiles(line, data, state, **kwargs):
attribute_parser = remove_quotes_parser("uri")
attribute_parser["resolution"] = str
attribute_parser["layout"] = str
attribute_parser["duration"] = float
tiles_info = _parse_attribute_list(protocol.ext_x_tiles, line, attribute_parser)
data["tiles"].append(tiles_info)
def _parse_media(line, data, **kwargs):
quoted = remove_quotes_parser(
"uri",
"group_id",
"language",
"assoc_language",
"name",
"instream_id",
"characteristics",
"channels",
"stable_rendition_id",
"thumbnails",
"image",
)
media = _parse_attribute_list(protocol.ext_x_media, line, quoted)
data["media"].append(media)
def _parse_variant_playlist(line, data, state, **kwargs):
playlist = {"uri": line, "stream_info": state.pop("stream_info")}
data["playlists"].append(playlist)
state["expect_playlist"] = False
def _parse_bitrate(state, **kwargs):
if "segment" not in state:
state["segment"] = {}
state["segment"]["bitrate"] = _parse_simple_parameter(cast_to=int, **kwargs)
def _parse_byterange(line, state, **kwargs):
if "segment" not in state:
state["segment"] = {}
state["segment"]["byterange"] = line.replace(protocol.ext_x_byterange + ":", "")
state["expect_segment"] = True
def _parse_targetduration(**parse_kwargs):
return _parse_simple_parameter(cast_to=int, **parse_kwargs)
def _parse_media_sequence(**parse_kwargs):
return _parse_simple_parameter(cast_to=int, **parse_kwargs)
def _parse_discontinuity_sequence(**parse_kwargs):
return _parse_simple_parameter(cast_to=int, **parse_kwargs)
def _parse_program_date_time(line, state, data, **parse_kwargs):
_, program_date_time = _parse_simple_parameter_raw_value(
line, cast_to=cast_date_time, **parse_kwargs
)
if not data.get("program_date_time"):
data["program_date_time"] = program_date_time
state["current_program_date_time"] = program_date_time
state["program_date_time"] = program_date_time
def _parse_discontinuity(state, **parse_kwargs):
state["discontinuity"] = True
def _parse_cue_in(state, **parse_kwargs):
state["cue_in"] = True
def _parse_cue_span(state, **parse_kwargs):
state["cue_out"] = True
def _parse_version(**parse_kwargs):
return _parse_simple_parameter(cast_to=int, **parse_kwargs)
def _parse_allow_cache(**parse_kwargs):
return _parse_simple_parameter(cast_to=str, **parse_kwargs)
def _parse_playlist_type(line, data, **kwargs):
return _parse_simple_parameter(line, data)
def _parse_x_map(line, data, state, **kwargs):
quoted_parser = remove_quotes_parser("uri", "byterange")
segment_map_info = _parse_attribute_list(protocol.ext_x_map, line, quoted_parser)
state["current_segment_map"] = segment_map_info
data["segment_map"].append(segment_map_info)
def _parse_start(line, data, **kwargs):
attribute_parser = {"time_offset": lambda x: float(x)}
start_info = _parse_attribute_list(protocol.ext_x_start, line, attribute_parser)
data["start"] = start_info
def _parse_gap(state, **kwargs):
state["gap"] = True
def _parse_simple_parameter_raw_value(line, cast_to=str, normalize=False, **kwargs):
param, value = line.split(":", 1)
param = normalize_attribute(param.replace("#EXT-X-", ""))
if normalize:
value = value.strip().lower()
return param, cast_to(value)
def _parse_and_set_simple_parameter_raw_value(
line, data, cast_to=str, normalize=False, **kwargs
):
param, value = _parse_simple_parameter_raw_value(line, cast_to, normalize)
data[param] = value
return data[param]
def _parse_simple_parameter(line, data, cast_to=str, **kwargs):
return _parse_and_set_simple_parameter_raw_value(line, data, cast_to, True)
def _parse_i_frames_only(data, **kwargs):
data["is_i_frames_only"] = True
def _parse_is_independent_segments(data, **kwargs):
data["is_independent_segments"] = True
def _parse_endlist(data, **kwargs):
data["is_endlist"] = True
def _parse_cueout_cont(line, state, **kwargs):
state["cue_out"] = True
elements = line.split(":", 1)
if len(elements) != 2:
return
# EXT-X-CUE-OUT-CONT:ElapsedTime=10,Duration=60,SCTE35=... style
cue_info = _parse_attribute_list(
protocol.ext_x_cue_out_cont,
line,
remove_quotes_parser("duration", "elapsedtime", "scte35"),
)
# EXT-X-CUE-OUT-CONT:2.436/120 style
progress = cue_info.get("")
if progress:
progress_parts = progress.split("/", 1)
if len(progress_parts) == 1:
state["current_cue_out_duration"] = progress_parts[0]
else:
state["current_cue_out_elapsedtime"] = progress_parts[0]
state["current_cue_out_duration"] = progress_parts[1]
duration = cue_info.get("duration")
if duration:
state["current_cue_out_duration"] = duration
scte35 = cue_info.get("scte35")
if duration:
state["current_cue_out_scte35"] = scte35
elapsedtime = cue_info.get("elapsedtime")
if elapsedtime:
state["current_cue_out_elapsedtime"] = elapsedtime
def _parse_cueout(line, state, **kwargs):
state["cue_out_start"] = True
state["cue_out"] = True
if "DURATION" in line.upper():
state["cue_out_explicitly_duration"] = True
elements = line.split(":", 1)
if len(elements) != 2:
return
cue_info = _parse_attribute_list(
protocol.ext_x_cue_out,
line,
remove_quotes_parser("cue"),
)
cue_out_scte35 = cue_info.get("cue")
cue_out_duration = cue_info.get("duration") or cue_info.get("")
current_cue_out_scte35 = state.get("current_cue_out_scte35")
state["current_cue_out_scte35"] = cue_out_scte35 or current_cue_out_scte35
state["current_cue_out_duration"] = cue_out_duration
def _parse_server_control(line, data, **kwargs):
attribute_parser = {
"can_block_reload": str,
"hold_back": lambda x: float(x),
"part_hold_back": lambda x: float(x),
"can_skip_until": lambda x: float(x),
"can_skip_dateranges": str,
}
data["server_control"] = _parse_attribute_list(
protocol.ext_x_server_control, line, attribute_parser
)
def _parse_part_inf(line, data, **kwargs):
attribute_parser = {"part_target": lambda x: float(x)}
data["part_inf"] = _parse_attribute_list(
protocol.ext_x_part_inf, line, attribute_parser
)
def _parse_rendition_report(line, data, **kwargs):
attribute_parser = remove_quotes_parser("uri")
attribute_parser["last_msn"] = int
attribute_parser["last_part"] = int
rendition_report = _parse_attribute_list(
protocol.ext_x_rendition_report, line, attribute_parser
)
data["rendition_reports"].append(rendition_report)
def _parse_part(line, state, **kwargs):
attribute_parser = remove_quotes_parser("uri")
attribute_parser["duration"] = lambda x: float(x)
attribute_parser["independent"] = str
attribute_parser["gap"] = str
attribute_parser["byterange"] = str
part = _parse_attribute_list(protocol.ext_x_part, line, attribute_parser)
# this should always be true according to spec
if state.get("current_program_date_time"):
part["program_date_time"] = state["current_program_date_time"]
state["current_program_date_time"] += timedelta(seconds=part["duration"])
part["dateranges"] = state.pop("dateranges", None)
part["gap_tag"] = state.pop("gap", None)
if "segment" not in state:
state["segment"] = {}
segment = state["segment"]
if "parts" not in segment:
segment["parts"] = []
segment["parts"].append(part)
def _parse_skip(line, data, **parse_kwargs):
attribute_parser = remove_quotes_parser("recently_removed_dateranges")
attribute_parser["skipped_segments"] = int
data["skip"] = _parse_attribute_list(protocol.ext_x_skip, line, attribute_parser)
def _parse_session_data(line, data, **kwargs):
quoted = remove_quotes_parser("data_id", "value", "uri", "language")
session_data = _parse_attribute_list(protocol.ext_x_session_data, line, quoted)
data["session_data"].append(session_data)
def _parse_session_key(line, data, **kwargs):
params = ATTRIBUTELISTPATTERN.split(
line.replace(protocol.ext_x_session_key + ":", "")
)[1::2]
key = {}
for param in params:
name, value = param.split("=", 1)
key[normalize_attribute(name)] = remove_quotes(value)
data["session_keys"].append(key)
def _parse_preload_hint(line, data, **kwargs):
attribute_parser = remove_quotes_parser("uri")
attribute_parser["type"] = str
attribute_parser["byterange_start"] = int
attribute_parser["byterange_length"] = int
data["preload_hint"] = _parse_attribute_list(
protocol.ext_x_preload_hint, line, attribute_parser
)
def _parse_daterange(line, state, **kwargs):
attribute_parser = remove_quotes_parser("id", "class", "start_date", "end_date")
attribute_parser["duration"] = float
attribute_parser["planned_duration"] = float
attribute_parser["end_on_next"] = str
attribute_parser["scte35_cmd"] = str
attribute_parser["scte35_out"] = str
attribute_parser["scte35_in"] = str
parsed = _parse_attribute_list(protocol.ext_x_daterange, line, attribute_parser)
if "dateranges" not in state:
state["dateranges"] = []
state["dateranges"].append(parsed)
def _parse_content_steering(line, data, **kwargs):
attribute_parser = remove_quotes_parser("server_uri", "pathway_id")
data["content_steering"] = _parse_attribute_list(
protocol.ext_x_content_steering, line, attribute_parser
)
def _parse_oatcls_scte35(line, state, **kwargs):
scte35_cue = line.split(":", 1)[1]
state["current_cue_out_oatcls_scte35"] = scte35_cue
state["current_cue_out_scte35"] = scte35_cue
def _parse_asset(line, state, **kwargs):
# EXT-X-ASSET attribute values may or may not be quoted, and need to be URL-encoded.
# They are preserved as-is here to prevent loss of information.
state["asset_metadata"] = _parse_attribute_list(
protocol.ext_x_asset, line, {}, default_parser=str
)
def string_to_lines(string):
return string.strip().splitlines()
def remove_quotes_parser(*attrs):
return dict(zip(attrs, itertools.repeat(remove_quotes)))
def remove_quotes(string):
"""
Remove quotes from string.
Ex.:
"foo" -> foo
'foo' -> foo
'foo -> 'foo
"""
quotes = ('"', "'")
if string.startswith(quotes) and string.endswith(quotes):
return string[1:-1]
return string
def normalize_attribute(attribute):
return attribute.replace("-", "_").lower().strip()
def get_segment_custom_value(state, key, default=None):
"""
Helper function for getting custom values for Segment
Are useful with custom_tags_parser
"""
if "segment" not in state:
return default
if "custom_parser_values" not in state["segment"]:
return default
return state["segment"]["custom_parser_values"].get(key, default)
def save_segment_custom_value(state, key, value):
"""
Helper function for saving custom values for Segment
Are useful with custom_tags_parser
"""
if "segment" not in state:
state["segment"] = {}
if "custom_parser_values" not in state["segment"]:
state["segment"]["custom_parser_values"] = {}
state["segment"]["custom_parser_values"][key] = value

View File

@ -0,0 +1,45 @@
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
ext_m3u = "#EXTM3U"
ext_x_targetduration = "#EXT-X-TARGETDURATION"
ext_x_media_sequence = "#EXT-X-MEDIA-SEQUENCE"
ext_x_discontinuity_sequence = "#EXT-X-DISCONTINUITY-SEQUENCE"
ext_x_program_date_time = "#EXT-X-PROGRAM-DATE-TIME"
ext_x_media = "#EXT-X-MEDIA"
ext_x_playlist_type = "#EXT-X-PLAYLIST-TYPE"
ext_x_key = "#EXT-X-KEY"
ext_x_stream_inf = "#EXT-X-STREAM-INF"
ext_x_version = "#EXT-X-VERSION"
ext_x_allow_cache = "#EXT-X-ALLOW-CACHE"
ext_x_endlist = "#EXT-X-ENDLIST"
extinf = "#EXTINF"
ext_i_frames_only = "#EXT-X-I-FRAMES-ONLY"
ext_x_asset = "#EXT-X-ASSET"
ext_x_bitrate = "#EXT-X-BITRATE"
ext_x_byterange = "#EXT-X-BYTERANGE"
ext_x_i_frame_stream_inf = "#EXT-X-I-FRAME-STREAM-INF"
ext_x_discontinuity = "#EXT-X-DISCONTINUITY"
ext_x_cue_out = "#EXT-X-CUE-OUT"
ext_x_cue_out_cont = "#EXT-X-CUE-OUT-CONT"
ext_x_cue_in = "#EXT-X-CUE-IN"
ext_x_cue_span = "#EXT-X-CUE-SPAN"
ext_oatcls_scte35 = "#EXT-OATCLS-SCTE35"
ext_is_independent_segments = "#EXT-X-INDEPENDENT-SEGMENTS"
ext_x_map = "#EXT-X-MAP"
ext_x_start = "#EXT-X-START"
ext_x_server_control = "#EXT-X-SERVER-CONTROL"
ext_x_part_inf = "#EXT-X-PART-INF"
ext_x_part = "#EXT-X-PART"
ext_x_rendition_report = "#EXT-X-RENDITION-REPORT"
ext_x_skip = "#EXT-X-SKIP"
ext_x_session_data = "#EXT-X-SESSION-DATA"
ext_x_session_key = "#EXT-X-SESSION-KEY"
ext_x_preload_hint = "#EXT-X-PRELOAD-HINT"
ext_x_daterange = "#EXT-X-DATERANGE"
ext_x_gap = "#EXT-X-GAP"
ext_x_content_steering = "#EXT-X-CONTENT-STEERING"
ext_x_image_stream_inf = "#EXT-X-IMAGE-STREAM-INF"
ext_x_images_only = "#EXT-X-IMAGES-ONLY"
ext_x_tiles = "#EXT-X-TILES"

View File

@ -0,0 +1,37 @@
from m3u8 import protocol
from m3u8.version_matching_rules import VersionMatchingError, available_rules
def get_version(file_lines: list[str]):
for line in file_lines:
if line.startswith(protocol.ext_x_version):
version = line.split(":")[1]
return float(version)
return None
def valid_in_all_rules(
line_number: int, line: str, version: float
) -> list[VersionMatchingError]:
errors = []
for rule in available_rules:
validator = rule(version, line_number, line)
if not validator.validate():
errors.append(validator.get_error())
return errors
def validate(file_lines: list[str]) -> list[VersionMatchingError]:
found_version = get_version(file_lines)
if found_version is None:
return []
errors = []
for number, line in enumerate(file_lines):
errors_in_line = valid_in_all_rules(number, line, found_version)
errors.extend(errors_in_line)
return errors

View File

@ -0,0 +1,108 @@
from dataclasses import dataclass
from m3u8 import protocol
@dataclass
class VersionMatchingError(Exception):
line_number: int
line: str
how_to_fix: str = "Please fix the version matching error."
description: str = "There is a version matching error in the file."
def __str__(self):
return (
"Version matching error found in the file when parsing in strict mode.\n"
f"Line {self.line_number}: {self.description}\n"
f"Line content: {self.line}\n"
f"How to fix: {self.how_to_fix}"
"\n"
)
class VersionMatchRuleBase:
description: str = ""
how_to_fix: str = ""
version: float
line_number: int
line: str
def __init__(self, version: float, line_number: int, line: str) -> None:
self.version = version
self.line_number = line_number
self.line = line
def validate(self):
raise NotImplementedError
def get_error(self):
return VersionMatchingError(
line_number=self.line_number,
line=self.line,
description=self.description,
how_to_fix=self.how_to_fix,
)
class ValidIVInEXTXKEY(VersionMatchRuleBase):
description = (
"You must use at least protocol version 2 if you have IV in EXT-X-KEY."
)
how_to_fix = "Change the protocol version to 2 or higher."
def validate(self):
if protocol.ext_x_key not in self.line:
return True
if "IV" in self.line:
return self.version >= 2
return True
class ValidFloatingPointEXTINF(VersionMatchRuleBase):
description = "You must use at least protocol version 3 if you have floating point EXTINF duration values."
how_to_fix = "Change the protocol version to 3 or higher."
def validate(self):
if protocol.extinf not in self.line:
return True
chunks = self.line.replace(protocol.extinf + ":", "").split(",", 1)
duration = chunks[0]
def is_number(value: str):
try:
float(value)
return True
except ValueError:
return False
def is_floating_number(value: str):
return is_number(value) and "." in value
if is_floating_number(duration):
return self.version >= 3
return is_number(duration)
class ValidEXTXBYTERANGEOrEXTXIFRAMESONLY(VersionMatchRuleBase):
description = "You must use at least protocol version 4 if you have EXT-X-BYTERANGE or EXT-X-IFRAME-ONLY."
how_to_fix = "Change the protocol version to 4 or higher."
def validate(self):
if (
protocol.ext_x_byterange not in self.line
and protocol.ext_i_frames_only not in self.line
):
return True
return self.version >= 4
available_rules: list[type[VersionMatchRuleBase]] = [
ValidIVInEXTXKEY,
ValidFloatingPointEXTINF,
ValidEXTXBYTERANGEOrEXTXIFRAMESONLY,
]

View File

@ -0,0 +1,8 @@
-r requirements.txt
bottle
pytest
# pytest-cov 2.6.0 has increased the version requirement
# for the coverage package from >=3.7.1 to >=4.4,
# which is in conflict with the version requirement
# defined by the python-coveralls package for coverage==4.0.3
pytest-cov>=2.4.0,<2.6

View File

@ -0,0 +1 @@
backports-datetime-fromisoformat; python_version < '3.11'

36
scripts/m3u8/runtests Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
test_server_stdout=tests/server.stdout
function install_deps {
pip install -r requirements-dev.txt
}
function start_server {
rm -f ${test_server_stdout}
python tests/m3u8server.py >${test_server_stdout} 2>&1 &
}
function stop_server {
pkill -9 -f m3u8server.py
echo "Test server stdout on ${test_server_stdout}"
}
function run {
PYTHONPATH=. py.test -vv --cov-report term-missing --cov m3u8 tests/
}
function main {
install_deps
start_server
run
retval=$?
stop_server
return "$retval"
}
if [ -z "$1" ]; then
main
else
"$@"
fi

28
scripts/m3u8/setup.py Normal file
View File

@ -0,0 +1,28 @@
from os.path import abspath, dirname, exists, join
from setuptools import setup
long_description = None
if exists("README.md"):
with open("README.md") as file:
long_description = file.read()
install_reqs = [
req for req in open(abspath(join(dirname(__file__), "requirements.txt")))
]
setup(
name="m3u8",
author="Globo.com",
version="6.0.0",
license="MIT",
zip_safe=False,
include_package_data=True,
install_requires=install_reqs,
packages=["m3u8"],
url="https://github.com/globocom/m3u8",
description="Python m3u8 parser",
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=">=3.9",
)

403
scripts/pyplayready/LICENSE Normal file
View File

@ -0,0 +1,403 @@
Attribution-NonCommercial-NoDerivatives 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-NoDerivatives 4.0 International Public
License ("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
c. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
d. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
e. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
f. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
g. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
h. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce and reproduce, but not Share, Adapted Material
for NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material, You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
For the avoidance of doubt, You do not have permission under
this Public License to Share Adapted Material.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only and provided You do not Share Adapted Material;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@ -1,5 +1,5 @@
# pyplayready
All of this is already public. 100% of this code has been derived from the mspr_toolkit.
All of this is already public. Almost 100% of this code has been derived from the mspr_toolkit.
## Installation
```shell
@ -19,9 +19,6 @@ Test a playready device:
pyplayready test DEVICE.prd
```
> [!IMPORTANT]
> There currently isn't a proper method of extracting Group Certificates/Keys. They can be found inside older Samsung phones/Smart TVs, Windows DLLs and set-top-boxes in encrypted form.
Export a provisioned device to its raw .dat files
```shell
pyplayready export-device DEVICE.prd
@ -55,8 +52,7 @@ pssh = PSSH(
"AFQATwBNAEEAVABUAFIASQBCAFUAVABFAFMAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA=="
)
wrm_headers = pssh.get_wrm_headers()
request = cdm.get_license_challenge(session_id, wrm_headers[0])
request = cdm.get_license_challenge(session_id, pssh.wrm_headers[0])
response = requests.post(
url="https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:2000)",

View File

@ -11,4 +11,4 @@ from pyplayready.system.pssh import *
from pyplayready.system.session import *
__version__ = "0.5.0"
__version__ = "0.6.0"

View File

@ -1,46 +1,49 @@
from __future__ import annotations
import base64
import math
import time
from typing import List, Union
from typing import List, Union, Optional
from uuid import UUID
import xml.etree.ElementTree as ET
import xmltodict
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad
from Crypto.Util.strxor import strxor
from ecpy.curves import Point, Curve
from pyplayready.crypto import Crypto
from pyplayready.drmresults import DRMResult
from pyplayready.system.bcert import CertificateChain
from pyplayready.crypto.ecc_key import ECCKey
from pyplayready.license.key import Key
from pyplayready.license.xmrlicense import XMRLicense
from pyplayready.exceptions import (InvalidSession, TooManySessions, InvalidLicense)
from pyplayready.license.xmrlicense import XMRLicense, XMRObjectTypes
from pyplayready.exceptions import (InvalidSession, TooManySessions, InvalidLicense, ServerException)
from pyplayready.system.session import Session
from pyplayready.system.wrmheader import WRMHeader
class Cdm:
MAX_NUM_OF_SESSIONS = 16
rgbMagicConstantZero = bytes.fromhex("7ee9ed4af773224f00b8ea7efb027cbb")
def __init__(
self,
security_level: int,
certificate_chain: Union[CertificateChain, None],
encryption_key: Union[ECCKey, None],
signing_key: Union[ECCKey, None],
certificate_chain: Optional[CertificateChain],
encryption_key: Optional[ECCKey],
signing_key: Optional[ECCKey],
client_version: str = "10.0.16384.10011",
protocol_version: int = 1
):
self.security_level = security_level
self.certificate_chain = certificate_chain
self.encryption_key = encryption_key
self.signing_key = signing_key
self.client_version = client_version
self.protocol_version = protocol_version
self.__crypto = Crypto()
self._wmrm_key = Point(
@ -48,7 +51,6 @@ class Cdm:
y=0x982b27b5cb2341326e56aa857dbfd5c634ce2cf9ea74fca8f2af5957efeea562,
curve=Curve.get_curve("secp256r1")
)
self._rgbMagicConstantZero = bytes([0x7e, 0xe9, 0xed, 0x4a, 0xf7, 0x73, 0x22, 0x4f, 0x00, 0xb8, 0xea, 0x7e, 0xfb, 0x02, 0x7c, 0xbb])
self.__sessions: dict[bytes, Session] = {}
@ -63,12 +65,7 @@ class Cdm:
)
def open(self) -> bytes:
"""
Open a Playready Content Decryption Module (CDM) session.
Raises:
TooManySessions: If the session cannot be opened as limit has been reached.
"""
"""Open a Playready Content Decryption Module (CDM) session"""
if len(self.__sessions) > self.MAX_NUM_OF_SESSIONS:
raise TooManySessions(f"Too many Sessions open ({self.MAX_NUM_OF_SESSIONS}).")
@ -78,18 +75,10 @@ class Cdm:
return session.id
def close(self, session_id: bytes) -> None:
"""
Close a Playready Content Decryption Module (CDM) session.
Parameters:
session_id: Session identifier.
Raises:
InvalidSession: If the Session identifier is invalid.
"""
"""Close a Playready Content Decryption Module (CDM) session """
session = self.__sessions.get(session_id)
if not session:
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
raise InvalidSession(f"Session identifier {session_id.hex()} is invalid.")
del self.__sessions[session_id]
def _get_key_data(self, session: Session) -> bytes:
@ -100,17 +89,22 @@ class Cdm:
def _get_cipher_data(self, session: Session) -> bytes:
b64_chain = base64.b64encode(self.certificate_chain.dumps()).decode()
body = (
"<Data>"
f"<CertificateChains><CertificateChain>{b64_chain}</CertificateChain></CertificateChains>"
"<Features>"
'<Feature Name="AESCBC">""</Feature>'
"<REE>"
"<AESCBCS></AESCBCS>"
"</REE>"
"</Features>"
"</Data>"
)
body = xmltodict.unparse({
'Data': {
'CertificateChains': {
'CertificateChain': b64_chain
},
'Features': {
'Feature': {
'@Name': 'AESCBC',
'#text': '""'
},
'REE': {
'AESCBCS': None
}
}
}
}, full_document=False)
cipher = AES.new(
key=session.xml_key.aes_key,
@ -125,109 +119,157 @@ class Cdm:
return session.xml_key.aes_iv + ciphertext
@staticmethod
def _build_main_body(la_content: dict, signed_info: dict, signature: str, public_signing_key: str) -> dict:
return {
'soap:Envelope': {
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'@xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'@xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
'soap:Body': {
'AcquireLicense': {
'@xmlns': 'http://schemas.microsoft.com/DRM/2007/03/protocols',
'challenge': {
'Challenge': {
'@xmlns': 'http://schemas.microsoft.com/DRM/2007/03/protocols/messages',
'LA': la_content["LA"],
'Signature': {
'SignedInfo': signed_info["SignedInfo"],
'@xmlns': 'http://www.w3.org/2000/09/xmldsig#',
'SignatureValue': signature,
'KeyInfo': {
'@xmlns': 'http://www.w3.org/2000/09/xmldsig#',
'KeyValue': {
'ECCKeyValue': {
'PublicKey': public_signing_key
}
}
}
}
}
}
}
}
}
}
def _build_digest_content(
self,
wrm_header: str,
nonce: str,
wmrm_cipher: str,
cert_cipher: str
) -> str:
return (
'<LA xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols" Id="SignedData" xml:space="preserve">'
f'<Version>{self.protocol_version}</Version>'
f'<ContentHeader>{wrm_header}</ContentHeader>'
'<CLIENTINFO>'
f'<CLIENTVERSION>{self.client_version}</CLIENTVERSION>'
'</CLIENTINFO>'
f'<LicenseNonce>{nonce}</LicenseNonce>'
f'<ClientTime>{math.floor(time.time())}</ClientTime>'
'<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element">'
'<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"></EncryptionMethod>'
'<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">'
'<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">'
'<EncryptionMethod Algorithm="http://schemas.microsoft.com/DRM/2007/03/protocols#ecc256"></EncryptionMethod>'
'<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">'
'<KeyName>WMRMServer</KeyName>'
'</KeyInfo>'
'<CipherData>'
f'<CipherValue>{wmrm_cipher}</CipherValue>'
'</CipherData>'
'</EncryptedKey>'
'</KeyInfo>'
'<CipherData>'
f'<CipherValue>{cert_cipher}</CipherValue>'
'</CipherData>'
'</EncryptedData>'
'</LA>'
)
cert_cipher: str,
protocol_version: int
) -> dict:
return {
'LA': {
'@xmlns': 'http://schemas.microsoft.com/DRM/2007/03/protocols',
'@Id': 'SignedData',
'@xml:space': 'preserve',
'Version': protocol_version,
'ContentHeader': xmltodict.parse(wrm_header),
'CLIENTINFO': {
'CLIENTVERSION': self.client_version
},
'LicenseNonce': nonce,
'ClientTime': int(time.time()),
'EncryptedData': {
'@xmlns': 'http://www.w3.org/2001/04/xmlenc#',
'@Type': 'http://www.w3.org/2001/04/xmlenc#Element',
'EncryptionMethod': {
'@Algorithm': 'http://www.w3.org/2001/04/xmlenc#aes128-cbc'
},
'KeyInfo': {
'@xmlns': 'http://www.w3.org/2000/09/xmldsig#',
'EncryptedKey': {
'@xmlns': 'http://www.w3.org/2001/04/xmlenc#',
'EncryptionMethod': {
'@Algorithm': 'http://schemas.microsoft.com/DRM/2007/03/protocols#ecc256'
},
'KeyInfo': {
'@xmlns': 'http://www.w3.org/2000/09/xmldsig#',
'KeyName': 'WMRMServer'
},
'CipherData': {
'CipherValue': wmrm_cipher
}
}
},
'CipherData': {
'CipherValue': cert_cipher
}
}
}
}
@staticmethod
def _build_signed_info(digest_value: str) -> str:
return (
'<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">'
'<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod>'
'<SignatureMethod Algorithm="http://schemas.microsoft.com/DRM/2007/03/protocols#ecdsa-sha256"></SignatureMethod>'
'<Reference URI="#SignedData">'
'<DigestMethod Algorithm="http://schemas.microsoft.com/DRM/2007/03/protocols#sha256"></DigestMethod>'
f'<DigestValue>{digest_value}</DigestValue>'
'</Reference>'
'</SignedInfo>'
)
def _build_signed_info(digest_value: str) -> dict:
return {
'SignedInfo': {
'@xmlns': 'http://www.w3.org/2000/09/xmldsig#',
'CanonicalizationMethod': {
'@Algorithm': 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
},
'SignatureMethod': {
'@Algorithm': 'http://schemas.microsoft.com/DRM/2007/03/protocols#ecdsa-sha256'
},
'Reference': {
'@URI': '#SignedData',
'DigestMethod': {
'@Algorithm': 'http://schemas.microsoft.com/DRM/2007/03/protocols#sha256'
},
'DigestValue': digest_value
}
}
}
def get_license_challenge(self, session_id: bytes, wrm_header: str) -> str:
def get_license_challenge(self, session_id: bytes, wrm_header: Union[WRMHeader, str]) -> str:
session = self.__sessions.get(session_id)
if not session:
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
raise InvalidSession(f"Session identifier {session_id.hex()} is invalid.")
if isinstance(wrm_header, str):
wrm_header = WRMHeader(wrm_header)
if not isinstance(wrm_header, WRMHeader):
raise ValueError(f"Expected WRMHeader to be a {str} or {WRMHeader} not {wrm_header!r}")
match wrm_header.version:
case WRMHeader.Version.VERSION_4_3_0_0:
protocol_version = 5
case WRMHeader.Version.VERSION_4_2_0_0:
protocol_version = 4
case _:
protocol_version = 1
session.signing_key = self.signing_key
session.encryption_key = self.encryption_key
la_content = self._build_digest_content(
wrm_header=wrm_header,
wrm_header=wrm_header.dumps(),
nonce=base64.b64encode(get_random_bytes(16)).decode(),
wmrm_cipher=base64.b64encode(self._get_key_data(session)).decode(),
cert_cipher=base64.b64encode(self._get_cipher_data(session)).decode()
cert_cipher=base64.b64encode(self._get_cipher_data(session)).decode(),
protocol_version=protocol_version
)
la_content_xml = xmltodict.unparse(la_content, full_document=False)
la_hash_obj = SHA256.new()
la_hash_obj.update(la_content.encode())
la_hash_obj.update(la_content_xml.encode())
la_hash = la_hash_obj.digest()
signed_info = self._build_signed_info(base64.b64encode(la_hash).decode())
signature = self.__crypto.ecc256_sign(session.signing_key, signed_info.encode())
signed_info_xml = xmltodict.unparse(signed_info, full_document=False)
# haven't found a better way to do this. xmltodict.unparse doesn't work
main_body = (
'<?xml version="1.0" encoding="utf-8"?>'
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
'<soap:Body>'
'<AcquireLicense xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols">'
'<challenge>'
'<Challenge xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols/messages">'
+ la_content +
'<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">'
+ signed_info +
f'<SignatureValue>{base64.b64encode(signature).decode()}</SignatureValue>'
'<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">'
'<KeyValue>'
'<ECCKeyValue>'
f'<PublicKey>{base64.b64encode(session.signing_key.public_bytes()).decode()}</PublicKey>'
'</ECCKeyValue>'
'</KeyValue>'
'</KeyInfo>'
'</Signature>'
'</Challenge>'
'</challenge>'
'</AcquireLicense>'
'</soap:Body>'
'</soap:Envelope>'
)
signature = self.__crypto.ecc256_sign(session.signing_key, signed_info_xml.encode())
b64_signature = base64.b64encode(signature).decode()
return main_body
b64_public_singing_key = base64.b64encode(session.signing_key.public_bytes()).decode()
return xmltodict.unparse(self._build_main_body(la_content, signed_info, b64_signature, b64_public_singing_key)).replace('\n', '')
@staticmethod
def _verify_encryption_key(session: Session, licence: XMRLicense) -> bool:
ecc_keys = list(licence.get_object(42))
ecc_keys = list(licence.get_object(XMRObjectTypes.ECC_DEVICE_KEY_OBJECT))
if not ecc_keys:
raise InvalidLicense("No ECC public key in license")
@ -236,13 +278,25 @@ class Cdm:
def parse_license(self, session_id: bytes, licence: str) -> None:
session = self.__sessions.get(session_id)
if not session:
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
raise InvalidSession(f"Session identifier {session_id.hex()} is invalid.")
if not licence:
raise InvalidLicense("Cannot parse an empty licence message")
if not isinstance(licence, str):
raise InvalidLicense(f"Expected licence message to be a {str}, not {licence!r}")
if not session.encryption_key or not session.signing_key:
raise InvalidSession("Cannot parse a license message without first making a license request")
try:
root = ET.fromstring(licence)
faults = root.findall(".//{http://schemas.xmlsoap.org/soap/envelope/}Fault")
for fault in faults:
status_codes = fault.findall(".//StatusCode")
for status_code in status_codes:
code = DRMResult.from_code(status_code.text)
raise ServerException(f"[{status_code.text}] ({code.name}) {code.message}")
license_elements = root.findall(".//{http://schemas.microsoft.com/DRM/2007/03/protocols}License")
for license_element in license_elements:
@ -251,12 +305,12 @@ class Cdm:
if not self._verify_encryption_key(session, parsed_licence):
raise InvalidLicense("Public encryption key does not match")
is_scalable = bool(next(parsed_licence.get_object(81), None))
is_scalable = bool(next(parsed_licence.get_object(XMRObjectTypes.AUX_KEY_OBJECT), None))
for content_key in parsed_licence.get_content_keys():
cipher_type = Key.CipherType(content_key.cipher_type)
if not cipher_type in (Key.CipherType.ECC_256, Key.CipherType.ECC_256_WITH_KZ, Key.CipherType.ECC_256_VIA_SYMMETRIC):
if cipher_type not in (Key.CipherType.ECC_256, Key.CipherType.ECC_256_WITH_KZ, Key.CipherType.ECC_256_VIA_SYMMETRIC):
raise InvalidLicense(f"Invalid cipher type {cipher_type}")
via_symmetric = Key.CipherType(content_key.cipher_type) == Key.CipherType.ECC_256_VIA_SYMMETRIC
@ -265,7 +319,7 @@ class Cdm:
private_key=session.encryption_key,
ciphertext=content_key.encrypted_key
)
ci, ck = decrypted[:16], decrypted[16:32]
ci, ck = decrypted[:16], decrypted[16:]
if is_scalable:
ci, ck = decrypted[::2][:16], decrypted[1::2][:16]
@ -274,13 +328,12 @@ class Cdm:
embedded_root_license = content_key.encrypted_key[:144]
embedded_leaf_license = content_key.encrypted_key[144:]
rgb_key = bytes(ck[i] ^ self._rgbMagicConstantZero[i] for i in range(16))
rgb_key = strxor(ck, self.rgbMagicConstantZero)
content_key_prime = AES.new(ck, AES.MODE_ECB).encrypt(rgb_key)
aux_key = next(parsed_licence.get_object(81))["auxiliary_keys"][0]["key"]
derived_aux_key = AES.new(content_key_prime, AES.MODE_ECB).encrypt(aux_key)
aux_key = next(parsed_licence.get_object(XMRObjectTypes.AUX_KEY_OBJECT))["auxiliary_keys"][0]["key"]
uplink_x_key = bytes(bytearray(16)[i] ^ derived_aux_key[i] for i in range(16))
uplink_x_key = AES.new(content_key_prime, AES.MODE_ECB).encrypt(aux_key)
secondary_key = AES.new(ck, AES.MODE_ECB).encrypt(embedded_root_license[128:])
embedded_leaf_license = AES.new(uplink_x_key, AES.MODE_ECB).encrypt(embedded_leaf_license)
@ -298,14 +351,12 @@ class Cdm:
key_length=content_key.key_length,
key=ck
))
except InvalidLicense as e:
raise InvalidLicense(e)
except Exception as e:
raise Exception(f"Unable to parse license, {e}")
raise InvalidLicense(f"Unable to parse license: {e}")
def get_keys(self, session_id: bytes) -> List[Key]:
session = self.__sessions.get(session_id)
if not session:
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
raise InvalidSession(f"Session identifier {session_id.hex()} is invalid.")
return session.keys

View File

@ -16,7 +16,7 @@ class DeviceStructs:
"group_certificate_length" / Int32ub,
"group_certificate" / Bytes(this.group_certificate_length),
"encryption_key" / Bytes(96),
"signing_key" / Bytes(96),
"signing_key" / Bytes(96)
)
v3 = Struct(
@ -24,7 +24,7 @@ class DeviceStructs:
"encryption_key" / Bytes(96),
"signing_key" / Bytes(96),
"group_certificate_length" / Int32ub,
"group_certificate" / Bytes(this.group_certificate_length),
"group_certificate" / Bytes(this.group_certificate_length)
)
prd = Struct(

View File

@ -0,0 +1,908 @@
from enum import Enum
class DRMResult(Enum):
"""Holds Playready DRM results (error codes and their messages)"""
DRM_SUCCESS = (0x00000000, "Operation was successful.")
DRM_S_FALSE = (0x00000001, "Operation was successful, but returned a FALSE test condition.")
DRM_S_MORE_DATA = (0x00000002, "Operation was successful, but more data is available.")
DRM_S_TEST_SKIP_FILE = (0x0004C300, "Skip processing this file, not an eror.")
DRM_S_TEST_CONVERTED_FILE = (0x0004C301, "The file was converted to a PlayReady file during the action.")
DRM_E_OEM_CONSTRAINT_1_FAIL = (0x8004DFF, "Failed while OEM CONSTRAINT-1 check")
DRM_E_OEM_CONSTRAINT_2_FAIL = (0x8004DFF, "Failed while OEM CONSTRAINT-2 check")
DRM_E_OEM_CONSTRAINT_3_FAIL = (0x8004DFF, "Failed while OEM CONSTRAINT-3 check")
DRM_E_HDCP_NON_SECURE = (0x8004DFF, "Attempt to play back through insecure HDMI output path")
DRM_E_OUTOFMEMORY = (0x80000002, "Insufficient resources exist to complete the request.")
DRM_E_NOTIMPL = (0x80004001, "The requested operation is not implemented.")
DRM_E_POINTER = (0x80004003, "Invalid pointer.")
DRM_E_FAIL = (0x80004005, "The requested operation failed.")
DRM_E_HLOS_TAMPERED = (0x80004006, "HLOS tampered.")
DRM_E_OPL_BLOCKED = (0x80004007, "OPL blocked.")
DRM_E_LOAD_IMG = (0x80004008, "Failed on loading playready image.")
DRM_E_VER_MISMATCH = (0x80004009, "Version mismatch between HLOS and TZ.")
DRM_E_SET_BANDWIDTH = (0x8000400A, "Failed on setting bandwidth.")
DRM_E_OUT_OF_BOUND = (0x8000400B, "Out of bound.")
DRM_E_PLAY_ENABLER_BLOCKED = (0x8000400C, "WFD is blocked as play enabler object for HDCP doesn't exist in license")
DRM_E_HDMI_READ_FAIL = (0x8000400E, "Failed to read HDMI Status")
DRM_E_FILENOTFOUND = (0x80030002, "A requested file could not be found.")
DRM_E_FILEOPEN = (0x8003006E, "A request failed due to a file being open.")
DRM_E_VERIFICATION_FAILURE = (0x80040E80, "Validation of a Longhorn certificate failed.")
DRM_E_RSA_SIGNATURE_ERROR = (0x80040E82, "Error in RSA(PSS) signature.")
DRM_E_BAD_RSA_EXPONENT = (0x80040E86, "An incorrect RSA exponent was supplied for a public key.")
DRM_E_P256_CONVERSION_FAILURE = (0x80040E87, "An error occurred while converting between P256 types.")
DRM_E_P256_PKCRYPTO_FAILURE = (0x80040E88, "An error occurred in an asymmetric P256 cryptographic operation.")
DRM_E_P256_PLAINTEXT_MAPPING_FAILURE = (0x80040E89, "An error occurred while attempting to map a plaintext array to a EC Point: There is no conversion for this byte array to a EC Point.")
DRM_E_P256_INVALID_SIGNATURE = (0x80040E8A, "The ECDSA signature to be verified was not a valid signature format.")
DRM_E_P256_ECDSA_VERIFICATION_ERROR = (0x80040E8B, "The ECDSA verification algorithm encountered an unknown error.")
DRM_E_P256_ECDSA_SIGNING_ERROR = (0x80040E8C, "The ECDSA signature algorithm encountered an unknown error.")
DRM_E_P256_HMAC_KEYGEN_FAILURE = (0x80040E8D, "Could not generate a valid HMAC key under constraint where CK || HMACK is a valid x coord on the EC (P256).")
DRM_E_CH_VERSION_MISSING = (0x80041103, "Missing content header version.")
DRM_E_CH_KID_MISSING = (0x80041104, "Missing KID attribute in content header.")
DRM_E_CH_LAINFO_MISSING = (0x80041105, "Missing LAINFO attribute in content header.")
DRM_E_CH_CHECKSUM_MISSING = (0x80041106, "Missing content header checksum.")
DRM_E_CH_ATTR_MISSING = (0x80041107, "Missing content header attribute.")
DRM_E_CH_INVALID_HEADER = (0x80041108, "Invalid content header.")
DRM_E_CH_INVALID_CHECKSUM = (0x80041109, "Invalid checksum in the header.")
DRM_E_CH_UNABLE_TO_VERIFY = (0x8004110A, "Unable to verify signature of content header.")
DRM_E_CH_UNSUPPORTED_VERSION = (0x8004110B, "Unsupported content header version.")
DRM_E_CH_UNSUPPORTED_HASH_ALGORITHM = (0x8004110C, "Unsupported hash algorithm.")
DRM_E_CH_UNSUPPORTED_SIGN_ALGORITHM = (0x8004110D, "Unsupported signature algorithm.")
DRM_E_CH_BAD_KEY = (0x8004110E, "Invalid key.")
DRM_E_CH_INCOMPATIBLE_HEADER_TYPE = (0x8004110F, "Incompatible content header type.")
DRM_E_HEADER_ALREADY_SET = (0x80041110, "Content header type is already set. Reinitialize is required.")
DRM_E_CH_MULTIPLE_KIDS = (0x80041111, "Content header includes multiple KIDs. The operation requested is unsupported.")
DRM_E_CH_NOT_SIGNED = (0x80041113, "The header was not signed.")
DRM_E_CH_UNKNOWN_ERROR = (0x80041116, "Unknown Error.")
DRM_E_CDMIGRATIONTOOL_INVALID_FILE = (0x80041180, "File cannot be migrated because it is invalid.")
DRM_E_CDMIGRATIONTOOL_FILE_IS_NOT_CD_RIPPED = (0x80041181, "File cannot be migrated because it was not ripped from CD.")
DRM_E_CDMIGRATIONTOOL_FILE_IS_NOT_PROTECTED = (0x80041182, "File cannot be migrated because it is not protected.")
DRM_E_CDMIGRATIONTOOL_LICENSE_KID_INVALID = (0x80041183, "File cannot be migrated because the server returned a license with an invalid KID.")
DRM_E_CDMIGRATIONTOOL_LICENSE_KID_MISMATCH = (0x80041184, "File cannot be migrated because the server returned a license with a KID that did not match the content.")
DRM_E_CDMIGRATIONTOOL_LICENSE_CONTENT_KEY_INVALID = (0x80041185, "File cannot be migrated because the server returned a license with an invalid content key.")
DRM_E_CDMIGRATIONTOOL_INVALID_ASF_FORMAT = (0x80041186, "File cannot be migrated because the ASF is corrupt.")
DRM_E_CDMIGRATIONTOOL_INVALID_ASF_PACKETS = (0x80041187, "File cannot be migrated because the ASF packets are corrupt.")
DRM_E_CDMIGRATIONTOOL_CONTENT_KEY_CACHE_CORRUPT = (0x80041188, "File cannot be migrated because the content key obtained from the local cache is invalid.")
DRM_E_CDMIGRATIONTOOL_FILE_WRITE_ERROR = (0x80041189, "File cannot be migrated because the file could not be written.")
DRM_E_CDMIGRATIONTOOL_CANCELLED = (0x8004118A, "File migration was cancelled.")
LIC_INIT_FAILURE = (0x80041201, "LIC_INIT_FAILURE")
LIC_LICENSE_NOTSET = (0x80041202, "LIC_LICENSE_NOTSET")
LIC_PARAM_NOT_OPTIONAL = (0x80041203, "LIC_PARAM_NOT_OPTIONAL")
LIC_MEMORY_ALLOCATION_ERROR = (0x80041204, "LIC_MEMORY_ALLOCATION_ERROR")
LIC_INVALID_LICENSE = (0x80041205, "LIC_INVALID_LICENSE")
LIC_FIELD_MISSING = (0x80041206, "LIC_FIELD_MISSING")
DRM_E_LIC_UNSUPPORTED_VALUE = (0x80041207, " DRM_E_LIC_UNSUPPORTED_VALUE")
LIC_UNKNOWN_ERROR = (0x80041208, "LIC_UNKNOWN_ERROR")
LIC_INVALID_REVLIST = (0x80041209, "LIC_INVALID_REVLIST")
LIC_EXPIRED_CERT = (0x8004120A, "LIC_EXPIRED_CERT")
DRM_E_CDMI_INVALID_INITIALIZATION_DATA = (0x80041301, "Invalid initialization data.")
DRM_E_CDMI_PERSISTENT_LICENSE_FOR_NON_PERSISTENT_LICENSE_SESSION = (0x80041302, "A persistent license was provided for a session that was not persistent-license.")
DRM_E_CDMI_SECURE_STOP_LICENSE_FOR_NON_PERSISTENT_USAGE_RECORD_SESSION = (0x80041303, "A secure stop license was provided for a session that was not persistent-usage-record.")
DRM_E_CDMI_TEMPORARY_LICENSE_FOR_NON_TEMPORARY_SESSION = (0x80041304, "An in-memory-only license without secure-stop was provided for a session that was not temporary.")
DRM_E_CDMI_UNSUPPORTED_KEY_SYSTEM = (0x80041305, "The requested key system is not supported by PlayReady.")
DRM_E_CDMI_UNSUPPORTED_INITIALIZATION_DATA_TYPES = (0x80041306, "None of the requested initialization data types are supported by PlayReady.")
DRM_E_CDMI_UNSUPPORTED_DISTINCTIVE_IDENTIFIER = (0x80041307, "The requested distinctive identifier setting is not supported by PlayReady.")
DRM_E_CDMI_UNSUPPORTED_SESSION_TYPE = (0x80041308, "The requested session type is not supported by PlayReady.")
DRM_E_CDMI_UNSUPPORTED_INITIALIZATION_DATA = (0x80041309, "The provided initialization data is not supported by PlayReady.")
DRM_E_CDMI_SESSION_ALREADY_USED = (0x8004130A, "The session has already been used.")
DRM_E_CDMI_SESSION_UNINITIALIZED = (0x8004130B, "The session is not yet initialized.")
DRM_E_CDMI_SESSION_CLOSED = (0x8004130C, "The session is closed.")
DRM_E_CDMI_SESSION_ID_NOT_FOUND = (0x8004130D, "The given session ID could not be found.")
DRM_E_CDMI_SESSION_TYPE_MISMATCH = (0x8004130E, "The given session was initialized with a different session type than the session being loaded or Load/Remove was called on a temporary session.")
DRM_E_CDMI_SECURE_STOP_LICENSE_FOR_NON_PERSISTENT_USAGE_RECORD_SESSION_2 = (0x8004130F, "A secure stop license was provided for a session that was not persistent-usage-record.")
DRM_E_CPRMEXP_NOERROR = (0x80041400, "DRM_E_CPRMEXP_NOERROR") # actually the code for DRM_E_CPRMEXP_BASECODE
CPRMEXP_PARAM_NOT_OPTIONAL = (0x80041401, "CPRMEXP_PARAM_NOT_OPTIONAL")
CPRMEXP_MEMORY_ALLOCATION_ERROR = (0x80041402, "CPRMEXP_MEMORY_ALLOCATION_ERROR")
CPRMEXP_NO_OPERANDS_IN_EXPRESSION = (0x80041403, "CPRMEXP_NO_OPERANDS_IN_EXPRESSION")
CPRMEXP_INVALID_TOKEN = (0x80041404, "CPRMEXP_INVALID_TOKEN")
CPRMEXP_INVALID_CONSTANT = (0x80041405, "CPRMEXP_INVALID_CONSTANT")
CPRMEXP_INVALID_VARIABLE = (0x80041406, "CPRMEXP_INVALID_VARIABLE")
CPRMEXP_INVALID_FUNCTION = (0x80041407, "CPRMEXP_INVALID_FUNCTION")
CPRMEXP_INVALID_ARGUMENT = (0x80041408, "CPRMEXP_INVALID_ARGUMENT")
CPRMEXP_INVALID_CONTEXT = (0x80041409, "CPRMEXP_INVALID_CONTEXT")
CPRMEXP_ENDOFBUFFER = (0x8004140A, "CPRMEXP_ENDOFBUFFER")
CPRMEXP_MISSING_OPERAND = (0x8004140B, "CPRMEXP_MISSING_OPERAND")
CPRMEXP_OVERFLOW = (0x8004140C, "CPRMEXP_OVERFLOW")
CPRMEXP_UNDERFLOW = (0x8004140D, "CPRMEXP_UNDERFLOW")
CPRMEXP_INCORRECT_NUM_ARGS = (0x8004140E, "CPRMEXP_INCORRECT_NUM_ARGS")
CPRMEXP_VARIABLE_EXPECTED = (0x8004140F, "CPRMEXP_VARIABLE_EXPECTED")
CPRMEXP_RETRIEVAL_FAILURE = (0x80041410, "CPRMEXP_RETRIEVAL_FAILURE")
CPRMEXP_UPDATE_FAILURE = (0x80041411, "CPRMEXP_UPDATE_FAILURE")
CPRMEXP_STRING_UNTERMINATED = (0x80041412, "CPRMEXP_STRING_UNTERMINATED")
CPRMEXP_UPDATE_UNSUPPORTED = (0x80041413, "CPRMEXP_UPDATE_UNSUPPORTED")
CPRMEXP_ISOLATED_OPERAND_OR_OPERATOR = (0x80041414, "CPRMEXP_ISOLATED_OPERAND_OR_OPERATOR")
CPRMEXP_UNMATCHED = (0x80041415, "CPRMEXP_UNMATCHED")
CPRMEXP_WRONG_TYPE_OPERAND = (0x80041416, "CPRMEXP_WRONG_TYPE_OPERAND")
CPRMEXP_TOO_MANY_OPERANDS = (0x80041417, "CPRMEXP_TOO_MANY_OPERANDS")
CPRMEXP_UNKNOWN_PARSE_ERROR = (0x80041418, "CPRMEXP_UNKNOWN_PARSE_ERROR")
CPRMEXP_UNSUPPORTED_FUNCTION = (0x80041419, "CPRMEXP_UNSUPPORTED_FUNCTION")
CPRMEXP_CLOCK_REQUIRED = (0x8004141A, "CPRMEXP_CLOCK_REQUIRED")
DRM_E_LIC_KEY_DECODE_FAILURE = (0x80048007, "Key decode failure.")
DRM_E_LIC_SIGNATURE_FAILURE = (0x80048008, "License signature failure.")
DRM_E_LIC_KEY_AND_CERT_MISMATCH = (0x80048013, "Key and cert mismatch.")
DRM_E_KEY_MISMATCH = (0x80048014, "A public/private keypair is mismatched.")
DRM_E_INVALID_SIGNATURE = (0x800480CF, "License signature failure.")
DRM_E_SYNC_ENTRYNOTFOUND = (0x800480D0, "An entry was not found in the sync store.")
DRM_E_STACKTOOSMALL = (0x800480D1, "The stack supplied to the DRM API was too small.")
DRM_E_CIPHER_NOT_INITIALIZED = (0x800480D2, "The DRM Cipher routines were not correctly initialized before calling encryption/decryption routines.")
DRM_E_DECRYPT_NOT_INITIALIZED = (0x800480D3, "The DRM decrypt routines were not correctly initialized before trying to decrypt data.")
DRM_E_SECURESTORE_LOCK_NOT_OBTAINED = (0x800480D4, "Before reading or writing data to securestore in raw mode, first the lock must be obtained using DRM_SST_OpenData.")
DRM_E_PKCRYPTO_FAILURE = (0x800480D5, "An error occurred in an asymmetric cryptographic operation.")
DRM_E_INVALID_DST_SLOT_SIZE = (0x800480D6, "Invalid DST slot size is specified.")
DRM_E_UNSUPPORTED_VERSION = (0x80049005, " DRM_E_UNSUPPORTED_VERSION")
DRMUTIL_EXPIRED_CERT = (0x80049006, "DRMUTIL_EXPIRED_CERT")
DRMUTIL_INVALID_CERT = (0x80049007, "DRMUTIL_INVALID_CERT")
DRM_E_DEVICE_NOT_REGISTERED = (0x8004A000, "The DEVICEID does not exist in the device store")
DRM_E_TOO_MANY_INCLUSION_GUIDS = (0x8004A001, "The license contained more than DRM_MAX_INCLUSION_GUIDS entries in its inclusion list")
DRM_E_REVOCATION_GUID_NOT_RECOGNIZED = (0x8004A002, "The revocation list type GUID was not recognized")
DRM_E_LIC_CHAIN_TOO_DEEP = (0x8004A003, "The license chained deeper than this implementation can handle")
DRM_E_DEVICE_SECURITY_LEVEL_TOO_LOW = (0x8004A004, "The security level of the remote device is too low to receive the license")
DRM_E_DST_BLOCK_CACHE_CORRUPT = (0x8004A005, "The block header cache returned invalid data")
DRM_E_CONTRACT_FAILED = (0x8004A006, "The error code returned by the API is not present in the contract")
DRM_E_DST_BLOCK_CACHE_MISS = (0x8004A007, "The block header cache didn't contain the requested block header")
DRM_E_INVALID_METERRESPONSE_SIGNATURE = (0x8004A013, "Invalid signature in meter response")
DRM_E_INVALID_LICENSE_REVOCATION_LIST_SIGNATURE = (0x8004A014, "Invalid signature in license revocation list.")
DRM_E_INVALID_METERCERT_SIGNATURE = (0x8004A015, "Invalid signature in metering certificate")
DRM_E_METERSTORE_DATA_NOT_FOUND = (0x8004A016, "Metering data slot not found due to bad data in response file")
DRM_E_NO_LICENSES_TO_SYNC = (0x8004A017, "No more licenses to sync")
DRM_E_INVALID_REVOCATION_LIST = (0x8004A018, "The revocation list version does not match the current revocation version")
DRM_E_ENVELOPE_CORRUPT = (0x8004A019, "The envelope archive or file is corrupt")
DRM_E_ENVELOPE_FILE_NOT_COMPATIBLE = (0x8004A01A, "The envelope file is not compatible with this version of the porting kit")
DRM_E_EXTENDED_RESTRICTION_NOT_UNDERSTOOD = (0x8004A01B, "An extensible restriction was not understood by the app, and is mark as being required")
DRM_E_INVALID_SLK = (0x8004A01C, "An ILA SLK (symmetric session key) was found, but did not contain valid data")
DRM_E_DEVCERT_MODEL_MISMATCH = (0x8004A01D, "The model string in the certificate does not match the model of the device and so the cert must be re-generated.")
DRM_E_OUTDATED_REVOCATION_LIST = (0x8004A01E, "The revocation list is outdated. It is required for the revocation list to be refreshed at least every 90 days.")
DRM_E_DSTR_NOT_FOUND = (0x8004A01F, "The substring search inside a DRM string failed.")
DRM_E_DEVICE_NOT_INITIALIZED = (0x8004C001, "This device has not been initialized against a DRM init service")
DRM_E_DRM_NOT_INITIALIZED = (0x8004C002, "The app has not call DRM_Init properly")
DRM_E_INVALIDRIGHT = (0x8004C003, "A right in the license in invalid")
DRM_E_INCOMPATABLELICENSESIZE = (0x8004C004, "The size of the license is incompatable. DRM doesn't understand this license")
DRM_E_INVALIDLICENSEFLAGS = (0x8004C005, "The flags in the license are invalid. DRM either doesn't understand them or they are conflicting")
DRM_E_INVALID_LICENSE = (0x8004C006, "The license is invalid")
DRM_E_CONDITIONFAIL = (0x8004C007, "A condition in the license failed to pass")
DRM_E_CONDITIONNOTSUPPORTED = (0x8004C008, "A condition in the license is not supported by this verison of DRM")
DRM_E_LICENSE_EXPIRED = (0x8004C009, "The license has expired either by depleting a play count or via an end time.")
DRM_E_LICENSENOTYETVALID = (0x8004C00A, "The license start time had not come to pass yet.")
DRM_E_RIGHTS_NOT_AVAILABLE = (0x8004C00B, "The rights the app has requested are not available in the license")
DRM_E_LICENSEMISMATCH = (0x8004C00C, "The license content id/ sku id doesn't match that requested by the app")
DRM_E_WRONG_PARAMETER_TYPE = (0x8004C00D, "The token parameter was of an incompatible type.") # renamed from DRM_E_WRONG_TOKEN_TYPE so it doesn't conflict with a duplicate that has a different code
DRM_E_NORIGHTSREQUESTED = (0x8004C00E, "The app has not requested any rights before trying to bind")
DRM_E_LICENSE_NOT_BOUND = (0x8004C00F, "A license has not been bound to. Decrypt can not happen without a successful bind call")
DRM_E_HASH_MISMATCH = (0x8004C010, "A Keyed Hash check failed.")
DRM_E_INVALIDTIME = (0x8004C011, "A time structure is invalid.")
DRM_E_LICENSESTORENOTFOUND = (0x8004C012, "The external license store was not found.")
DRM_E_LICENSE_NOT_FOUND = (0x8004C013, "A license was not found in the license store.")
DRM_E_LICENSE_VERSION_NOT_SUPPORTED = (0x8004C014, "The DRM license version is not supported by the DRM version on the device.")
DRM_E_INVALIDBINDID = (0x8004C015, "The bind id is invalid.")
DRM_E_UNSUPPORTED_ALGORITHM = (0x8004C016, "The encryption algorithm required for this operation is not supported.")
DRM_E_ALGORITHMNOTSET = (0x8004C017, "The encryption algorithm required for this operation is not supported.")
DRM_E_LICENSESERVERNEEDSKEY = (0x8004C018, "The license server needs a version of the device bind key from the init service.")
DRM_E_INVALID_LICENSE_STORE = (0x8004C019, "The license store version number is incorrect, or the store is invalid in some other way.")
DRM_E_FILE_READ_ERROR = (0x8004C01A, "There was an error reading a file.")
DRM_E_FILE_WRITE_ERROR = (0x8004C01B, "There was an error writing a file.")
DRM_E_CLIENTTIMEINVALID = (0x8004C01C, "The time/clock on the device is not in sync with the license server within tolerance.")
DRM_E_DST_STORE_FULL = (0x8004C01D, "The data store is full.")
DRM_E_NO_XML_OPEN_TAG = (0x8004C01E, "XML open tag not found")
DRM_E_NO_XML_CLOSE_TAG = (0x8004C01F, "XML close tag not found")
DRM_E_INVALID_XML_TAG = (0x8004C020, "Invalid XML tag")
DRM_E_NO_XML_CDATA = (0x8004C021, "No XML CDATA found")
DRM_E_DSTNAMESPACEFULL = (0x8004C022, "No more room for DST Namespace")
DRM_E_DST_NAMESPACE_NOT_FOUND = (0x8004C023, "No DST Namespace found")
DRM_E_DST_SLOT_NOT_FOUND = (0x8004C024, "DST Dataslot not found")
DRM_E_DST_SLOT_EXISTS = (0x8004C025, "DST Dataslot already exists")
DRM_E_DST_CORRUPTED = (0x8004C026, "The data store is corrupted")
DRM_E_DST_SEEK_ERROR = (0x8004C027, "There was an error attempting to seek in the Data Store")
DRM_E_DSTNAMESPACEINUSE = (0x8004C028, "No DST Namespace in use")
DRM_E_INVALID_SECURESTORE_PASSWORD = (0x8004C029, "The password used to open the secure store key was not able to validate the secure store hash.")
DRM_E_SECURESTORE_CORRUPT = (0x8004C02A, "The secure store is corrupt")
DRM_E_SECURESTORE_FULL = (0x8004C02B, "The current secure store key is full. No more data can be added.")
DRM_E_NOACTIONINLICENSEREQUEST = (0x8004C02C, "No action(s) added for license request")
DRM_E_DUPLICATED_HEADER_ATTRIBUTE = (0x8004C02D, "Duplicated attribute in Header")
DRM_E_NO_KID_IN_HEADER = (0x8004C02E, "No KID attribute in Header")
DRM_E_NO_LAINFO_IN_HEADER = (0x8004C02F, "No LAINFO attribute in Header")
DRM_E_NO_CHECKSUM_IN_HEADER = (0x8004C030, "No Checksum attribute in Header")
DRM_E_DST_BLOCK_MISMATCH = (0x8004C031, "DST block mismatch")
DRM_E_BACKUP_EXISTS = (0x8004C032, "Backup file already exist.")
DRM_E_LICENSE_TOOLONG = (0x8004C033, "License size is too long")
DRM_E_DST_EXISTS = (0x8004C034, "A DST already exists in the specified location")
DRM_E_INVALID_DEVICE_CERTIFICATE = (0x8004C035, "The device certificate is invalid.")
DRM_E_DST_LOCK_FAILED = (0x8004C036, "Locking a segment of the DST failed.")
DRM_E_FILE_SEEK_ERROR = (0x8004C037, "File Seek Error")
DRM_E_DST_NOT_LOCKED_EXCLUSIVE = (0x8004C038, "Existing lock is not exclusive")
DRM_E_DST_EXCLUSIVE_LOCK_ONLY = (0x8004C039, "Only exclusive lock is accepted")
DRM_E_DSTRESERVEDKEYDETECTED = (0x8004C03A, "DST reserved key value detected in UniqueKey")
DRM_E_V1_NOT_SUPPORTED = (0x8004C03B, "V1 Lic Acquisition is not supported")
DRM_E_HEADER_NOT_SET = (0x8004C03C, "Content header is not set")
DRM_E_NEEDDEVCERTINDIV = (0x8004C03D, "The device certificate is template. It need Devcert Indiv")
DRM_E_MACHINE_ID_MISMATCH = (0x8004C03E, "The device has Machine Id different from that in devcert.")
DRM_E_CLK_INVALID_RESPONSE = (0x8004C03F, "The secure clock response is invalid.")
DRM_E_CLK_INVALID_DATE = (0x8004C040, "The secure clock response is invalid.")
DRM_E_CLK_UNSUPPORTED_VALUE = (0x8004C041, "The secure clock response has unsupported value.")
DRM_E_INVALIDDEVICECERTIFICATETEMPLATE = (0x8004C042, "The device certificate is invalid.")
DRM_E_DEVCERT_EXCEEDS_SIZE_LIMIT = (0x8004C043, "The device certificate exceeds max size")
DRM_E_DEVCERTTEMPLATEEXCEEDSSIZELIMIT = (0x8004C044, "The device certificate template exceeds max size")
DRM_E_DEVCERTREADERROR = (0x8004C045, "Can't get the device certificate")
DRM_E_DEVCERTWRITEERROR = (0x8004C046, "Can't store the device certificate")
DRM_E_PRIVKEY_READ_ERROR = (0x8004C047, "Can't get device private key")
DRM_E_PRIVKEYWRITEERROR = (0x8004C048, "Can't store device private key")
DRM_E_DEVCERT_TEMPLATE_READ_ERROR = (0x8004C049, "Can't get the device certificate template")
DRM_E_CLK_NOT_SUPPORTED = (0x8004C04A, "The secure clock is not supported.")
DRM_E_DEVCERTINDIV_NOT_SUPPORTED = (0x8004C04B, "The Devcert Indiv is not supported.")
DRM_E_METERING_NOT_SUPPORTED = (0x8004C04C, "The Metering is not supported.")
DRM_E_CLK_RESETSTATEREADERROR = (0x8004C04D, "Can not read Secure clock Reset State.")
DRM_E_CLK_RESETSTATEWRITEERROR = (0x8004C04E, "Can not write Secure clock Reset State.")
DRM_E_XMLNOTFOUND = (0x8004C04F, "a required XML tag was not found")
DRM_E_METERING_WRONG_TID = (0x8004C050, "wrong TID sent on metering response")
DRM_E_METERING_INVALID_COMMAND = (0x8004C051, "wrong command sent on metering response")
DRM_E_METERING_STORE_CORRUPT = (0x8004C052, "The metering store is corrupt")
DRM_E_CERTIFICATE_REVOKED = (0x8004C053, "A certificate given to DRM was revoked.")
DRM_E_CRYPTO_FAILED = (0x8004C054, "A cryptographic operation failed.")
DRM_E_STACK_CORRUPT = (0x8004C055, "The stack allocator context is corrupt. Likely a buffer overrun problem.")
DRM_E_UNKNOWN_BINDING_KEY = (0x8004C056, "A matching binding key could not be found for the license.")
DRM_E_V1_LICENSE_CHAIN_NOT_SUPPORTED = (0x8004C057, "License chaining with V1 content is not supported.")
DRM_E_WRONG_TOKEN_TYPE = (0x8004C058, "The wrong type of token was used.")
DRM_E_POLICY_METERING_DISABLED = (0x8004C059, "Metering code was called but metering is disabled by group or user policy")
DRM_E_POLICY_ONLINE_DISABLED = (0x8004C05A, "online communication is disabled by group policy")
DRM_E_CLK_NOT_SET = (0x8004C05B, "Time based licenses can not be used because the secure clock is not set on the device.")
DRM_E_NO_CLK_SUPPORTED = (0x8004C05C, "Time based licenses can not be used because the device does not support any clock.")
DRM_E_NO_URL = (0x8004C05D, "Can not find URL info.")
DRM_E_UNKNOWN_DEVICE_PROPERTY = (0x8004C05E, "Unknown device property.")
DRM_E_METERING_MID_MISMATCH = (0x8004C05F, "The metering ID is not same in Metering Cert and metering response data")
DRM_E_METERING_RESPONSE_DECRYPT_FAILED = (0x8004C060, "The encrypted section of metering response can not be decrypted")
DRM_E_RIV_TOO_SMALL = (0x8004C063, "RIV on the machine is too small.")
DRM_E_STACK_ALREADY_INITIALIZED = (0x8004C064, "DRM_STK_Init called for initialized stack")
DRM_E_DEVCERT_REVOKED = (0x8004C065, "The device certificate given to DRM is revoked.")
DRM_E_OEM_RSA_DECRYPTION_ERROR = (0x8004C066, "Error in OEM RSA Decryption.")
DRM_E_INVALID_DEVSTORE_ATTRIBUTE = (0x8004C067, "Invalid device attributes in the device store")
DRM_E_INVALID_DEVSTORE_ENTRY = (0x8004C068, "The device store data entry is corrupted")
DRM_E_OEM_RSA_ENCRYPTION_ERROR = (0x8004C069, "Error in OEM RSA Encryption process")
DRM_E_DST_NAMESPACE_EXISTS = (0x8004C06A, "The DST Namespace already exists.")
DRM_E_PERF_SCOPING_ERROR = (0x8004C06B, "Error in performance scope context")
DRM_E_PRECISION_ARITHMETIC_FAIL = (0x8004C06C, "Operation involving multiple precision arithmetic fails")
DRM_E_OEM_RSA_INVALID_PRIVATE_KEY = (0x8004C06D, "Invalid private key.")
DRM_E_NO_OPL_CALLBACK = (0x8004C06E, "There is no callback function to process the output restrictions specified in the license")
DRM_E_INVALID_PLAYREADY_OBJECT = (0x8004C06F, "Structure of PlayReady object is invalid")
DRM_E_DUPLICATE_LICENSE = (0x8004C070, "There is already a license in the store with the same KID & LID")
DRM_E_REVOCATION_NOT_SUPPORTED = (0x8004C071, "Device does not support revocation, while revocation data was placed into license policy structure.")
DRM_E_RECORD_NOT_FOUND = (0x8004C072, "Record with requested type was not found in PlayReady object.")
DRM_E_BUFFER_BOUNDS_EXCEEDED = (0x8004C073, "An array is being referenced outside of it's bounds.")
DRM_E_INVALID_BASE64 = (0x8004C074, "An input string contains invalid Base64 characters.")
DRM_E_PROTOCOL_VERSION_NOT_SUPPORTED = (0x8004C075, "The protocol version is not supported.")
DRM_E_INVALID_LICENSE_RESPONSE_SIGNATURE = (0x8004C076, "Cannot verify license acquisition's response because signature is invalid.")
DRM_E_INVALID_LICENSE_RESPONSE_ID = (0x8004C077, "Cannot verify license acquisition's response because response ID is invalid.")
DRM_E_LICENSE_RESPONSE_SIGNATURE_MISSING = (0x8004C078, "Cannot verify license acquisition's response because either response ID, license nonce or signature is missing.")
DRM_E_INVALID_DOMAIN_JOIN_RESPONSE_SIGNATURE = (0x8004C079, "Cannot verify domain join response because signature is invalid.")
DRM_E_DOMAIN_JOIN_RESPONSE_SIGNATURE_MISSING = (0x8004C07A, "Cannot verify domain join response because either signing certificate chain or signature is missing.")
DRM_E_ACTIVATION_REQUIRED = (0x8004C07B, "The device must be activated before initialization can succeed.")
DRM_E_ACTIVATION_INTERNAL_ERROR = (0x8004C07C, "A server error occurred during device activation.")
DRM_E_ACTIVATION_GROUP_CERT_REVOKED_ERROR = (0x8004C07D, "The activation group cert has been revoked and the application must be updated with a new client lib.")
DRM_E_ACTIVATION_NEW_CLIENT_LIB_REQUIRED_ERROR = (0x8004C07E, "The client lib used by the application is not supported and must be updated.")
DRM_E_ACTIVATION_BAD_REQUEST = (0x8004C07F, "The activation request is invalid")
DRM_E_FILEIO_ERROR = (0x8004C080, "Encountered a system error during file I/O.")
DRM_E_DISKSPACE_ERROR = (0x8004C081, "Out of disk space for storing playready files.")
DRM_E_UPLINK_LICENSE_NOT_FOUND = (0x8004C082, "A license was found in the license store but no license was found for its uplink ID.")
DRM_E_ACTIVATION_CLIENT_ALREADY_CURRENT = (0x8004C083, "The activation client already has the lastest verion.")
DRM_E_LICENSE_REALTIME_EXPIRED = (0x8004C084, "The license has expired during decryption due to the RealTimeExpiration Restriction.")
DRM_E_DECRYPTOR_CANNOT_CLONE = (0x8004C085, "The decryptor cannot be cloned due to restrictions in the corresponding license.")
DRM_E_ACTIVATION_REQUIRED_REACTIVATION_POSSIBLE = (0x8004C086, "The device must be activated or reactivated before initialization can succeed.")
DRM_E_LRB_NOLGPUBKEY = (0x8004C0A0, "LRB does not contain a valid LGPUBKEY.")
DRM_E_LRB_INVALIDSIGNATURE = (0x8004C0A1, "Signature inside LRB is invalid.")
DRM_E_LRB_LGPUBKEY_MISMATCH = (0x8004C0A2, "LRB is signed with a pubkey different from LGPUBKEY")
DRM_E_LRB_INVALIDLICENSEDATA = (0x8004C0A3, "LRB is signed with a pubkey different from LGPUBKEY")
DRM_E_LICEVAL_LICENSE_NOT_SUPPLIED = (0x8004C0C0, "License not supplied in the liceval context")
DRM_E_LICEVAL_KID_MISMATCH = (0x8004C0C1, "Mismatch between KID from header and the one inside license")
DRM_E_LICEVAL_LICENSE_REVOKED = (0x8004C0C2, "License for this content has been revoked")
DRM_E_LICEVAL_UPDATE_FAILURE = (0x8004C0C3, "Failed to update content revocation")
DRM_E_LICEVAL_REQUIRED_REVOCATION_LIST_NOT_AVAILABLE = (0x8004C0C4, "Failed to update content revocation")
DRM_E_LICEVAL_INVALID_PRND_LICENSE = (0x8004C0C5, "License is an invalid PRND license. PRND license cannot have metering ID, expire-after-first-play or domain properties.")
DRM_E_XMR_OBJECT_ALREADY_EXISTS = (0x8004C0E0, "XMR builder context already has this object.")
DRM_E_XMR_OBJECT_NOTFOUND = (0x8004C0E1, "XMR object was not found.")
DRM_E_XMR_REQUIRED_OBJECT_MISSING = (0x8004C0E2, "XMR license doesn't have one or more required objects.")
DRM_E_XMR_INVALID_UNKNOWN_OBJECT = (0x8004C0E3, "Invalid unknown object")
DRM_E_XMR_LICENSE_BINDABLE = (0x8004C0E4, "XMR license does not contain the Cannot Bind right")
DRM_E_XMR_LICENSE_NOT_BINDABLE = (0x8004C0E5, "XMR license cannot be bound to because of the Cannot Bind right")
DRM_E_XMR_UNSUPPORTED_XMR_VERSION = (0x8004C0E6, "The version of XMR license is not supported for the current action")
DRM_E_NOT_CRL_BLOB = (0x8004C100, "CRL blob provided for parsing does not start with CBLB. It means file is not CRL blob at all.")
DRM_E_BAD_CRL_BLOB = (0x8004C101, "The file is structured as CRL blob, but there is some error in file structure or one of CRLs inside is invalid.")
DRM_E_INVALID_DEVCERT_ATTRIBUTE = (0x8004C200, "The attributes in the Device certificate are invalid")
DRM_E_TEST_PKCRYPTO_FAILURE = (0x8004C300, "Error in PK encryption/decryption crypto test cases.")
DRM_E_TEST_PKSIGN_VERIFY_ERROR = (0x8004C301, "Digital signature verification failed.")
DRM_E_TEST_ENCRYPT_ERROR = (0x8004C302, "Error in encryption of cipher text.")
DRM_E_TEST_RC4KEY_FAILED = (0x8004C303, "RC4 key failed during crypto operations.")
DRM_E_TEST_DECRYPT_ERROR = (0x8004C304, "Error in cipher text decryption.")
DRM_E_TEST_DESKEY_FAILED = (0x8004C305, "Decrypted data not equal to original data in a DES operation.")
DRM_E_TEST_CBC_INVERSEMAC_FAILURE = (0x8004C306, "Decrypted data not equal to original in Inverse MAC operation.")
DRM_E_TEST_HMAC_FAILURE = (0x8004C307, "Error in hashed data in HMAC operation.")
DRM_E_TEST_INVALIDARG = (0x8004C308, "Error in the number of arguments or argument data in Test files.")
DRM_E_TEST_DEVICE_PRIVATE_KEY_INCORRECTLY_STORED = (0x8004C30A, "DRMManager context should not contain the device private key.")
DRM_E_TEST_DRMMANAGER_CONTEXT_NULL = (0x8004C30B, "DRMManager context is NULL.")
DRM_E_TEST_UNEXPECTED_REVINFO_RESULT = (0x8004C30C, "Revocation cache result was not as expected.")
DRM_E_TEST_RIV_MISMATCH = (0x8004C30D, "Revocation Info Version(RIV) mismatch.")
DRM_E_TEST_URL_ERROR = (0x8004C310, "There is an error in the URL from the challenge generated.")
DRM_E_TEST_MID_MISMATCH = (0x8004C311, "The MIDs returned from the DRM_MANAGER_CONTEXT does not match the test input.")
DRM_E_TEST_METER_CERTIFICATE_MISMATCH = (0x8004C312, "The input data does not match with the Metering certificate returned from the license.")
DRM_E_TEST_LICENSE_STATE_MISMATCH = (0x8004C313, "The input data and license state returned from the license do not match.")
DRM_E_TEST_SOURCE_ID_MISMATCH = (0x8004C316, "The input data and license state returned from the license do not match.")
DRM_E_TEST_UNEXPECTED_LICENSE_COUNT = (0x8004C317, "The input data and the number of license from the KID do not match.")
DRM_E_TEST_UNEXPECTED_DEVICE_PROPERTY = (0x8004C318, "Unknown device property.")
DRM_E_TEST_DRMMANAGER_MISALIGNED_BYTES = (0x8004C319, "Error due to misalignment of bytes.")
DRM_E_TEST_LICENSE_RESPONSE_ERROR = (0x8004C31A, "The license response callbacks did not provide the expected data.")
DRM_E_TEST_OPL_MISMATCH = (0x8004C31B, "The minimum levels of the compressed/uncompressed Digital and Analog Video do not match the OPL.")
DRM_E_TEST_INVALID_OPL_CALLBACK = (0x8004C31C, "The callback type supplied is not valid.")
DRM_E_TEST_INCOMPLETE = (0x8004C31D, "The test function failed to complete.")
DRM_E_TEST_UNEXPECTED_OUTPUT = (0x8004C31E, "The output of the function being tested does not match the expected output.")
DRM_E_TEST_DLA_NO_CONTENT_HEADER = (0x8004C31F, "Content Header Information was not retrieved correctly in DLA Sync Tests.")
DRM_E_TEST_DLA_CONTENT_HEADER_FOUND = (0x8004C320, "Content Header Information was found when it should not have been in DLA Sync Tests.")
DRM_E_TEST_SYNC_LSD_INCORRECT = (0x8004C321, "DRM_SNC_GetSyncStoreEntry returned incorrect License State Data.")
DRM_E_TEST_TOO_SLOW = (0x8004C322, "The performance test failed because DRM took longer than its maximum time.")
DRM_E_TEST_LICENSESTORE_NOT_OPEN = (0x8004C323, "The License Store contexts in the App Manager context are not open.")
DRM_E_TEST_DEVICE_NOT_INITED = (0x8004C324, "The device instance has not been initialized prior to use.")
DRM_E_TEST_VARIABLE_NOT_SET = (0x8004C325, "A global variable needed for test execution has not been set correctly.")
DRM_E_TEST_NOMORE = (0x8004C326, "The same as DRM_E_NOMORE, only explicitly used in test code.")
DRM_E_TEST_FILE_LOAD_ERROR = (0x8004C327, "There was an error loading a test data file.")
DRM_E_TEST_LICENSE_ACQ_FAILED = (0x8004C328, "The attempt to acquire a license failed.")
DRM_E_TEST_UNSUPPORTED_FILE_FORMAT = (0x8004C329, "A file format is being used which is not supported by the test function.")
DRM_E_TEST_PARSING_ERROR = (0x8004C32A, "There was an error parsing input parameter.")
DRM_E_TEST_NOTIMPL = (0x8004C32B, "The specified test API is not implemented.")
DRM_E_TEST_VARIABLE_NOTFOUND = (0x8004C32C, "The specified test varaible was not found in the shared variable table.")
DRM_E_TEST_VARIABLE_LISTFULL = (0x8004C32D, "The shared test variable table is full.")
DRM_E_TEST_UNEXPECTED_CONTENT_PROPERTY = (0x8004C32E, "Unknown content property.")
DRM_E_TEST_PRO_HEADER_NOT_SET = (0x8004C32F, "PlayReady Object Header not set.")
DRM_E_TEST_NON_PRO_HEADER_TYPE = (0x8004C330, "Incompatible header - PlayReady Object Header expected.")
DRM_E_TEST_INVALID_DEVICE_WRAPPER = (0x8004C331, "The Device Simulator Device Wrapper is not valid.")
DRM_E_TEST_INVALID_WMDM_WRAPPER = (0x8004C332, "The Device Simulator WMDM Wrapper is not valid.")
DRM_E_TEST_INVALID_WPD_WRAPPER = (0x8004C333, "The Device Simulator WPD Wrapper is not valid.")
DRM_E_TEST_INVALID_FILE = (0x8004C334, "The data file given was invalid.")
DRM_E_TEST_PROPERTY_NOT_FOUND = (0x8004C335, "The object did not have the property which was queried.")
DRM_E_TEST_METERING_DATA_INCORRECT = (0x8004C336, "The metering data reported is incorrect.")
DRM_E_TEST_FILE_ALREADY_OPEN = (0x8004C337, "The handle variable for a test file is not NULL. This indicates that a file was opened and not closed properly.")
DRM_E_TEST_FILE_NOT_OPEN = (0x8004C338, "The handle variable for a test file is NULL. This indicates that a file was not opened.")
DRM_E_TEST_PICT_COLUMN_TOO_WIDE = (0x8004C339, "The PICT input file contains a column which is too wide for the test parser to handle.")
DRM_E_TEST_PICT_COLUMN_MISMATCH = (0x8004C33A, "The PICT input file contains a row which doesn't have the same number of columns as the header row.")
DRM_E_TEST_TUX_TEST_SKIPPED = (0x8004C33B, "TUX cannot find the speficied test case in target dll. Test Skipped.")
DRM_E_TEST_KEYFILE_VERIFICATION_FAILURE = (0x8004C33C, "Verification of the Keyfile context failed.")
DRM_E_TEST_DATA_VERIFICATION_FAILURE = (0x8004C33D, "Data does not match expected value and failed verification.")
DRM_E_TEST_NET_FAIL = (0x8004C33E, "The Test failed to perform Network I/O.")
DRM_E_TEST_CLEANUP_FAIL = (0x8004C33F, "A failure occurred during the test case cleanup phase.")
DRM_E_TEST_LICGEN_UNSUPPORTED_VALUE = (0x8004C340, "A property used during license generation is not supported.")
DRM_E_LOGICERR = (0x8004C3E8, "DRM code has a logic error in it. This result should never be returned. There is an unhandled code path if it is returned.")
DRM_E_INVALID_REV_INFO = (0x8004C3E9, "The rev info blob is invalid.")
DRM_E_SYNCLISTNOTSUPPORTED = (0x8004C3EA, "The device does not support synclist.")
DRM_E_REVOCATION_BUFFER_TOO_SMALL = (0x8004C3EB, "The revocation buffer is too small.")
DRM_E_DEVICE_ALREADY_REGISTERED = (0x8004C3EC, "There exists already a device in the device store with the same DEVICEID that was given.")
DRM_E_DST_NOT_COMPATIBLE = (0x8004C3ED, "The data store version is incompatible with this version of DRM.")
DRM_E_RSA_DECRYPTION_ERROR = (0x8004C3F0, "The data block/Encoded message used in OAEP decoding is incorrect.")
DRM_E_OEM_RSA_MESSAGE_TOO_BIG = (0x8004C3F1, "The base message buffer is larger than the given modulus.")
DRM_E_METERCERT_NOT_FOUND = (0x8004C3F2, "The metering certificate was not found in the store.")
DRM_E_MODULAR_ARITHMETIC_FAILURE = (0x8004C3F3, "A failure occurred in bignum modular arithmetic.")
DRM_E_FEATURE_NOT_SUPPORTED = (0x8004C3F4, "The feature is not supported in this release.")
DRM_E_REVOCATION_INVALID_PACKAGE = (0x8004C3F5, "The revocation package is invalid")
DRM_E_HWID_ERROR = (0x8004C3F6, "Failed to get the hardware ID.")
DRM_E_VAR_NOT_INITIALIZED = (0x8004C3F7, "Variable was not initialized.")
DRM_E_DOMAIN_INVALID_GUID = (0x8004C500, "Not a correct GUID.")
DRM_E_DOMAIN_INVALID_CUSTOM_DATA_TYPE = (0x8004C501, "Not a valid custom data type.")
DRM_E_DOMAIN_STORE_ADD_DATA = (0x8004C502, "Failed to add data into the domain store.")
DRM_E_DOMAIN_STORE_GET_DATA = (0x8004C503, "Failed to retrieve data from the domain store.")
DRM_E_DOMAIN_STORE_DELETE_DATA = (0x8004C504, "Failed to delete data from the domain store.")
DRM_E_DOMAIN_STORE_OPEN_STORE = (0x8004C505, "Failed to open the domain store.")
DRM_E_DOMAIN_STORE_CLOSE_STORE = (0x8004C506, "Failed to close the domain store.")
DRM_E_DOMAIN_BIND_LICENSE = (0x8004C507, "Failed to bind to the domain license.")
DRM_E_DOMAIN_INVALID_CUSTOM_DATA = (0x8004C508, "Not a valid custom data.")
DRM_E_DOMAIN_NOT_FOUND = (0x8004C509, "No domain information is found.")
DRM_E_DOMAIN_INVALID_DOMKEYXMR_DATA = (0x8004C50A, "The domain join response contains invalid domain privkey XMR data.")
DRM_E_DOMAIN_STORE_INVALID_KEY_RECORD = (0x8004C50B, "Invalid format of domain private key record read from the domain store.")
DRM_E_DOMAIN_JOIN_TOO_MANY_KEYS = (0x8004C50C, "The server returned too many domain keys for the client to handle.")
DRM_E_DEVICE_DOMAIN_JOIN_REQUIRED = (0x8004C580, "This error code communicates to the application that the device is not a member of a domain. The app can uses this error code in turn to decide whether it needs to join the domain or not")
DRM_E_SERVER_INTERNAL_ERROR = (0x8004C600, "An internal server error occurred.")
DRM_E_SERVER_INVALID_MESSAGE = (0x8004C601, "The message sent to the server was invalid.")
DRM_E_SERVER_DEVICE_LIMIT_REACHED = (0x8004C602, "The device limit for the domain has been reached.")
DRM_E_SERVER_INDIV_REQUIRED = (0x8004C603, "Individualization of the client is required.")
DRM_E_SERVER_SERVICE_SPECIFIC = (0x8004C604, "An error specific to the service has occurred.")
DRM_E_SERVER_DOMAIN_REQUIRED = (0x8004C605, "A Domain certificate is required.")
DRM_E_SERVER_RENEW_DOMAIN = (0x8004C606, "The Domain certificate needs to be renewed.")
DRM_E_SERVER_UNKNOWN_METERINGID = (0x8004C607, "The metering identifier is unknown.")
DRM_E_SERVER_COMPUTER_LIMIT_REACHED = (0x8004C608, "The computer limit for the domain has been reached.")
DRM_E_SERVER_PROTOCOL_FALLBACK = (0x8004C609, "The client should fallback to the V2 license acquisition protocol.")
DRM_E_SERVER_NOT_A_MEMBER = (0x8004C60A, "The client was removed from the domain in an offline fashion and thus still has a domain cert, but not a valid domain membership.")
DRM_E_SERVER_PROTOCOL_VERSION_MISMATCH = (0x8004C60B, "The protocol version specified was not supported by the server.")
DRM_E_SERVER_UNKNOWN_ACCOUNTID = (0x8004C60C, "The account identifier is unknown.")
DRM_E_SERVER_PROTOCOL_REDIRECT = (0x8004C60D, "The protocol has a redirect.")
DRM_E_SERVER_UNKNOWN_TRANSACTIONID = (0x8004C610, "The transaction identifier is unknown.")
DRM_E_SERVER_INVALID_LICENSEID = (0x8004C611, "The license identifier is invalid.")
DRM_E_SERVER_MAXIMUM_LICENSEID_EXCEEDED = (0x8004C612, "The maximum number of license identifiers in the request was exceeded.")
DRM_E_LICACQ_TOO_MANY_LICENSES = (0x8004C700, "There are too many licenses in the license response.")
DRM_E_LICACQ_ACK_TRANSACTION_ID_TOO_BIG = (0x8004C701, "The Transaction ID specified by the server exceeds the allocated buffer.")
DRM_E_LICACQ_ACK_MESSAGE_NOT_CREATED = (0x8004C702, "The license acquisition acknowledgement message could not be created.")
DRM_E_INITIATORS_UNKNOWN_TYPE = (0x8004C780, "The initiator type is unknown.")
DRM_E_INITIATORS_INVALID_SERVICEID = (0x8004C781, "The service ID data is not valid.")
DRM_E_INITIATORS_INVALID_ACCOUNTID = (0x8004C782, "The account ID data is not valid.")
DRM_E_INITIATORS_INVALID_MID = (0x8004C783, "The account ID data is not valid.")
DRM_E_INITIATORS_MISSING_DC_URL = (0x8004C784, "Domain Controller URL is missing.")
DRM_E_INITIATORS_MISSING_CONTENT_HEADER = (0x8004C785, "Content header is missing.")
DRM_E_INITIATORS_MISSING_LAURL_IN_CONTENT_HEADER = (0x8004C786, "Missing license acquisition URL in content header.")
DRM_E_INITIATORS_MISSING_METERCERT_URL = (0x8004C787, "Meter certificate server URL is missing.")
DRM_E_BCERT_INVALID_SIGNATURE_TYPE = (0x8004C800, "An invalid signature type was encountered")
DRM_E_BCERT_CHAIN_TOO_DEEP = (0x8004C801, "There are, or there would be, too many certificates in the certificate chain")
DRM_E_BCERT_INVALID_CERT_TYPE = (0x8004C802, "An invalid certificate type was encountered")
DRM_E_BCERT_INVALID_FEATURE = (0x8004C803, "An invalid feature entry was encountered OR the porting kit was linked with mutually incompatible features or features incompatible with the certificate")
DRM_E_BCERT_INVALID_KEY_USAGE = (0x8004C804, "An invalid public key usage was encountered")
DRM_E_BCERT_INVALID_SECURITY_VERSION = (0x8004C805, "An invalid Indiv Box security version was encountered")
DRM_E_BCERT_INVALID_KEY_TYPE = (0x8004C806, "An invalid public key type was encountered")
DRM_E_BCERT_INVALID_KEY_LENGTH = (0x8004C807, "An invalid public key length was encountered")
DRM_E_BCERT_INVALID_MAX_LICENSE_SIZE = (0x8004C808, "An invalid maximum license size value was encountered")
DRM_E_BCERT_INVALID_MAX_HEADER_SIZE = (0x8004C809, "An invalid maximum license header size value was encountered")
DRM_E_BCERT_INVALID_MAX_LICENSE_CHAIN_DEPTH = (0x8004C80A, "An invalid maximum license chain depth was encountered")
DRM_E_BCERT_INVALID_SECURITY_LEVEL = (0x8004C80B, "An invalid security level was encountered")
DRM_E_BCERT_PRIVATE_KEY_NOT_SPECIFIED = (0x8004C80C, "A private key for signing the certificate was not provided to the builder")
DRM_E_BCERT_ISSUER_KEY_NOT_SPECIFIED = (0x8004C80D, "An issuer key was not provided to the builder")
DRM_E_BCERT_ACCOUNT_ID_NOT_SPECIFIED = (0x8004C80E, "An account ID was not provided to the builder")
DRM_E_BCERT_SERVICE_ID_NOT_SPECIFIED = (0x8004C80F, "A service provider ID was not provided to the builder")
DRM_E_BCERT_CLIENT_ID_NOT_SPECIFIED = (0x8004C810, "A client ID was not provided to the builder")
DRM_E_BCERT_DOMAIN_URL_NOT_SPECIFIED = (0x8004C811, "A domain URL was not provided to the builder")
DRM_E_BCERT_DOMAIN_URL_TOO_LONG = (0x8004C812, "The domain URL contains too many ASCII characters")
DRM_E_BCERT_HARDWARE_ID_NOT_SPECIFIED = (0x8004C813, "A hardware ID was not provided to the builder")
DRM_E_BCERT_HARDWARE_ID_TOO_LONG = (0x8004C814, "A hardware ID is longer than the maximum supported bytes")
DRM_E_BCERT_SERIAL_NUM_NOT_SPECIFIED = (0x8004C815, "A device serial number was not provided to the builder")
DRM_E_BCERT_CERT_ID_NOT_SPECIFIED = (0x8004C816, "A certificate ID was not provided to the builder")
DRM_E_BCERT_PUBLIC_KEY_NOT_SPECIFIED = (0x8004C817, "A public key for the certificate was not provided to the builder or not found by the parser")
DRM_E_BCERT_KEY_USAGES_NOT_SPECIFIED = (0x8004C818, "The public key usage information was not provided to the builder or not found by the parser")
DRM_E_BCERT_STRING_NOT_NULL_TERMINATED = (0x8004C819, "Data string is not null-teminated")
DRM_E_BCERT_OBJECTHEADER_LEN_TOO_BIG = (0x8004C81A, "Object length in object header is too big")
DRM_E_BCERT_INVALID_ISSUERKEY_LENGTH = (0x8004C81B, "IssuerKey Length value is invalid")
DRM_E_BCERT_BASICINFO_CERT_EXPIRED = (0x8004C81C, "Certificate is expired")
DRM_E_BCERT_UNEXPECTED_OBJECT_HEADER = (0x8004C81D, "Object header has unexpected values")
DRM_E_BCERT_ISSUERKEY_KEYINFO_MISMATCH = (0x8004C81E, "The cert's Issuer Key does not match key info in the next cert")
DRM_E_BCERT_INVALID_MAX_KEY_USAGES = (0x8004C81F, "Number of key usage entries is invalid")
DRM_E_BCERT_INVALID_MAX_FEATURES = (0x8004C820, "Number of features is invalid")
DRM_E_BCERT_INVALID_CHAIN_HEADER_TAG = (0x8004C821, "Cert chain header tag is invalid")
DRM_E_BCERT_INVALID_CHAIN_VERSION = (0x8004C822, "Cert chain version is invalid")
DRM_E_BCERT_INVALID_CHAIN_LENGTH = (0x8004C823, "Cert chain length value is invalid")
DRM_E_BCERT_INVALID_CERT_HEADER_TAG = (0x8004C824, "Cert header tag is invalid")
DRM_E_BCERT_INVALID_CERT_VERSION = (0x8004C825, "Cert version is invalid")
DRM_E_BCERT_INVALID_CERT_LENGTH = (0x8004C826, "Cert length value is invalid")
DRM_E_BCERT_INVALID_SIGNEDCERT_LENGTH = (0x8004C827, "Length of signed portion of certificate is invalid")
DRM_E_BCERT_INVALID_PLATFORM_IDENTIFIER = (0x8004C828, "An invalid Platform Identifier was specified")
DRM_E_BCERT_INVALID_NUMBER_EXTDATARECORDS = (0x8004C829, "An invalid number of extended data records")
DRM_E_BCERT_INVALID_EXTDATARECORD = (0x8004C82A, "An invalid extended data record")
DRM_E_BCERT_EXTDATA_LENGTH_MUST_PRESENT = (0x8004C82B, "Extended data record length must be present.")
DRM_E_BCERT_EXTDATA_PRIVKEY_MUST_PRESENT = (0x8004C82C, "Extended data record length must be present.")
DRM_E_BCERT_INVALID_EXTDATA_LENGTH = (0x8004C82D, "Calculated and written extended data object lengths do not match.")
DRM_E_BCERT_EXTDATA_IS_NOT_PROVIDED = (0x8004C82E, "Extended data is not provided, the cert builder cannot write it.")
DRM_E_BCERT_HWIDINFO_IS_MISSING = (0x8004C82F, "The PC certificate is correct but is not ready to use because has no HWID information")
DRM_E_BCERT_INVALID_EXTDATA_SIGNED_LENGTH = (0x8004C830, "Length of signed portion of extended data info is invalid")
DRM_E_BCERT_INVALID_EXTDATA_RECORD_TYPE = (0x8004C831, "Extended data record type is invalid")
DRM_E_BCERT_EXTDATAFLAG_CERT_TYPE_MISMATCH = (0x8004C832, "Certificate of this type cannot have extended data flag set")
DRM_E_BCERT_METERING_ID_NOT_SPECIFIED = (0x8004C833, "An metering ID was not provided to the builder")
DRM_E_BCERT_METERING_URL_NOT_SPECIFIED = (0x8004C834, "A metering URL was not provided to the builder")
DRM_E_BCERT_METERING_URL_TOO_LONG = (0x8004C835, "The metering URL contains too many ASCII characters")
DRM_E_BCERT_VERIFICATION_ERRORS = (0x8004C836, "Verification errors are found while parsing cert chain")
DRM_E_BCERT_REQUIRED_KEYUSAGE_MISSING = (0x8004C837, "Required key usage is missing")
DRM_E_BCERT_NO_PUBKEY_WITH_REQUESTED_KEYUSAGE = (0x8004C838, "The certificate does not contain a public key with the requested key usage")
DRM_E_BCERT_MANUFACTURER_STRING_TOO_LONG = (0x8004C839, "The manufacturer string is too long")
DRM_E_BCERT_TOO_MANY_PUBLIC_KEYS = (0x8004C83A, "There are too many public keys in the certificate")
DRM_E_BCERT_OBJECTHEADER_LEN_TOO_SMALL = (0x8004C83B, "Object length in object header is too small")
DRM_E_BCERT_INVALID_WARNING_DAYS = (0x8004C83C, "An invalid server certificate expiration warning days. Warning days must be greater than zero.")
DRM_E_BCERT_INVALID_DIGEST = (0x8004C83D, "The certificate digest is invalid.")
DRM_E_BCERT_MANUFACTURING_INFO_REQUIRED = (0x8004C83E, "This certificate type requires Manufacturer Name, Model Name, and Model Number to be set.")
DRM_E_XMLSIG_ECDSA_VERIFY_FAILURE = (0x8004C900, "Error in ECDSA signature verification.")
DRM_E_XMLSIG_SHA_VERIFY_FAILURE = (0x8004C901, "Error in SHA verification.")
DRM_E_XMLSIG_FORMAT = (0x8004C902, "The format of XML signature or encryption segment is incorrect.")
DRM_E_XMLSIG_PUBLIC_KEY_ID = (0x8004C903, "Invalud pre-shared public key ID.")
DRM_E_XMLSIG_INVALID_KEY_FORMAT = (0x8004C904, "Invalid type of public/private key format.")
DRM_E_XMLSIG_SHA_HASH_SIZE = (0x8004C905, "Size of hash is unexpected.")
DRM_E_XMLSIG_ECDSA_SIGNATURE_SIZE = (0x8004C906, "Size of ECDSA signature is unexpected.")
DRM_E_UTF_UNEXPECTED_END = (0x8004CA00, "Unexpected end of data in the middle of multibyte character.")
DRM_E_UTF_INVALID_CODE = (0x8004CA01, "UTF character maps into a code with invalid value.")
DRM_E_SOAPXML_INVALID_STATUS_CODE = (0x8004CB00, "Status code contained in the server error response is invalid.")
DRM_E_SOAPXML_XML_FORMAT = (0x8004CB01, "Cannot parse out expected XML node.")
DRM_E_SOAPXML_WRONG_MESSAGE_TYPE = (0x8004CB02, "The message type associated with the soap message is wrong.")
DRM_E_SOAPXML_SIGNATURE_MISSING = (0x8004CB03, "The message did not have a signature and needed one")
DRM_E_SOAPXML_PROTOCOL_NOT_SUPPORTED = (0x8004CB04, "The requested protocol is not supported by the DRM SOAP parser.")
DRM_E_SOAPXML_DATA_NOT_FOUND = (0x8004CB05, "The requested data is not found in the response.")
DRM_E_CRYPTO_PUBLIC_KEY_NOT_MATCH = (0x8004CC00, "The public key associated with an encrypted domain private from the server does not match any public key on the device.")
DRM_E_UNABLE_TO_RESOLVE_LOCATION_TREE = (0x8004CC01, "Unable to derive the key. May be due to blackout or no rights to the service, etc.")
DRM_E_SECURE_TRACE_BAD_GLOBAL_DATA_POINTER = (0x8004CD00, "The secure trace global data pointer is NULL")
DRM_E_SECURE_TRACE_INVALID_GLOBAL_DATA = (0x8004CD01, "The secure trace global data structure is invalid")
DRM_E_SECURE_TRACE_FORMATTING_ERROR = (0x8004CD02, "An error occured in formatting the trace message")
DRM_E_SECURE_TRACE_BAD_SCHEME_DATA_POINTER = (0x8004CD03, "A secure trace scheme data pointer is NULL")
DRM_E_SECURE_TRACE_BAD_PER_THREAD_AES_DATA_POINTER = (0x8004CD04, "The secure trace per thread AES data pointer is NULL")
DRM_E_SECURE_TRACE_BAD_PER_THREAD_AES_BUFFER_POINTER = (0x8004CD05, "A secure trace per thread AES buffer pointer is NULL")
DRM_E_SECURE_TRACE_AES_INSUFFICIENT_BUFFER = (0x8004CD06, "There is no space left in the secure trace AES buffer")
DRM_E_SECURE_TRACE_VERSION_MISMATCH = (0x8004CD07, "All drm dlls do not agree on the same secure trace version")
DRM_E_SECURE_TRACE_UNEXPECTED_ERROR = (0x8004CD08, "An expected error was encountered in secure tracing system")
DRM_E_TEE_INVALID_KEY_DATA = (0x8004CD10, "The key data given to the TEE was invalid.")
DRM_E_TEE_PROVISIONING_REQUIRED = (0x8004CD11, "Provisioning is required.")
DRM_E_TEE_INVALID_HWDRM_STATE = (0x8004CD12, "The HWDRM state is invalid, e.g. the TEE context is invalid. Reinitialization is required.")
DRM_E_TEE_PROVISIONING_REQUEST_EXPIRED = (0x8004CD13, "Provisioning request expired.")
DRM_E_TEE_CLOCK_NOT_SET = (0x8004CD14, "The TEE secure clock needs to be reset.")
DRM_E_TEE_BLOB_ACCESS_DENIED = (0x8004CD15, "The blob data is protected and cannot be transfered outside of the TEE.")
DRM_E_TEE_PROVISIONING_BAD_NONCE = (0x8004CD16, "Malformed nonce")
DRM_E_TEE_PROVISIONING_NONCE_MISMATCH = (0x8004CD17, "Nonce mismatch. Possibly another request has happened in parallel.")
DRM_E_TEE_ROOT_KEY_CHANGED = (0x8004CD18, "The root-most TEE key has changed without maintaining key history. All TEE-bound data is now invalid.")
DRM_E_TEE_PROVISIONING_INVALID_RESPONSE = (0x8004CD19, "Invalid provisioning response.")
DRM_E_TEE_PROXY_INVALID_SERIALIZATION_MESSAGE = (0x8004CD1A, "Invalid TEE proxy serialization message.")
DRM_E_TEE_PROXY_INVALID_SERIALIZATION_TYPE = (0x8004CD1B, "Invalid TEE proxy serialization type.")
DRM_E_TEE_LAYER_UNINITIALIZED = (0x8004CD1C, "TEE Layer is not initialized.")
DRM_E_TEE_INVALID_HEADER_FOOTER_SIZE = (0x8004CD1D, "The OEM defined TEE message header/footer size was not a multiple of 8 bytes.")
DRM_E_TEE_MESSAGE_TOO_LARGE = (0x8004CD1E, "TEE method invocation message is too large.")
DRM_E_TEE_CLOCK_DRIFTED = (0x8004CD1F, "TEE clock drift detected.")
DRM_E_TEE_PROXY_INVALID_BUFFER_ALIGNMENT = (0x8004CD20, "The TEE serialization buffer is incorrectly aligned. It requires 8-byte alignment.")
DRM_E_TEE_PROXY_INVALID_ALIGNMENT = (0x8004CD21, "The TEE serialization buffer has parameters that are not properly aligned.")
DRM_E_TEE_OUTPUT_PROTECTION_REQUIREMENTS_NOT_MET = (0x8004CD22, "The TEE has detected that certain output requirements are not being satisfied. Most commonly HDCP is required but not enabled on all available outputs.")
DRM_E_ND_MUST_REVALIDATE = (0x8004CE00, "The client must be revalidated before executing the intended operation.")
DRM_E_ND_INVALID_MESSAGE = (0x8004CE01, "A received message is garbled.")
DRM_E_ND_INVALID_MESSAGE_TYPE = (0x8004CE02, "A received message contains an invalid message type.")
DRM_E_ND_INVALID_MESSAGE_VERSION = (0x8004CE03, "A received message contains an invalid message version.")
DRM_E_ND_INVALID_SESSION = (0x8004CE04, "The requested session is invalid.")
DRM_E_ND_MEDIA_SESSION_LIMIT_REACHED = (0x8004CE05, "A new session cannot be opened because the maximum number of sessions has already been opened.")
DRM_E_ND_UNABLE_TO_VERIFY_PROXIMITY = (0x8004CE06, "The proximity detection procedure could not confirm that the receiver is near the transmitter in the network.")
DRM_E_ND_INVALID_PROXIMITY_RESPONSE = (0x8004CE07, "The response to the proximity detection challenge is invalid.")
DRM_E_ND_DEVICE_LIMIT_REACHED = (0x8004CE08, "The maximum number of devices in use has been reached. Unable to open additional devices.")
DRM_E_ND_BAD_REQUEST = (0x8004CE09, "The message format is invalid.")
DRM_E_ND_FAILED_SEEK = (0x8004CE0A, "It is not possible to seek to the specified mark-in point.")
DRM_E_ND_INVALID_CONTEXT = (0x8004CE0B, "Manager context or at least one of it's children is missing (or corrupt).")
DRM_E_ASF_BAD_ASF_HEADER = (0x8004CF00, "The ASF file has a bad ASF header.")
DRM_E_ASF_BAD_PACKET_HEADER = (0x8004CF01, "The ASF file has a bad packet header.")
DRM_E_ASF_BAD_PAYLOAD_HEADER = (0x8004CF02, "The ASF file has a bad payload header.")
DRM_E_ASF_BAD_DATA_HEADER = (0x8004CF03, "The ASF file has a bad data header.")
DRM_E_ASF_INVALID_OPERATION = (0x8004CF04, "The intended operation is invalid given the current processing state of the ASF file.")
DRM_E_ASF_AES_PAYLOAD_FOUND = (0x8004CF05, "ND payload extension system found; the file may be encrypted with AES already.")
DRM_E_ASF_EXTENDED_STREAM_PROPERTIES_OBJ_NOT_FOUND = (0x8004CF06, "Extended stream properties object is not found; the file may be in non-supported outdated format.")
DRM_E_ASF_INVALID_DATA = (0x8004CF20, "The packet is overstuffed with data.")
DRM_E_ASF_TOO_MANY_PAYLOADS = (0x8004CF21, "The number of payloads in the packet is greater than the maximum allowed.")
DRM_E_ASF_BANDWIDTH_OVERRUN = (0x8004CF22, "An object is overflowing the leaky bucket.")
DRM_E_ASF_INVALID_STREAM_NUMBER = (0x8004CF23, "The stream number is invalid; it is either zero, greater than the maximum value allowed, or has no associated data.")
DRM_E_ASF_LATE_SAMPLE = (0x8004CF24, "A sample was encountered with a presentation time outside of the mux's send window.")
DRM_E_ASF_NOT_ACCEPTING = (0x8004CF25, "The sample does not fit in the remaining payload space.")
DRM_E_ASF_UNEXPECTED = (0x8004CF26, "An unexpected error occurred.")
DRM_E_NONCE_STORE_TOKEN_NOT_FOUND = (0x8004D000, "The matching nonce store token is not found.")
DRM_E_NONCE_STORE_OPEN_STORE = (0x8004D001, "Fail to open nonce store.")
DRM_E_NONCE_STORE_CLOSE_STORE = (0x8004D002, "Fail to close nonce store.")
DRM_E_NONCE_STORE_ADD_LICENSE = (0x8004D003, "There is already a license associated with the nonce store token.")
DRM_E_LICGEN_POLICY_NOT_SUPPORTED = (0x8004D100, "The license generation policy combination is not supported.")
DRM_E_POLICYSTATE_NOT_FOUND = (0x8004D200, "The policy state is not found in the secure store.")
DRM_E_POLICYSTATE_CORRUPTED = (0x8004D201, "The policy state is not stored as a valid internal format in the secure store.")
DRM_E_MOVE_DENIED = (0x8004D300, "The requested move operation was denied by the service.")
DRM_E_INVALID_MOVE_RESPONSE = (0x8004D301, "The move response was incorrectly formed.")
DRM_E_MOVE_NONCE_MISMATCH = (0x8004D302, "The nonce in the repsonse did not match the expected value.")
DRM_E_MOVE_TXID_MISMATCH = (0x8004D303, "The transaction id in the repsonse did not match the expected value.")
DRM_E_MOVE_STORE_OPEN_STORE = (0x8004D304, "Failed to open the move store.")
DRM_E_MOVE_STORE_CLOSE_STORE = (0x8004D305, "Failed to close the move store.")
DRM_E_MOVE_STORE_ADD_DATA = (0x8004D306, "Failed to add data into the move store.")
DRM_E_MOVE_STORE_GET_DATA = (0x8004D307, "Failed to retrieve data from the move store.")
DRM_E_MOVE_FORMAT_INVALID = (0x8004D308, "The format of a move page or index is invalid.")
DRM_E_MOVE_SIGNATURE_INVALID = (0x8004D309, "The signature of a move index is invalid.")
DRM_E_COPY_DENIED = (0x8004D30A, "The requested copy operation was denied by the service.")
DRM_E_XB_OBJECT_NOTFOUND = (0x8004D400, "The extensible binary object was not found.")
DRM_E_XB_INVALID_OBJECT = (0x8004D401, "The extensible binary object format was invalid.")
DRM_E_XB_OBJECT_ALREADY_EXISTS = (0x8004D402, "A single instance extensible binary object was encountered more than once.")
DRM_E_XB_REQUIRED_OBJECT_MISSING = (0x8004D403, "A required extensible binary object was not found during building.")
DRM_E_XB_UNKNOWN_ELEMENT_TYPE = (0x8004D404, "An extensible binary object description contained an element of an unknown type.")
DRM_E_XB_INVALID_VERSION = (0x8004D405, "The serialized object version could not be found in the extensible binary object description.")
DRM_E_XB_MAX_UNKNOWN_CONTAINER_DEPTH = (0x8004D406, "The maximum unknown container depth was reached.")
DRM_E_XB_INVALID_ALIGNMENT = (0x8004D407, "The serialized message buffer is not properly aligned according to the XBinary format description.")
DRM_E_XB_OBJECT_OUT_OF_RANGE = (0x8004D408, "An extensible binary object size or count is out of the range specified by the attributes 'MinSize' and 'MaxSize'.")
DRM_E_KEYFILE_INVALID_PLATFORM = (0x8004D500, "The keyfile does not support the current platform.")
DRM_E_KEYFILE_TOO_LARGE = (0x8004D501, "The keyfile is larger than the maximum supported size.")
DRM_E_KEYFILE_PRIVATE_KEY_NOT_FOUND = (0x8004D502, "The private key requested was not found in the keyfile.")
DRM_E_KEYFILE_CERTIFICATE_CHAIN_NOT_FOUND = (0x8004D503, "The certificate chain requested was not found in the keyfile.")
DRM_E_KEYFILE_KEY_NOT_FOUND = (0x8004D504, "The AES Key ID was not found in the keyfile.")
DRM_E_KEYFILE_UNKNOWN_DECRYPTION_METHOD = (0x8004D505, "Unknown keyfile decryption method.")
DRM_E_KEYFILE_INVALID_SIGNATURE = (0x8004D506, "The keyfile signature was not valid.")
DRM_E_KEYFILE_INTERNAL_DECRYPTION_BUFFER_TOO_SMALL = (0x8004D507, "The internal decryption buffer is too small to hold the encrypted key from the keyfile.")
DRM_E_KEYFILE_PLATFORMID_MISMATCH = (0x8004D508, "Platform ID in the certificate does not match expected value.")
DRM_E_KEYFILE_CERTIFICATE_ISSUER_KEY_MISMATCH = (0x8004D509, "Issuer key of the device certificate does not match public key of the model certificate.")
DRM_E_KEYFILE_ROBUSTNESSVERSION_MISMATCH = (0x8004D50A, "Robustness version in the certificate does not match expected value.")
DRM_E_KEYFILE_FILE_NOT_CLOSED = (0x8004D50B, "The KeyFile Close function was not called before trying to unintialize the KeyFile context.")
DRM_E_KEYFILE_NOT_INITED = (0x8004D50C, "The KeyFile Context was not initialized before trying to use it.")
DRM_E_KEYFILE_FORMAT_INVALID = (0x8004D50D, "The format of the KeyFile was invalid.")
DRM_E_KEYFILE_UPDATE_NOT_ALLOWED = (0x8004D50E, "The keyfile of the device is read only, and updates are not permitted.")
DRM_E_EMPTY_LA_URL = (0x8004D50F, "<No message>")
DRM_E_PRND_MESSAGE_VERSION_INVALID = (0x8004D700, "The PRND message version is not supported.")
DRM_E_PRND_MESSAGE_WRONG_TYPE = (0x8004D701, "This method does not processs this PRND message type.")
DRM_E_PRND_MESSAGE_INVALID = (0x8004D702, "The PRND message does not conform to the PRND spec and is therefore invalid.")
DRM_E_PRND_SESSION_ID_INVALID = (0x8004D703, "The Transmitter is unable to process a renewal Registration Request Message using a different session. Use the session matching the previous session ID.")
DRM_E_PRND_PROXIMITY_DETECTION_REQUEST_CHANNEL_TYPE_UNSUPPORTED = (0x8004D704, "The PRND Registration Request Message indicated that it only supports Proximity Detection Channel Types that the Transmitter does not support.")
DRM_E_PRND_PROXIMITY_DETECTION_RESPONSE_INVALID = (0x8004D705, "The PRND Proximity Detection Response Message was successfully parsed but the nonce is invalid.")
DRM_E_PRND_PROXIMITY_DETECTION_RESPONSE_TIMEOUT = (0x8004D706, "The PRND Proximity Detection Response Message was successfully processed but did not arrive in time to verify that the Receiver is Near the Transmitter.")
DRM_E_PRND_LICENSE_REQUEST_CID_CALLBACK_REQUIRED = (0x8004D707, "The PRND License Request Message used Content Identifier Type Custom. A Content Identifier Callback to convert the value to a KID is required.")
DRM_E_PRND_LICENSE_RESPONSE_CLMID_INVALID = (0x8004D708, "The PRND License Response Message had an invalid Current License Message ID.")
DRM_E_PRND_CERTIFICATE_NOT_RECEIVER = (0x8004D709, "The PRND Registration Request Message did not include a PlayReady certificate that supports the RECEIVER feature.")
DRM_E_PRND_CANNOT_RENEW_USING_NEW_SESSION = (0x8004D70A, "The Receiver is unable to generate a renewal Registration Request Message using a new session. Use the existing session.")
DRM_E_PRND_INVALID_CUSTOM_DATA_TYPE = (0x8004D70B, "The Custom Data type is invalid. The first four bytes of Custom Data Type ID cannot be 0x4d534654 ( MSFT in ascii ).")
DRM_E_PRND_CLOCK_OUT_OF_SYNC = (0x8004D70C, "The clock on the Receiver is not synchronized with the clock on the Transmitter. Synchronize the clocks.")
DRM_E_PRND_CANNOT_REBIND_PRND_RECEIVED_LICENSE = (0x8004D70D, "The license cannot be rebound to the PRND Receiver because it was itself received from a PRND Transmitter.")
DRM_E_PRND_CANNOT_REGISTER_USING_EXISTING_SESSION = (0x8004D70E, "The Receiver is unable to generate a non-renewal Registration Request Message using an existing session. End the existing session first or use a new session.")
DRM_E_PRND_BUSY_PERFORMING_RENEWAL = (0x8004D70F, "The Receiver is currently unable to process a message of this type because it is in the middle of renewing the session.")
DRM_E_PRND_LICENSE_REQUEST_INVALID_ACTION = (0x8004D710, "Play with no qualifier during license request is all that's supported in v1 of the PRND protocol.")
DRM_E_PRND_TRANSMITTER_UNAUTHORIZED = (0x8004D711, "The Transmitter attempted to authorize with the Receiver but was unsuccessful.")
DRM_E_PRND_TX_SESSION_EXPIRED = (0x8004D712, "The Transmitter session is expired.")
DRM_E_PRND_INCOMPLETE_PROXIMITY_DETECTION = (0x8004D713, "The proximity detection hasn't completed successfully.")
DRM_E_PRND_INVALID_CERT_DIGEST = (0x8004D714, "The given certificate digest doesn't match the one stored in the MTKB")
DRM_E_OEMHAL_NOT_INITIALIZED = (0x8004D780, "The OEM HAL is not initialized.")
DRM_E_OEMHAL_OUT_OF_KEY_REGISTERS = (0x8004D781, "There are no more key registers available in the OEM HAL implementation.")
DRM_E_OEMHAL_KEYS_IN_USE = (0x8004D782, "The OEM HAL is being shutdown whilst keys are still allocated.")
DRM_E_OEMHAL_NO_KEY = (0x8004D783, "The requested preloaded key is not available or the key handle is otherwise invalid.")
DRM_E_OEMHAL_UNSUPPORTED_KEY_TYPE = (0x8004D784, "The specified key type cannot be used for the operation requested.")
DRM_E_OEMHAL_UNSUPPORTED_KEY_WRAPPING_FORMAT = (0x8004D785, "The specified wrapping key type cannot be used to unwrap the specified key.")
DRM_E_OEMHAL_UNSUPPORTED_KEY_LENGTH = (0x8004D786, "The key buffer provided is of the wrong length for the specified key/wrapping key combination.")
DRM_E_OEMHAL_UNSUPPORTED_HASH_TYPE = (0x8004D787, "The specified hash type is not supported.")
DRM_E_OEMHAL_UNSUPPORTED_SIGNATURE_SCHEME = (0x8004D788, "The specified signature scheme is not supported.")
DRM_E_OEMHAL_BUFFER_TOO_LARGE = (0x8004D789, "The output buffer is larger than the input buffer and must be the same size.")
DRM_E_OEMHAL_SAMPLE_ENCRYPTION_MODE_NOT_PERMITTED = (0x8004D78A, "The sample encryption mode is not permitted for this combination of encrypt parameters.")
DRM_E_M2TS_PAT_PID_IS_NOT_ZERO = (0x8004D800, "PID 0 is reserved for PAT and cannot be used for other type of packet.")
DRM_E_M2TS_PTS_NOT_EXIST = (0x8004D801, "The audio/video PES doesn' have the PTS data.")
DRM_E_M2TS_PES_PACKET_LENGTH_NOT_SPECIFIED = (0x8004D802, "The audio PES' packet length is 0 which is not allowed.")
DRM_E_M2TS_OUTPUT_BUFFER_FULL = (0x8004D803, "The output buffer for receiving the encrypted packets is full.")
DRM_E_M2TS_CONTEXT_NOT_INITIALIZED = (0x8004D804, "The encryptor context hasn't been initialized yet.")
DRM_E_M2TS_NEED_KEY_DATA = (0x8004D805, "The key data for encrypting the sample is either hasn't been set or the encryptor needs next key due to key rotation.")
DRM_E_M2TS_DDPLUS_FORMAT_INVALID = (0x8004D806, "Not supported DDPlus format.")
DRM_E_M2TS_NOT_UNIT_START_PACKET = (0x8004D807, "The encryptor expects a unit start packet. The unit start packet should appear before the rest of the packets in the unit.")
DRM_E_M2TS_TOO_MANY_SUBSAMPLES = (0x8004D808, "Too many subsamples over the limit that the ECM allows.")
DRM_E_M2TS_TABLE_ID_INVALID = (0x8004D809, "The PAT or PMT packet contains an invalid table ID.")
DRM_E_M2TS_PACKET_SYNC_BYTE_INVALID = (0x8004D80A, "The TS packet doesn't start with the 0x47 (sync byte).")
DRM_E_M2TS_ADAPTATION_LENGTH_INVALID = (0x8004D80B, "The adaptation field length is invalid.")
DRM_E_M2TS_PAT_HEADER_INVALID = (0x8004D80C, "There is an error in PAT header, unable to parse it.")
DRM_E_M2TS_PMT_HEADER_INVALID = (0x8004D80D, "There is an error in PMT header, unable to parse it.")
DRM_E_M2TS_PES_START_CODE_NOT_FOUND = (0x8004D80E, "Cannot find the PES start code (0x000001).")
DRM_E_M2TS_STREAM_OR_PACKET_TYPE_CHANGED = (0x8004D80F, "The stream type or packet type of an existing PID has changed")
DRM_E_M2TS_INTERNAL_ERROR = (0x8004D810, "An internal error occurred during encryptrion.")
DRM_E_M2TS_ADTS_FORMAT_INVALID = (0x8004D811, "Not supported ADTS format.")
DRM_E_M2TS_MPEGA_FORMAT_INVALID = (0x8004D812, "Not supported MPEGA format.")
DRM_E_M2TS_CA_DESCRIPTOR_LENGTH_INVALID = (0x8004D813, "The CA_descruptor length is greater than ES_info length.")
DRM_E_M2TS_CRC_FIELD_INVALID = (0x8004D814, "The CRC field in the PAT or PMT packet is invalid.")
DRM_E_M2TS_INCOMPLETE_SECTION_HEADER = (0x8004D815, "The section header of a PES is not completed while the next PES packet has started already")
DRM_E_M2TS_INVALID_UNALIGNED_DATA = (0x8004D816, "Not allowed to have the overflow of the unaligned payload to accross more than one PES")
DRM_E_M2TS_GET_ENCRYPTED_DATA_FIRST = (0x8004D817, "Do not pass additional data for encryption when the last encryption result is DRM_S_MORE_DATA")
DRM_E_M2TS_CANNOT_CHANGE_PARAMETER = (0x8004D818, "Not allowed to change the encryption parameter once the encryption started, i.e. after Drm_M2ts_Encrypt is called")
DRM_E_M2TS_UNKNOWN_PACKET = (0x8004D819, "This packet appears before the first PAT and/or PMT and will be dropped.")
DRM_E_M2TS_DROP_PACKET = (0x8004D820, "This packet should be dropped because at least one field in the packet contains an invalid data.")
DRM_E_M2TS_DROP_PES = (0x8004D821, "This PES packet should be dropped because the PES packet is not valid.")
DRM_E_M2TS_INCOMPLETE_PES = (0x8004D822, "This PES packet has one or more missing packets.")
DRM_E_M2TS_WAITED_TOO_LONG = (0x8004D823, "This packet is dropped because its unit is not completed after a long period of time.")
DRM_E_M2TS_SECTION_LENGTH_INVALID = (0x8004D824, "The section length inside the PAT or PMT is less than the minimun PAT or PMT section.")
DRM_E_M2TS_PROGRAM_INFO_LENGTH_INVALID = (0x8004D825, "The sum of the program info length and the other fields in the PMT section don't match with the section length.")
DRM_E_M2TS_PES_HEADER_INVALID = (0x8004D826, "Failed to parse the PES header, the PES maybe too short.")
DRM_E_M2TS_ECM_PAYLOAD_OVER_LIMIT = (0x8004D827, "The size of the ECM payload exceeds the limit of 64k bytes")
DRM_E_M2TS_SET_CA_PID_FAILED = (0x8004D828, "Unable to assign a PID for CA_PID, all PIDs in the range of 0x0010 to 0x1FFE are used.")
DRM_E_LICGEN_CANNOT_PERSIST_LICENSE = (0x8004D901, "A non-persistent license cannot be stored in the license store.")
DRM_E_LICGEN_PERSISTENT_REMOTE_LICENSE = (0x8004D902, "A remote bound license should be non-persistent.")
DRM_E_LICGEN_EXPIRE_AFTER_FIRST_PLAY_REMOTE_LICENSE = (0x8004D903, "A remote bound license should not have expire after first play property.")
DRM_E_LICGEN_ROOT_LICENSE_CANNOT_ENCRYPT = (0x8004D904, "A root license should not be used to encrypt content.")
DRM_E_LICGEN_EMBED_LOCAL_LICENSE = (0x8004D905, "A local bound license cannot be embedded.")
DRM_E_LICGEN_LOCAL_LICENSE_WITH_REMOTE_CERTIFICATE = (0x8004D906, "A local bound license cannot be bound to a remote certificate.")
DRM_E_LICGEN_PLAY_ENABLER_REMOTE_LICENSE = (0x8004D907, "A remote bound license cannot have play enablers other than Passing to Unknown Output or Passing Constrained Resolution to Unknown Output.")
DRM_E_LICGEN_DUPLICATE_PLAY_ENABLER = (0x8004D908, "A license descriptor contains a duplicate play enabler.")
DRM_E_LICGEN_CHILD_SECURITY_LEVEL_TOO_LOW = (0x8004D909, "The security level of the chained license is too low.")
DRM_E_H264_PARSING_FAILED = (0x8004DA00, "The H264 was unable to be parsed.")
DRM_E_H264_SPS_PROFILE = (0x8004DA01, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_IDC = (0x8004DA02, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_SPSID = (0x8004DA03, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_FRAMENUM = (0x8004DA04, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_POCTYPE = (0x8004DA05, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_POCLSB = (0x8004DA06, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_POCCYCLE = (0x8004DA07, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_NUMREFFRAMES = (0x8004DA08, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_CHROMATOP = (0x8004DA09, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_CHROMABOTTOM = (0x8004DA0A, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_NALHRD = (0x8004DA0B, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VLDHRD = (0x8004DA0C, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUIBPPD = (0x8004DA0D, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUIBPMD = (0x8004DA0E, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUIMMLH = (0x8004DA0F, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUIMMLV = (0x8004DA10, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUINRF = (0x8004DA11, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_VUIMDFB = (0x8004DA12, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_WIDTH_HEIGHT = (0x8004DA13, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_AREA = (0x8004DA14, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_MINHEIGHT2 = (0x8004DA15, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_MINHEIGHT3 = (0x8004DA16, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_CROPWIDTH = (0x8004DA17, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_CROPHEIGHT = (0x8004DA18, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_MORE_RBSP = (0x8004DA19, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_CHROMA_IDC = (0x8004DA1A, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_BITDEPTHLUMA = (0x8004DA1B, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_BITDEPTHCHROMA = (0x8004DA1C, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_DELTASCALE1 = (0x8004DA1D, "SPS-specific H264 parsing error")
DRM_E_H264_SPS_DELTASCALE2 = (0x8004DA1E, "SPS-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOMANY = (0x8004DA30, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOSHORT1 = (0x8004DA31, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOSHORT2 = (0x8004DA32, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOSHORT3 = (0x8004DA33, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOSHORT4 = (0x8004DA34, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_TOOSHORT5 = (0x8004DA35, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_EXGOLOBMTOOLONG1 = (0x8004DA36, "Bitstream-specific H264 parsing error")
DRM_E_H264_BITSTREAM_EXGOLOBMTOOLONG2 = (0x8004DA37, "Bitstream-specific H264 parsing error")
DRM_E_H264_NALU_NO_START_CODE = (0x8004DA40, "Nalu-specific H264 parsing error")
DRM_E_H264_NALU_ALL_ZERO = (0x8004DA41, "Nalu-specific H264 parsing error")
DRM_E_H264_NALU_EMULATION = (0x8004DA42, "Nalu-specific H264 parsing error")
DRM_E_H264_PPS_PPSID = (0x8004DA50, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SPSID = (0x8004DA51, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SPS_NOT_FOUND = (0x8004DA52, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_NUM_SLICE_GROUPS = (0x8004DA53, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SLICE_GROUP_MAX = (0x8004DA54, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_RUN_LENGTH = (0x8004DA55, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_TOP_LEFT = (0x8004DA56, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SLICE_GROUP_RATE = (0x8004DA57, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SLICE_GROUP_MAP = (0x8004DA58, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SLICE_GROUP_ID = (0x8004DA59, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_REF_IDX_L0 = (0x8004DA5A, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_REF_IDX_L1 = (0x8004DA5B, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_WEIGHTED_BIPRED = (0x8004DA5C, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_PIC_INIT_QP = (0x8004DA5D, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_PIC_INIT_QS = (0x8004DA5E, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_PIC_CHROMA_QP = (0x8004DA5F, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_REDUN_PIC_COUNT = (0x8004DA61, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_DELTA_SCALE1 = (0x8004DA62, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_DELTA_SCALE2 = (0x8004DA63, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_SECOND_CHROMA_QP = (0x8004DA64, "PPS-specific H264 parsing error")
DRM_E_H264_PPS_MORE_RBSP = (0x8004DA65, "PPS-specific H264 parsing error")
DRM_E_H264_SH_SLICE_TYPE = (0x8004DA70, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_SLICE_TYPE_UNSUPPORTED = (0x8004DA71, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_PPSID = (0x8004DA72, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_PPS_NOT_FOUND = (0x8004DA73, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_SPS_NOT_FOUND = (0x8004DA74, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_SLICE_TYPE_PROFILE = (0x8004DA75, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_IDR_FRAME_NUM = (0x8004DA76, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_FIRST_MB_IN_SLICE = (0x8004DA77, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_IDR_PIC_ID = (0x8004DA78, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_REDUN_PIC_COUNT = (0x8004DA79, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_NUM_REF_IDX_LX0 = (0x8004DA7A, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_NUM_REF_IDX_LX1 = (0x8004DA7B, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_REF_PIC_LIST_REORDER0 = (0x8004DA7C, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_REF_PIC_LIST_REORDER1 = (0x8004DA7D, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_LUMA_WEIGHT_DENOM = (0x8004DA7E, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_CHROMA_WEIGHT_DENOM = (0x8004DA7F, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_WEIGHT_LUMA0 = (0x8004DA80, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_OFFSET_LUMA0 = (0x8004DA81, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_WEIGHT_CHROMA0 = (0x8004DA82, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_OFFSET_CHROMA0 = (0x8004DA83, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_WEIGHT_LUMA1 = (0x8004DA84, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_OFFSET_LUMA1 = (0x8004DA85, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_WEIGHT_CHROMA1 = (0x8004DA86, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_WP_OFFSET_CHROMA1 = (0x8004DA87, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_NUM_REF_PIC_MARKING = (0x8004DA88, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO4_DUPLICATE = (0x8004DA89, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO4_MAX_LONG_TERM_FRAME = (0x8004DA8A, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO5_DUPLICATE = (0x8004DA8B, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO5_FOLLOWS_MMC06 = (0x8004DA8C, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO5_COEXIST_MMCO_1_OR_3 = (0x8004DA8D, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MMCO6_DUPLICATE = (0x8004DA8E, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_MODEL_NUMBER = (0x8004DA8F, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_SLICE_QP = (0x8004DA90, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_LF_ALPHA_C0_OFFSET = (0x8004DA91, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_LF_BETA_OFFSET = (0x8004DA92, "Slice-Header-specific H264 parsing error")
DRM_E_H264_SH_SLICE_GROUP_CHANGE = (0x8004DA93, "Slice-Header-specific H264 parsing error")
DRM_E_RPROV_INVALID_REQUEST = (0x8004DB00, "Invalid Remote provisioning request received.")
DRM_E_RPROV_VERSION_MISSMATCH = (0x8004DB01, "Invalid Remote provisioning version received.")
DRM_E_RPROV_INVALID_RESPONSE = (0x8004DB02, "Invalid response received.")
DRM_E_RPROV_BOOTSTRAP_FAILURE = (0x8004DB03, "Remote provisioning bootstrap failed.")
DRM_E_FIRMWARE_REVOKED = (0x8004DB04, "TEE Firmware is revoked; firmware update necessary.")
DRM_E_RPROV_SKIP_BOOTSTRAP = (0x8004DB05, "Remote provisioning does not need bootstrap.")
DRM_E_SECURESTOP_STORE_CORRUPT = (0x8004DC00, "The secure stop store is corrupted.")
DRM_E_SECURESTOP_SESSION_LOCKED = (0x8004DC02, "The secure stop session is locked and may not be modified.")
DRM_E_SECURESTOP_SESSION_CORRUPT = (0x8004DC03, "The secure stop session data is corrupted.")
DRM_E_SECURESTOP_SESSION_ACTIVE = (0x8004DC04, "The secure stop session is active and cannot be locked.")
DRM_E_SECURESTOP_SESSION_NOT_FOUND = (0x8004DC05, "The secure stop session could not be found in the data store.")
DRM_E_SECURESTOP_INVALID_RESPONSE = (0x8004DC06, "The secure stop response is invalid.")
DRM_E_SECURESTOP_SESSION_STOPPED = (0x8004DC07, "The secure stop session is stopped and may not be used for decryption.")
DRM_E_SECURESTOP_INVALID_PUBLISHER_ID = (0x8004DC08, "Trying to generate a challenge with a publisher ID that doesn't match the one associated with the session.")
DRM_E_SECURESTOP_PUBLISHER_ID_INCONSISTENT = (0x8004DC09, "Licenses acquired within the same session don't have the same secure stop publisher ID.")
DRM_E_SECURESTOP_INCONSISTENT = (0x8004DC0A, "Some licenses acquired within the same session have secure stop while others don't.")
DRM_E_MUTEX_ACQUIRE_FAILED = (0x8004DD00, "The mutex acquire for critical section failed.")
DRM_E_MUTEX_LEAVE_FAILED = (0x8004DD01, "The mutex leave for critical section failed.")
DRM_E_OEM_DPU_IS_BUSY = (0x8004DD02, "The DPU is still busy handling the previous request.")
DRM_E_OEM_DPU_TIMEOUT_FOR_HDCP_TYPE1_LOCK_REQUEST = (0x8004DD03, "The DPU can not finish the command handling from SEC2 before timeout.")
DRM_E_OEM_HDCP_TYPE1_LOCK_FAILED = (0x8004DD04, "The DPU failed to lock HDCP2.2 type as requested by SEC2.")
DRM_E_OEM_HDCP_TYPE1_LOCK_UNKNOWN = (0x8004DD05, "The HDCP type1 lock RESPONSE value set by DPU is unknown.")
DRM_E_OEM_BAR0_PRIV_WRITE_ERROR = (0x8004DD06, "The register could not be written due to PRI failure.")
DRM_E_OEM_BAR0_PRIV_READ_ERROR = (0x8004DD07, "The register could not be read due to PRI failure.")
DRM_E_OEM_DMA_FAILURE = (0x8004DD08, "The DMA transaction failure.")
DRM_E_OEM_UNSUPPORTED_HS_ACTION = (0x8004DD09, "The requested HS action is not supported.")
DRM_E_OEM_UNSUPPORTED_KDF = (0x8004DD0A, "The KDF is not supported in OEM's encryption/decryption implementation.")
DRM_E_OEM_INVALID_AES_CRYPTO_MODE = (0x8004DD0B, "The requested AES crypto mode is invalid.")
DRM_E_OEM_HS_CHK_INVALID_INPUT = (0x8004DD0C, "One or more of the input arguments to HS mode are invalid.")
DRM_E_OEM_HS_CHK_CHIP_NOT_SUPPORTED = (0x8004DD0D, "The GPU does not support playready.")
DRM_E_OEM_HS_CHK_UCODE_REVOKED = (0x8004DD0E, "Current ucode was revoked.")
DRM_E_OEM_HS_CHK_NOT_IN_LSMODE = (0x8004DD0F, "Relevant falcon (depending upon the context from which this error code is being returned) is not in LS mode.")
DRM_E_OEM_HS_CHK_INVALID_LS_PRIV_LEVEL = (0x8004DD10, "Relevant falcon (depending upon the context from which this error code is being returned) is not at proper LS priv level.")
DRM_E_OEM_HS_CHK_INVALID_REGIONCFG = (0x8004DD11, "The REGIONCFG is not set to correct WPR region.")
DRM_E_OEM_HS_CHK_PRIV_SEC_DISABLED_ON_PROD = (0x8004DD12, "The priv sec is unexpectedly disabled on production board.")
DRM_E_OEM_HS_CHK_SW_FUSING_ALLOWED_ON_PROD = (0x8004DD13, "The SW fusing is unexpectedly allowed on production board.")
DRM_E_OEM_HS_CHK_INTERNAL_SKU_ON_PROD = (0x8004DD14, "The SKU is internal on production board.")
DRM_E_OEM_HS_CHK_DEVID_OVERRIDE_ENABLED_ON_PROD = (0x8004DD15, "The devid override is enabled on production board.")
DRM_E_OEM_HS_CHK_INCONSISTENT_PROD_MODES = (0x8004DD16, "The falcons in GPU are not in consistent debug/production mode.")
DRM_E_OEM_HS_CHK_HUB_ENCRPTION_DISABLED = (0x8004DD17, "The hub encryption is not enabled on FB.")
DRM_E_OEM_HS_PR_ILLEGAL_LASSAHS_STATE_AT_HS_ENTRY = (0x8004DD18, "LASSAHS is not in a correct state before doing HS entry")
DRM_E_OEM_HS_PR_ILLEGAL_LASSAHS_STATE_AT_MPK_DECRYPT = (0x8004DD19, "LASSAHS is not in a correct state before doing MPK decryption")
DRM_E_OEM_HS_PR_ILLEGAL_LASSAHS_STATE_AT_HS_EXIT = (0x8004DD1A, "LASSAHS is not in a correct state before doing HS exit")
DRM_E_OEM_PREENTRY_GDK_OUT_OF_MEMORY = (0x8004DD1B, "Preallocation for GDK failed")
DRM_E_OEM_GDK_IMEM_BLOCK_REVALIDATION_FAILED = (0x8004DD1C, "Failed to revalidate imem blocks invalidated during LASSAHS")
DRM_E_OEM_INVALID_PDI = (0x8004DD1D, "The read PDI value is invalid")
DRM_E_OEM_INVALID_SIZE_OF_CDKBDATA = (0x8004DD1E, "The size of NV_KB_CDKBData is not multiple of 16")
DRM_E_SE_CRYPTO_MUTEX_ACQUIRE_FAILED = (0x8004DD1F, "Failed to acquire the Security Engine mutex for cypto operations")
DRM_E_SE_CRYPTO_MUTEX_RELEASE_FAILED = (0x8004DD20, "Failed to release the Security Engine mutex for cypto operations")
DRM_E_SE_CRYPTO_POINT_NOT_ON_CURVE = (0x8004DD21, "Point is not on the elliptic curve")
DRM_E_OEM_WAIT_FOR_BAR0_IDLE_FAILED = (0x8004DD22, "WFI on a PRI read/write failed")
DRM_E_OEM_ERROR_PRI_UNEXPECTED_FAILURE = (0x8004DD23, "DRM errors.")
DRM_E_OEM_CSB_PRIV_WRITE_ERROR = (0x8004DD24, "The register could not be written due to CSB PRI failure.")
DRM_E_OEM_CSB_PRIV_READ_ERROR = (0x8004DD25, "The register could not be read due to CSB PRI failure.")
DRM_E_OEM_HS_MUTEX_ACQUIRE_FAILED = (0x8004DD26, "The mutex acquire for critical section at HS mode failed.")
DRM_E_OEM_HS_MUTEX_RELEASE_FAILED = (0x8004DD27, "The mutex leave for critical section at HS mode failed.")
DRM_E_MUTEX_INVALIDARG = (0x8004DDC1, "The Mutex ID is invalid.")
DRM_E_MUTEX_ACQUIRE_GETTIME_FAILED = (0x8004DDC2, "Failed to get current time during mutex acquisition.")
DRM_E_MUTEX_ACQUIRE_BAD_ID_VALUE = (0x8004DDC3, "The token ID obtained during mutex acquisition is invalid.")
DRM_E_MUTEX_ACQUIRE_BAD_SHAREDATA = (0x8004DDC4, "Frame Buffer address of SEC-NVDEC shared structure is invalid.")
DRM_E_MUTEX_ACQUIRE_TIMEOUT = (0x8004DDC5, "Timeout occured during mutex acquisition.")
DRM_E_SECUREBUS_TIMEOUT = (0x8004DDC6, "Timeout occured on secure bus while waiting for DOC to become empty.")
DRM_E_SECUREBUS_READ_FAILED = (0x8004DDC7, "Read request on secure bus failed.")
DRM_E_MUTEX_OWNERSHIP_MATCH_FAILED = (0x8004DDC8, "Token ID reserved for the mutex in hardware doesn't match with specified token ID.")
DRM_E_INVALID_PDI = (0x8004DDC9, "The read PDI value is invalid.")
DRM_E_SECURETIME_INVALID_REQUEST_DATA = (0x8004DE00, "The secure time client request data is invalid.")
DRM_E_SECURETIME_CLOCK_NOT_SET = (0x8004DE01, "The secure time clock has not been set.")
DRM_E_SECURETIME_RESPONSE_TIMEOUT = (0x8004DE02, "The secure time server response timed out.")
DRM_E_SECURETIME_SERVER_SECURITY_LEVEL_TOO_LOW = (0x8004DE03, "The secure time server's security level is too low for the client.")
DRM_E_LICENSESERVERTIME_MUST_REACQUIRE_LICENSE = (0x8004DE04, "This license was acquired before the LicenseServerTime feature was enabled. It must be reacquired.")
DRM_E_LSRD_DETECTED = (0x8004DF00, "HDS file rollback is detected.")
DRM_E_LSRD_INVALID_ACL = (0x8004DF01, "The ACL of the HDS Registry Subkey is invalid.")
DRM_E_LSRD_DETECTION_IN_PROGRESS = (0x8004DF02, "The client is currently processing LSRD check operation. Concurrent operations are not allowed.")
DRM_E_LSRD_ACL_NOT_PRESENT = (0x8004DF03, "The security descriptor does not contain an ACL.")
DRM_E_LSRD_INVALID_COMMAND = (0x8004DF04, "The PlayReady Process received an invalid command.")
DRM_E_LSRD_SEQUENCE_NUMBER_IS_AT_MAX_LIMIT = (0x8004DF05, "The LSRD sequence number has reached its maximum limit.")
DRM_E_SECUREDELETE_INVALID_RESPONSE = (0x8004DFA0, "The secure delete response is invalid.")
DRM_E_PROVENANCE_VALIDATION_FAILED = (0x8004DFB0, "The provenance validation failed. The media file has been tampered with.")
DRM_E_INVALID_PROVENANCE_MANIFEST = (0x8004DFB1, "The provenance manifest is invalid.")
DRM_E_INVALID_PROVENANCE_CERTIFICATE_CHAIN = (0x8004DFB2, "The provenance certificate chain stored in the manifest is invalid or a valid certificate chain could not be established.")
DRM_E_PROVENANCE_UNTRUSTED_ROOT_CERTIFICATE = (0x8004DFB3, "The provenance certificate chain could not be validated because no root certificates were provided in the trusted list.")
DRM_E_MP4_EXCEEDED_NUM_CHUNKS = (0x8004DFB4, "A query was made to the MP4 parser to get chunk information for a chunk that does not exist.")
DRM_E_MP4_NULL_FILE_STREAM = (0x8004DFB5, "A file stream pointer was unexpectedly null.")
DRM_E_MP4_INVALID_MP4_FILE = (0x8004DFB6, "The MP4 file is malformed.")
DRM_E_MP4_PARSING_ABORTED = (0x8004DFB7, "MP4 parsing was aborted by the caller.")
DRM_E_MP4_EXCEEDED_BOX_SIZE = (0x8004DFB8, "The MP4 file has a box that references data beyond the end of the box.")
DRM_E_MP4_INVALID_BOX_SIZE = (0x8004DFB9, "The MP4 file has an invalid box size.")
DRM_E_MP4_INVALID_PARSING_STATE = (0x8004DFBA, "MP4 parser functions were invoked in an invalid sequence.")
DRM_E_MP4_INVALID_BOX_ATTRIBUTE = (0x8004DFBB, "An MP4 box has a malformed attribute.")
DRM_E_MP4_INVALID_BOX_VERSION = (0x8004DFBC, "An MP4 box had an unrecognized version.")
DRM_E_MP4_INVALID_STTS_CONTAINS_ENTRIES = (0x8004DFBD, "The 'stts' box should not contain entries in purely fragmented Mp4 files.")
DRM_E_C2PA_FTYP_NOT_SET = (0x8004DFBE, "The 'ftyp' box lacks the 'c2pa' compatible_brands attribute.")
DRM_E_MP4_BOX_LARGER_THAN_4GB = (0x8004DFBF, "The MP4 file has a box that is larger than 4 GB in size which is not supported by this parsre.")
DRM_E_MP4_C2PA_BOX_ALREADY_PRESENT = (0x8004DFC0, "The MP4 file already contains an unexpected C2PA Box.")
DRM_E_MP4_CIB_BOX_ALREADY_PRESENT = (0x8004DFC1, "The MP4 file already contains an unexpected Content Integrity Box.")
DRM_E_C2PA_MANIFEST_BOX_NOT_PRESENT = (0x8004DFC2, "The MP4 file lacks the expected c2pa Manifest Box.")
DRM_E_C2PA_MERKLE_BOX_NOT_PRESENT = (0x8004DFC3, "The MP4 file lacks the expected c2pa Merkle Box.")
DRM_E_MP4_INVALID_C2PA_MANIFEST_BOX = (0x8004DFC4, "The MP4 file contains an invalid c2pa box with type Manifest.")
DRM_E_MP4_INVALID_C2PA_MERKLE_BOX = (0x8004DFC5, "The MP4 file contains an invalid c2pa box with type Merkle.")
DRM_E_MP4_INVALID_PARSING_TYPE = (0x8004DFC6, "The MP4 parser was initialized with an invalid type.")
DRM_E_MP4_FILE_LACKS_MOOV_BOX = (0x8004DFC7, "The MP4 file does not have a 'moov' box.")
DRM_E_MP4_EXCEEDED_NUM_TRACK_IDS = (0x8004DFC8, "A query was made to the MP4 parser to get track information for a track that does not exist.")
DRM_E_MP4_INVALID_EXCLUSION_RULE = (0x8004DFC9, "An Exclusion Rule was passed into the MP4 Parser that was incorrectly formatted.")
DRM_E_WIN32_FILE_NOT_FOUND = (0x80070002, "The system cannot find the file specified.")
DRM_E_HANDLE = (0x80070006, "Invalid handle.")
DRM_E_WIN32_NO_MORE_FILES = (0x80070012, "There are no more files.")
DRM_E_INVALIDARG = (0x80070057, "The parameter is incorrect.")
DRM_E_BUFFERTOOSMALL = (0x8007007A, "The data area passed to a function is too small.")
DRM_E_NOMORE = (0x80070103, "No more data is available.")
DRM_E_ARITHMETIC_OVERFLOW = (0x80070216, "Arithmetic result exceeded maximum value.")
DRM_E_NOT_FOUND = (0x80070490, "Element not found.")
DRM_E_INVALID_COMMAND_LINE = (0x80070667, "Invalid command line argument.")
DRM_E_FAILED_TO_STORE_LICENSE = (0xC00D2712, "License storage is not working.")
DRM_E_PARAMETERS_MISMATCHED = (0xC00D272F, "A problem has occurred in the Digital Rights Management component.")
DRM_E_NOT_ALL_STORED = (0xC00D275F, "Some of the licenses could not be stored.")
@property
def code(self):
"""Return the numeric code of the error."""
return hex(self.value[0])
@property
def message(self):
"""Return the descriptive message of the error."""
return self.value[1]
@staticmethod
def from_code(code: str):
"""Get the error message for a given error code."""
for error in DRMResult:
if error.value[0] == int(code, 16):
return error
raise ValueError("Invalid DRMResult")

View File

@ -36,3 +36,7 @@ class InvalidCertificateChain(PyPlayreadyException):
class OutdatedDevice(PyPlayreadyException):
"""The PlayReady Device is outdated and does not support a specific operation."""
class ServerException(PyPlayreadyException):
"""Recasted on the client if found in license response."""

View File

@ -1,6 +1,7 @@
from __future__ import annotations
import base64
from enum import IntEnum
from typing import Union
from Crypto.Cipher import AES
@ -8,6 +9,102 @@ from Crypto.Hash import CMAC
from construct import Const, GreedyRange, Struct, Int32ub, Bytes, Int16ub, this, Switch, LazyBound, Array, Container
class XMRObjectTypes(IntEnum):
INVALID = 0x0000
OUTER_CONTAINER = 0x0001
GLOBAL_POLICY_CONTAINER = 0x0002
MINIMUM_ENVIRONMENT_OBJECT = 0x0003
PLAYBACK_POLICY_CONTAINER = 0x0004
OUTPUT_PROTECTION_OBJECT = 0x0005
UPLINK_KID_OBJECT = 0x0006
EXPLICIT_ANALOG_VIDEO_OUTPUT_PROTECTION_CONTAINER = 0x0007
ANALOG_VIDEO_OUTPUT_CONFIGURATION_OBJECT = 0x0008
KEY_MATERIAL_CONTAINER = 0x0009
CONTENT_KEY_OBJECT = 0x000A
SIGNATURE_OBJECT = 0x000B
SERIAL_NUMBER_OBJECT = 0x000C
SETTINGS_OBJECT = 0x000D
COPY_POLICY_CONTAINER = 0x000E
ALLOW_PLAYLISTBURN_POLICY_CONTAINER = 0x000F
INCLUSION_LIST_OBJECT = 0x0010
PRIORITY_OBJECT = 0x0011
EXPIRATION_OBJECT = 0x0012
ISSUEDATE_OBJECT = 0x0013
EXPIRATION_AFTER_FIRSTUSE_OBJECT = 0x0014
EXPIRATION_AFTER_FIRSTSTORE_OBJECT = 0x0015
METERING_OBJECT = 0x0016
PLAYCOUNT_OBJECT = 0x0017
GRACE_PERIOD_OBJECT = 0x001A
COPYCOUNT_OBJECT = 0x001B
COPY_PROTECTION_OBJECT = 0x001C
PLAYLISTBURN_COUNT_OBJECT = 0x001F
REVOCATION_INFORMATION_VERSION_OBJECT = 0x0020
RSA_DEVICE_KEY_OBJECT = 0x0021
SOURCEID_OBJECT = 0x0022
REVOCATION_CONTAINER = 0x0025
RSA_LICENSE_GRANTER_KEY_OBJECT = 0x0026
USERID_OBJECT = 0x0027
RESTRICTED_SOURCEID_OBJECT = 0x0028
DOMAIN_ID_OBJECT = 0x0029
ECC_DEVICE_KEY_OBJECT = 0x002A
GENERATION_NUMBER_OBJECT = 0x002B
POLICY_METADATA_OBJECT = 0x002C
OPTIMIZED_CONTENT_KEY_OBJECT = 0x002D
EXPLICIT_DIGITAL_AUDIO_OUTPUT_PROTECTION_CONTAINER = 0x002E
RINGTONE_POLICY_CONTAINER = 0x002F
EXPIRATION_AFTER_FIRSTPLAY_OBJECT = 0x0030
DIGITAL_AUDIO_OUTPUT_CONFIGURATION_OBJECT = 0x0031
REVOCATION_INFORMATION_VERSION_2_OBJECT = 0x0032
EMBEDDING_BEHAVIOR_OBJECT = 0x0033
SECURITY_LEVEL = 0x0034
COPY_TO_PC_CONTAINER = 0x0035
PLAY_ENABLER_CONTAINER = 0x0036
MOVE_ENABLER_OBJECT = 0x0037
COPY_ENABLER_CONTAINER = 0x0038
PLAY_ENABLER_OBJECT = 0x0039
COPY_ENABLER_OBJECT = 0x003A
UPLINK_KID_2_OBJECT = 0x003B
COPY_POLICY_2_CONTAINER = 0x003C
COPYCOUNT_2_OBJECT = 0x003D
RINGTONE_ENABLER_OBJECT = 0x003E
EXECUTE_POLICY_CONTAINER = 0x003F
EXECUTE_POLICY_OBJECT = 0x0040
READ_POLICY_CONTAINER = 0x0041
EXTENSIBLE_POLICY_RESERVED_42 = 0x0042
EXTENSIBLE_POLICY_RESERVED_43 = 0x0043
EXTENSIBLE_POLICY_RESERVED_44 = 0x0044
EXTENSIBLE_POLICY_RESERVED_45 = 0x0045
EXTENSIBLE_POLICY_RESERVED_46 = 0x0046
EXTENSIBLE_POLICY_RESERVED_47 = 0x0047
EXTENSIBLE_POLICY_RESERVED_48 = 0x0048
EXTENSIBLE_POLICY_RESERVED_49 = 0x0049
EXTENSIBLE_POLICY_RESERVED_4A = 0x004A
EXTENSIBLE_POLICY_RESERVED_4B = 0x004B
EXTENSIBLE_POLICY_RESERVED_4C = 0x004C
EXTENSIBLE_POLICY_RESERVED_4D = 0x004D
EXTENSIBLE_POLICY_RESERVED_4E = 0x004E
EXTENSIBLE_POLICY_RESERVED_4F = 0x004F
REMOVAL_DATE_OBJECT = 0x0050
AUX_KEY_OBJECT = 0x0051
UPLINKX_OBJECT = 0x0052
INVALID_RESERVED_53 = 0x0053
APPLICATION_ID_LIST = 0x0054
REAL_TIME_EXPIRATION = 0x0055
ND_TX_AUTH_CONTAINER = 0x0056
ND_TX_AUTH_OBJECT = 0x0057
EXPLICIT_DIGITAL_VIDEO_PROTECTION = 0x0058
DIGITAL_VIDEO_OPL = 0x0059
SECURESTOP = 0x005A
SECURESTOP2 = 0x005C
OPTIMIZED_CONTENT_KEY2 = 0x005D
COPY_UNKNOWN_OBJECT = 0xFFFD
PLAYBACK_UNKNOWN_OBJECT = 0xFFFD
GLOBAL_POLICY_UNKNOWN_OBJECT = 0xFFFD
COPY_UNKNOWN_CONTAINER = 0xFFFE
PLAYBACK_UNKNOWN_CONTAINER = 0xFFFE
UNKNOWN_CONTAINERS = 0xFFFE
class _XMRLicenseStructs:
PlayEnablerType = Struct(
"player_enabler_type" / Bytes(16)
@ -159,34 +256,34 @@ class _XMRLicenseStructs:
"data" / Switch(
lambda ctx: ctx.type,
{
0x0005: OutputProtectionLevelRestrictionObject,
0x0008: AnalogVideoOutputConfigurationRestriction,
0x000a: ContentKeyObject,
0x000b: SignatureObject,
0x000d: RightsSettingsObject,
0x0012: ExpirationRestrictionObject,
0x0013: IssueDateObject,
0x0016: MeteringRestrictionObject,
0x001a: GracePeriodObject,
0x0022: SourceIdObject,
0x002a: ECCKeyObject,
0x002c: PolicyMetadataObject,
0x0029: DomainRestrictionObject,
0x0030: ExpirationAfterFirstPlayRestrictionObject,
0x0031: DigitalAudioOutputRestrictionObject,
0x0032: RevInfoVersionObject,
0x0033: EmbeddedLicenseSettingsObject,
0x0034: SecurityLevelObject,
0x0037: MoveObject,
0x0039: PlayEnablerType,
0x003a: CopyEnablerObject,
0x003b: UplinkKIDObject,
0x003d: CopyCountRestrictionObject,
0x0050: RemovalDateObject,
0x0051: AuxiliaryKeysObject,
0x0052: UplinkKeyObject3,
0x005a: SecureStopRestrictionObject,
0x0059: DigitalVideoOutputRestrictionObject
XMRObjectTypes.OUTPUT_PROTECTION_OBJECT: OutputProtectionLevelRestrictionObject,
XMRObjectTypes.ANALOG_VIDEO_OUTPUT_CONFIGURATION_OBJECT: AnalogVideoOutputConfigurationRestriction,
XMRObjectTypes.CONTENT_KEY_OBJECT: ContentKeyObject,
XMRObjectTypes.SIGNATURE_OBJECT: SignatureObject,
XMRObjectTypes.SETTINGS_OBJECT: RightsSettingsObject,
XMRObjectTypes.EXPIRATION_OBJECT: ExpirationRestrictionObject,
XMRObjectTypes.ISSUEDATE_OBJECT: IssueDateObject,
XMRObjectTypes.METERING_OBJECT: MeteringRestrictionObject,
XMRObjectTypes.GRACE_PERIOD_OBJECT: GracePeriodObject,
XMRObjectTypes.SOURCEID_OBJECT: SourceIdObject,
XMRObjectTypes.ECC_DEVICE_KEY_OBJECT: ECCKeyObject,
XMRObjectTypes.DOMAIN_ID_OBJECT: DomainRestrictionObject,
XMRObjectTypes.POLICY_METADATA_OBJECT: PolicyMetadataObject,
XMRObjectTypes.EXPIRATION_AFTER_FIRSTPLAY_OBJECT: ExpirationAfterFirstPlayRestrictionObject,
XMRObjectTypes.DIGITAL_AUDIO_OUTPUT_CONFIGURATION_OBJECT: DigitalAudioOutputRestrictionObject,
XMRObjectTypes.REVOCATION_INFORMATION_VERSION_2_OBJECT: RevInfoVersionObject,
XMRObjectTypes.EMBEDDING_BEHAVIOR_OBJECT: EmbeddedLicenseSettingsObject,
XMRObjectTypes.SECURITY_LEVEL: SecurityLevelObject,
XMRObjectTypes.MOVE_ENABLER_OBJECT: MoveObject,
XMRObjectTypes.PLAY_ENABLER_OBJECT: PlayEnablerType,
XMRObjectTypes.COPY_ENABLER_OBJECT: CopyEnablerObject,
XMRObjectTypes.UPLINK_KID_2_OBJECT: UplinkKIDObject,
XMRObjectTypes.COPYCOUNT_2_OBJECT: CopyCountRestrictionObject,
XMRObjectTypes.REMOVAL_DATE_OBJECT: RemovalDateObject,
XMRObjectTypes.AUX_KEY_OBJECT: AuxiliaryKeysObject,
XMRObjectTypes.UPLINKX_OBJECT: UplinkKeyObject3,
XMRObjectTypes.DIGITAL_VIDEO_OPL: DigitalVideoOutputRestrictionObject,
XMRObjectTypes.SECURESTOP: SecureStopRestrictionObject,
},
default=LazyBound(lambda ctx: _XMRLicenseStructs.XmrObject)
)
@ -227,9 +324,6 @@ class XMRLicense(_XMRLicenseStructs):
def dumps(self) -> bytes:
return self._license_obj.build(self.parsed)
def struct(self) -> _XMRLicenseStructs.XmrLicense:
return self._license_obj
def _locate(self, container: Container):
if container.flags == 2 or container.flags == 3:
return self._locate(container.data)
@ -243,12 +337,12 @@ class XMRLicense(_XMRLicenseStructs):
yield container.data
def get_content_keys(self):
yield from self.get_object(10)
yield from self.get_object(XMRObjectTypes.CONTENT_KEY_OBJECT)
def check_signature(self, integrity_key: bytes) -> bool:
cmac = CMAC.new(integrity_key, ciphermod=AES)
signature_data = next(self.get_object(11))
signature_data = next(self.get_object(XMRObjectTypes.SIGNATURE_OBJECT))
cmac.update(self.dumps()[:-(signature_data.signature_data_length + 12)])
return signature_data.signature_data == cmac.digest()

View File

@ -7,7 +7,7 @@ import click
import requests
from Crypto.Random import get_random_bytes
from pyplayready import __version__, InvalidCertificateChain
from pyplayready import __version__, InvalidCertificateChain, InvalidLicense
from pyplayready.system.bcert import CertificateChain, Certificate
from pyplayready.cdm import Cdm
from pyplayready.device import Device
@ -28,7 +28,7 @@ def main(version: bool, debug: bool) -> None:
copyright_years = f"2024-{current_year}"
log.info("pyplayready version %s Copyright (c) %s DevLARLEY, Erevoc, DevataDev", __version__, copyright_years)
log.info("https://github.com/ready-dl/pyplayready")
log.info("https://git.gay/ready-dl/pyplayready")
log.info("Run 'pyplayready --help' for help")
if version:
return
@ -56,11 +56,11 @@ def license_(device_path: Path, pssh: PSSH, server: str) -> None:
session_id = cdm.open()
log.info("Opened Session")
challenge = cdm.get_license_challenge(session_id, pssh.get_wrm_headers()[0])
challenge = cdm.get_license_challenge(session_id, pssh.wrm_headers[0])
log.info("Created License Request (Challenge)")
log.debug(challenge)
license_res = requests.post(
license_response = requests.post(
url=server,
headers={
'Content-Type': 'text/xml; charset=UTF-8',
@ -68,15 +68,15 @@ def license_(device_path: Path, pssh: PSSH, server: str) -> None:
data=challenge
)
if license_res.status_code != 200:
log.error(f"Failed to send challenge [{license_res.status_code}]: {license_res.text}")
return
licence = license_res.text
log.info("Got License Message")
licence = license_response.text
log.debug(licence)
try:
cdm.parse_license(session_id, licence)
except InvalidLicense as e:
log.error(e)
return
log.info("License Parsed Successfully")
for key in cdm.get_keys(session_id):
@ -89,7 +89,7 @@ def license_(device_path: Path, pssh: PSSH, server: str) -> None:
@main.command()
@click.argument("device", type=Path)
@click.option("-c", "--ckt", type=click.Choice(["aesctr", "aescbc"], case_sensitive=False), default="aesctr", help="Content Key Encryption Type")
@click.option("-sl", "--security_level", type=click.Choice(["150", "2000", "3000"], case_sensitive=False), default="2000", help="Minimum Security Level")
@click.option("-sl", "--security_level", type=click.Choice(["150", "2000", "3000"]), default="2000", help="Minimum Security Level")
@click.pass_context
def test(ctx: click.Context, device: Path, ckt: str, security_level: str) -> None:
"""
@ -127,12 +127,16 @@ def test(ctx: click.Context, device: Path, ckt: str, security_level: str) -> Non
@main.command()
@click.option("-k", "--group_key", type=Path, required=True, help="Device ECC private group key")
@click.option("-e", "--encryption_key", type=Path, required=False, help="Optional Device ECC private encryption key")
@click.option("-s", "--signing_key", type=Path, required=False, help="Optional Device ECC private signing key")
@click.option("-c", "--group_certificate", type=Path, required=True, help="Device group certificate chain")
@click.option("-o", "--output", type=Path, default=None, help="Output Path or Directory")
@click.pass_context
def create_device(
ctx: click.Context,
group_key: Path,
encryption_key: Optional[Path],
signing_key: Optional[Path],
group_certificate: Path,
output: Optional[Path] = None
) -> None:
@ -144,8 +148,8 @@ def create_device(
log = logging.getLogger("create-device")
encryption_key = ECCKey.generate()
signing_key = ECCKey.generate()
encryption_key = ECCKey.load(encryption_key) if encryption_key else ECCKey.generate()
signing_key = ECCKey.load(signing_key) if signing_key else ECCKey.generate()
group_key = ECCKey.load(group_key)
certificate_chain = CertificateChain.load(group_certificate)
@ -199,9 +203,17 @@ def create_device(
@main.command()
@click.argument("prd_path", type=Path)
@click.option("-e", "--encryption_key", type=Path, required=False, help="Optional Device ECC private encryption key")
@click.option("-s", "--signing_key", type=Path, required=False, help="Optional Device ECC private signing key")
@click.option("-o", "--output", type=Path, default=None, help="Output Path or Directory")
@click.pass_context
def reprovision_device(ctx: click.Context, prd_path: Path, output: Optional[Path] = None) -> None:
def reprovision_device(
ctx: click.Context,
prd_path: Path,
encryption_key: Optional[Path],
signing_key: Optional[Path],
output: Optional[Path] = None
) -> None:
"""
Reprovision a Playready Device (.prd) by creating a new leaf certificate and new encryption/signing keys.
Will override the device if an output path or directory is not specified
@ -221,8 +233,8 @@ def reprovision_device(ctx: click.Context, prd_path: Path, output: Optional[Path
device.group_certificate.remove(0)
encryption_key = ECCKey.generate()
signing_key = ECCKey.generate()
encryption_key = ECCKey.load(encryption_key) if encryption_key else ECCKey.generate()
signing_key = ECCKey.load(signing_key) if signing_key else ECCKey.generate()
device.encryption_key = encryption_key
device.signing_key = signing_key
@ -299,7 +311,7 @@ def export_device(ctx: click.Context, prd_path: Path, out_dir: Optional[Path] =
log.info("Exported Group Certificate to bgroupcert.dat")
@main.command("serve", short_help="Serve your local CDM and Playready Devices Remotely.")
@main.command("serve", short_help="Serve your local CDM and Playready Devices remotely.")
@click.argument("config_path", type=Path)
@click.option("-h", "--host", type=str, default="127.0.0.1", help="Host to serve from.")
@click.option("-p", "--port", type=int, default=7723, help="Port to serve from.")

View File

@ -1,14 +1,17 @@
from __future__ import annotations
import re
import logging
from typing import Union
import requests
from pyplayready import InvalidLicense
from pyplayready.cdm import Cdm
from pyplayready.device import Device
from pyplayready.license.key import Key
from pyplayready.exceptions import (DeviceMismatch, InvalidInitData)
from pyplayready.system.wrmheader import WRMHeader
class RemoteCdm(Cdm):
@ -49,99 +52,101 @@ class RemoteCdm(Cdm):
# spoof certificate_chain and ecc_key just so we can construct via super call
super().__init__(security_level, None, None, None)
self._logger = logging.getLogger()
self.__session = requests.Session()
self.__session.headers.update({
"X-Secret-Key": secret
})
r = requests.head(self.host)
if r.status_code != 200:
raise ValueError(f"Could not test Remote API version [{r.status_code}]")
server = r.headers.get("Server")
if not server or "pyplayready serve" not in server.lower():
raise ValueError(f"This Remote CDM API does not seem to be a pyplayready serve API ({server}).")
server_version_re = re.search(r"pyplayready serve v([\d.]+)", server, re.IGNORECASE)
if not server_version_re:
raise ValueError("The pyplayready server API is not stating the version correctly, cannot continue.")
server_version = server_version_re.group(1)
if server_version < "0.3.1":
raise ValueError(f"This pyplayready serve API version ({server_version}) is not supported.")
response = requests.head(self.host)
if response.status_code != 200:
self._logger.warning(f"Could not test Remote API version [{response.status_code}]")
server = response.headers.get("Server")
if not server or "playready serve" not in server.lower():
self._logger.warning(f"This Remote CDM API does not seem to be a playready serve API ({server}).")
@classmethod
def from_device(cls, device: Device) -> RemoteCdm:
raise NotImplementedError("You cannot load a RemoteCdm from a local Device file.")
def open(self) -> bytes:
r = self.__session.get(
response = self.__session.get(
url=f"{self.host}/{self.device_name}/open"
).json()
)
response_json = response.json()
if r['status'] != 200:
raise ValueError(f"Cannot Open CDM Session, {r['message']} [{r['status']}]")
r = r["data"]
if response.status_code != 200:
raise ValueError(f"Cannot Open CDM Session, {response_json['message']} [{response.status_code}]")
if int(r["device"]["security_level"]) != self.security_level:
if int(response_json["data"]["device"]["security_level"]) != self.security_level:
raise DeviceMismatch("The Security Level specified does not match the one specified in the API response.")
return bytes.fromhex(r["session_id"])
return bytes.fromhex(response_json["data"]["session_id"])
def close(self, session_id: bytes) -> None:
r = self.__session.get(
response = self.__session.get(
url=f"{self.host}/{self.device_name}/close/{session_id.hex()}"
).json()
if r["status"] != 200:
raise ValueError(f"Cannot Close CDM Session, {r['message']} [{r['status']}]")
)
response_json = response.json()
def get_license_challenge(
self,
session_id: bytes,
wrm_header: str,
) -> str:
if response.status_code != 200:
raise ValueError(f"Cannot Close CDM Session, {response_json['message']} [{response.status_code}]")
def get_license_challenge(self, session_id: bytes, wrm_header: Union[WRMHeader, str]) -> str:
if not wrm_header:
raise InvalidInitData("A wrm_header must be provided.")
if isinstance(wrm_header, WRMHeader):
wrm_header = wrm_header.dumps()
if not isinstance(wrm_header, str):
raise InvalidInitData(f"Expected wrm_header to be a {str}, not {wrm_header!r}")
raise ValueError(f"Expected WRMHeader to be a {str} or {WRMHeader} not {wrm_header!r}")
r = self.__session.post(
response = self.__session.post(
url=f"{self.host}/{self.device_name}/get_license_challenge",
json={
"session_id": session_id.hex(),
"init_data": wrm_header,
"init_data": wrm_header
}
).json()
if r["status"] != 200:
raise ValueError(f"Cannot get Challenge, {r['message']} [{r['status']}]")
r = r["data"]
)
response_json = response.json()
return r["challenge"]
if response.status_code != 200:
raise ValueError(f"Cannot get Challenge, {response_json['message']} [{response.status_code}]")
return response_json["data"]["challenge"]
def parse_license(self, session_id: bytes, license_message: str) -> None:
if not license_message:
raise Exception("Cannot parse an empty license_message")
raise InvalidLicense("Cannot parse an empty license_message")
if not isinstance(license_message, str):
raise Exception(f"Expected license_message to be a {str}, not {license_message!r}")
raise InvalidLicense(f"Expected license_message to be a {str}, not {license_message!r}")
r = self.__session.post(
response = self.__session.post(
url=f"{self.host}/{self.device_name}/parse_license",
json={
"session_id": session_id.hex(),
"license_message": license_message
}
).json()
if r["status"] != 200:
raise ValueError(f"Cannot parse License, {r['message']} [{r['status']}]")
)
response_json = response.json()
if response.status_code != 200:
raise ValueError(f"Cannot parse License, {response_json['message']} [{response.status_code}]")
def get_keys(self, session_id: bytes) -> list[Key]:
r = self.__session.post(
response = self.__session.post(
url=f"{self.host}/{self.device_name}/get_keys",
json={
"session_id": session_id.hex()
}
).json()
if r["status"] != 200:
raise ValueError(f"Could not get Keys, {r['message']} [{r['status']}]")
r = r["data"]
)
response_json = response.json()
if response.status_code != 200:
raise ValueError(f"Could not get Keys, {response_json['message']} [{response.status_code}]")
return [
Key(
@ -151,7 +156,7 @@ class RemoteCdm(Cdm):
cipher_type=key["cipher_type"],
key_length=key["key_length"]
)
for key in r["keys"]
for key in response_json["data"]["keys"]
]

View File

@ -34,10 +34,7 @@ async def _cleanup(app: web.Application) -> None:
@routes.get("/")
async def ping(_: Any) -> web.Response:
return web.json_response({
"status": 200,
"message": "Pong!"
})
return web.json_response({"message": "OK"})
@routes.get("/{device}/open")
@ -49,10 +46,7 @@ async def open_(request: web.Request) -> web.Response:
if device_name not in user["devices"] or device_name not in request.app["config"]["devices"]:
# we don't want to be verbose with the error as to not reveal device names
# by trial and error to users that are not authorized to use them
return web.json_response({
"status": 403,
"message": f"Device '{device_name}' is not found or you are not authorized to use it."
}, status=403)
return web.json_response({"message": f"Device '{device_name}' is not found or you are not authorized to use it."}, status=403)
cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name))
if not cdm:
@ -62,13 +56,9 @@ async def open_(request: web.Request) -> web.Response:
try:
session_id = cdm.open()
except TooManySessions as e:
return web.json_response({
"status": 400,
"message": str(e)
}, status=400)
return web.json_response({"message": str(e)}, status=400)
return web.json_response({
"status": 200,
"message": "Success",
"data": {
"session_id": session_id.hex(),
@ -87,23 +77,14 @@ async def close(request: web.Request) -> web.Response:
cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name))
if not cdm:
return web.json_response({
"status": 400,
"message": f"No Cdm session for {device_name} has been opened yet. No session to close."
}, status=400)
return web.json_response({"message": f"No Cdm session for {device_name} has been opened yet. No session to close."}, status=400)
try:
cdm.close(session_id)
except InvalidSession:
return web.json_response({
"status": 400,
"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."
}, status=400)
return web.json_response({"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."}, status=400)
return web.json_response({
"status": 200,
"message": f"Successfully closed Session '{session_id.hex()}'."
})
return web.json_response({"message": f"Successfully closed Session '{session_id.hex()}'."})
@routes.post("/{device}/get_license_challenge")
@ -112,58 +93,36 @@ async def get_license_challenge(request: web.Request) -> web.Response:
device_name = request.match_info["device"]
body = await request.json()
for required_field in ("session_id", "init_data"):
for required_field in ("init_data", "session_id"):
if not body.get(required_field):
return web.json_response({
"status": 400,
"message": f"Missing required field '{required_field}' in JSON body."
}, status=400)
return web.json_response({"message": f"Missing required field '{required_field}' in JSON body."}, status=400)
# get session id
session_id = bytes.fromhex(body["session_id"])
# get cdm
cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name))
if not cdm:
return web.json_response({
"status": 400,
"message": f"No Cdm session for {device_name} has been opened yet. No session to use."
}, status=400)
return web.json_response({"message": f"No Cdm session for {device_name} has been opened yet. No session to use."}, status=400)
# get init data
session_id = bytes.fromhex(body["session_id"])
init_data = body["init_data"]
if not init_data.startswith("<WRMHEADER"):
try:
pssh = PSSH(init_data)
wrm_headers = pssh.get_wrm_headers()
if wrm_headers:
init_data = wrm_headers[0]
if pssh.wrm_headers:
init_data = pssh.wrm_headers[0]
except InvalidPssh as e:
return web.json_response({
"status": 500,
"message": f"Unable to parse base64 PSSH, {e}"
}, status=500)
return web.json_response({"message": f"Unable to parse base64 PSSH, {e}"}, status=500)
# get challenge
try:
license_request = cdm.get_license_challenge(
session_id=session_id,
wrm_header=init_data,
)
except InvalidSession:
return web.json_response({
"status": 400,
"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."
}, status=400)
return web.json_response({"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."}, status=400)
except Exception as e:
return web.json_response({
"status": 500,
"message": f"Error, {e}"
}, status=500)
return web.json_response({"message": f"Error, {e}"}, status=500)
return web.json_response({
"status": 200,
"message": "Success",
"data": {
"challenge": license_request
@ -177,47 +136,27 @@ async def parse_license(request: web.Request) -> web.Response:
device_name = request.match_info["device"]
body = await request.json()
for required_field in ("session_id", "license_message"):
for required_field in ("license_message", "session_id"):
if not body.get(required_field):
return web.json_response({
"status": 400,
"message": f"Missing required field '{required_field}' in JSON body."
}, status=400)
return web.json_response({"message": f"Missing required field '{required_field}' in JSON body."}, status=400)
# get session id
session_id = bytes.fromhex(body["session_id"])
# get cdm
cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name))
if not cdm:
return web.json_response({
"status": 400,
"message": f"No Cdm session for {device_name} has been opened yet. No session to use."
}, status=400)
return web.json_response({"message": f"No Cdm session for {device_name} has been opened yet. No session to use."}, status=400)
session_id = bytes.fromhex(body["session_id"])
license_message = body["license_message"]
# parse the license message
try:
cdm.parse_license(session_id, body["license_message"])
cdm.parse_license(session_id, license_message)
except InvalidSession:
return web.json_response({
"status": 400,
"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."
}, status=400)
return web.json_response({"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."}, status=400)
except InvalidLicense as e:
return web.json_response({
"status": 400,
"message": f"Invalid License, {e}"
}, status=400)
return web.json_response({"message": f"Invalid License, {e}"}, status=400)
except Exception as e:
return web.json_response({
"status": 500,
"message": f"Error, {e}"
}, status=500)
return web.json_response({"message": f"Error, {e}"}, status=500)
return web.json_response({
"status": 200,
"message": "Successfully parsed and loaded the Keys from the License message."
})
return web.json_response({"message": "Successfully parsed and loaded the Keys from the License message."})
@routes.post("/{device}/get_keys")
@ -228,37 +167,21 @@ async def get_keys(request: web.Request) -> web.Response:
body = await request.json()
for required_field in ("session_id",):
if not body.get(required_field):
return web.json_response({
"status": 400,
"message": f"Missing required field '{required_field}' in JSON body."
}, status=400)
return web.json_response({"message": f"Missing required field '{required_field}' in JSON body."}, status=400)
# get session id
session_id = bytes.fromhex(body["session_id"])
# get cdm
cdm = request.app["cdms"].get((secret_key, device_name))
if not cdm:
return web.json_response({
"status": 400,
"message": f"No Cdm session for {device_name} has been opened yet. No session to use."
}, status=400)
return web.json_response({"message": f"No Cdm session for {device_name} has been opened yet. No session to use."}, status=400)
# get keys
try:
keys = cdm.get_keys(session_id)
except InvalidSession:
return web.json_response({
"status": 400,
"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."
}, status=400)
return web.json_response({"message": f"Invalid Session ID '{session_id.hex()}', it may have expired."}, status=400)
except Exception as e:
return web.json_response({
"status": 500,
"message": f"Error, {e}"
}, status=500)
return web.json_response({"message": f"Error, {e}"}, status=500)
# get the keys in json form
keys_json = [
{
"key_id": key.key_id.hex,
@ -271,7 +194,6 @@ async def get_keys(request: web.Request) -> web.Response:
]
return web.json_response({
"status": 200,
"message": "Success",
"data": {
"keys": keys_json
@ -285,28 +207,19 @@ async def authentication(request: web.Request, handler: Handler) -> web.Response
if request.path != "/" and not secret_key:
request.app.logger.debug(f"{request.remote} did not provide authorization.")
response = web.json_response({
"status": "401",
"message": "Secret Key is Empty."
}, status=401)
response = web.json_response({"message": "Secret Key is Empty."}, status=401)
elif request.path != "/" and secret_key not in request.app["config"]["users"]:
request.app.logger.debug(f"{request.remote} failed authentication with '{secret_key}'.")
response = web.json_response({
"status": "401",
"message": "Secret Key is Invalid, the Key is case-sensitive."
}, status=401)
response = web.json_response({"message": "Secret Key is Invalid, the Key is case-sensitive."}, status=401)
else:
try:
response = await handler(request) # type: ignore[assignment]
response = await handler(request)
except web.HTTPException as e:
request.app.logger.error(f"An unexpected error has occurred, {e}")
response = web.json_response({
"status": 500,
"message": e.reason
}, status=500)
response = web.json_response({"message": e.reason}, status=500)
response.headers.update({
"Server": f"https://github.com/ready-dl/pyplayready serve v{__version__}"
"Server": f"https://git.gay/ready-dl/pyplayready serve v{__version__}"
})
return response

View File

@ -1,28 +1,131 @@
from __future__ import annotations
import collections.abc
from Crypto.PublicKey import ECC
from pyplayready.crypto import Crypto
from pyplayready.exceptions import InvalidCertificateChain, InvalidCertificate
# monkey patch for construct 2.8.8 compatibility
if not hasattr(collections, 'Sequence'):
collections.Sequence = collections.abc.Sequence
import base64
from pathlib import Path
from typing import Union
from typing import Union, Optional
from enum import IntEnum
from Crypto.PublicKey import ECC
from construct import Bytes, Const, Int32ub, GreedyRange, Switch, Container, ListContainer
from construct import Int16ub, Array
from construct import Struct, this
from pyplayready.crypto import Crypto
from pyplayready.exceptions import InvalidCertificateChain, InvalidCertificate
from pyplayready.crypto.ecc_key import ECCKey
class BCertCertType(IntEnum):
UNKNOWN = 0x00000000
PC = 0x00000001
DEVICE = 0x00000002
DOMAIN = 0x00000003
ISSUER = 0x00000004
CRL_SIGNER = 0x00000005
SERVICE = 0x00000006
SILVERLIGHT = 0x00000007
APPLICATION = 0x00000008
METERING = 0x00000009
KEYFILESIGNER = 0x0000000a
SERVER = 0x0000000b
LICENSESIGNER = 0x0000000c
SECURETIMESERVER = 0x0000000d
RPROVMODELAUTH = 0x0000000e
class BCertObjType(IntEnum):
BASIC = 0x0001
DOMAIN = 0x0002
PC = 0x0003
DEVICE = 0x0004
FEATURE = 0x0005
KEY = 0x0006
MANUFACTURER = 0x0007
SIGNATURE = 0x0008
SILVERLIGHT = 0x0009
METERING = 0x000A
EXTDATASIGNKEY = 0x000B
EXTDATACONTAINER = 0x000C
EXTDATASIGNATURE = 0x000D
EXTDATA_HWID = 0x000E
SERVER = 0x000F
SECURITY_VERSION = 0x0010
SECURITY_VERSION_2 = 0x0011
UNKNOWN_OBJECT_ID = 0xFFFD
class BCertFlag(IntEnum):
EMPTY = 0x00000000
EXTDATA_PRESENT = 0x00000001
class BCertObjFlag(IntEnum):
EMPTY = 0x0000
MUST_UNDERSTAND = 0x0001
CONTAINER_OBJ = 0x0002
class BCertSignatureType(IntEnum):
P256 = 0x0001
class BCertKeyType(IntEnum):
ECC256 = 0x0001
class BCertKeyUsage(IntEnum):
UNKNOWN = 0x00000000
SIGN = 0x00000001
ENCRYPT_KEY = 0x00000002
SIGN_CRL = 0x00000003
ISSUER_ALL = 0x00000004
ISSUER_INDIV = 0x00000005
ISSUER_DEVICE = 0x00000006
ISSUER_LINK = 0x00000007
ISSUER_DOMAIN = 0x00000008
ISSUER_SILVERLIGHT = 0x00000009
ISSUER_APPLICATION = 0x0000000a
ISSUER_CRL = 0x0000000b
ISSUER_METERING = 0x0000000c
ISSUER_SIGN_KEYFILE = 0x0000000d
SIGN_KEYFILE = 0x0000000e
ISSUER_SERVER = 0x0000000f
ENCRYPTKEY_SAMPLE_PROTECTION_RC4 = 0x00000010
RESERVED2 = 0x00000011
ISSUER_SIGN_LICENSE = 0x00000012
SIGN_LICENSE = 0x00000013
SIGN_RESPONSE = 0x00000014
PRND_ENCRYPT_KEY_DEPRECATED = 0x00000015
ENCRYPTKEY_SAMPLE_PROTECTION_AES128CTR = 0x00000016
ISSUER_SECURETIMESERVER = 0x00000017
ISSUER_RPROVMODELAUTH = 0x00000018
class BCertFeatures(IntEnum):
TRANSMITTER = 0x00000001
RECEIVER = 0x00000002
SHARED_CERTIFICATE = 0x00000003
SECURE_CLOCK = 0x00000004
ANTIROLLBACK_CLOCK = 0x00000005
RESERVED_METERING = 0x00000006
RESERVED_LICSYNC = 0x00000007
RESERVED_SYMOPT = 0x00000008
SUPPORTS_CRLS = 0x00000009
SERVER_BASIC_EDITION = 0x0000000A
SERVER_STANDARD_EDITION = 0x0000000B
SERVER_PREMIUM_EDITION = 0x0000000C
SUPPORTS_PR3_FEATURES = 0x0000000D
DEPRECATED_SECURE_STOP = 0x0000000E
class _BCertStructs:
DrmBCertBasicInfo = Struct(
BasicInfo = Struct(
"cert_id" / Bytes(16),
"security_level" / Int32ub,
"flags" / Int32ub,
@ -33,7 +136,7 @@ class _BCertStructs:
)
# TODO: untested
DrmBCertDomainInfo = Struct(
DomainInfo = Struct(
"service_id" / Bytes(16),
"account_id" / Bytes(16),
"revision_timestamp" / Int32ub,
@ -42,23 +145,22 @@ class _BCertStructs:
)
# TODO: untested
DrmBCertPCInfo = Struct(
PCInfo = Struct(
"security_version" / Int32ub
)
# TODO: untested
DrmBCertDeviceInfo = Struct(
DeviceInfo = Struct(
"max_license" / Int32ub,
"max_header" / Int32ub,
"max_chain_depth" / Int32ub
)
DrmBCertFeatureInfo = Struct(
FeatureInfo = Struct(
"feature_count" / Int32ub, # max. 32
"features" / Array(this.feature_count, Int32ub)
)
DrmBCertKeyInfo = Struct(
KeyInfo = Struct(
"key_count" / Int32ub,
"cert_keys" / Array(this.key_count, Struct(
"type" / Int16ub,
@ -70,7 +172,7 @@ class _BCertStructs:
))
)
DrmBCertManufacturerInfo = Struct(
ManufacturerInfo = Struct(
"flags" / Int32ub,
"manufacturer_name_length" / Int32ub,
"manufacturer_name" / Bytes((this.manufacturer_name_length + 3) & 0xfffffffc),
@ -80,7 +182,7 @@ class _BCertStructs:
"model_number" / Bytes((this.model_number_length + 3) & 0xfffffffc),
)
DrmBCertSignatureInfo = Struct(
SignatureInfo = Struct(
"signature_type" / Int16ub,
"signature_size" / Int16ub,
"signature" / Bytes(this.signature_size),
@ -89,20 +191,19 @@ class _BCertStructs:
)
# TODO: untested
DrmBCertSilverlightInfo = Struct(
SilverlightInfo = Struct(
"security_version" / Int32ub,
"platform_identifier" / Int32ub
)
# TODO: untested
DrmBCertMeteringInfo = Struct(
MeteringInfo = Struct(
"metering_id" / Bytes(16),
"metering_url_length" / Int32ub,
"metering_url" / Bytes((this.metering_url_length + 3) & 0xfffffffc)
)
# TODO: untested
DrmBCertExtDataSignKeyInfo = Struct(
ExtDataSignKeyInfo = Struct(
"key_type" / Int16ub,
"key_length" / Int16ub,
"flags" / Int32ub,
@ -110,32 +211,30 @@ class _BCertStructs:
)
# TODO: untested
BCertExtDataRecord = Struct(
DataRecord = Struct(
"data_size" / Int32ub,
"data" / Bytes(this.data_size)
)
# TODO: untested
DrmBCertExtDataSignature = Struct(
ExtDataSignature = Struct(
"signature_type" / Int16ub,
"signature_size" / Int16ub,
"signature" / Bytes(this.signature_size)
)
# TODO: untested
BCertExtDataContainer = Struct(
ExtDataContainer = Struct(
"record_count" / Int32ub, # always 1
"records" / Array(this.record_count, BCertExtDataRecord),
"signature" / DrmBCertExtDataSignature
"records" / Array(this.record_count, DataRecord),
"signature" / ExtDataSignature
)
# TODO: untested
DrmBCertServerInfo = Struct(
ServerInfo = Struct(
"warning_days" / Int32ub
)
# TODO: untested
DrmBcertSecurityVersion = Struct(
SecurityVersion = Struct(
"security_version" / Int32ub,
"platform_identifier" / Int32ub
)
@ -147,23 +246,23 @@ class _BCertStructs:
"attribute" / Switch(
lambda this_: this_.tag,
{
1: DrmBCertBasicInfo,
2: DrmBCertDomainInfo,
3: DrmBCertPCInfo,
4: DrmBCertDeviceInfo,
5: DrmBCertFeatureInfo,
6: DrmBCertKeyInfo,
7: DrmBCertManufacturerInfo,
8: DrmBCertSignatureInfo,
9: DrmBCertSilverlightInfo,
10: DrmBCertMeteringInfo,
11: DrmBCertExtDataSignKeyInfo,
12: BCertExtDataContainer,
13: DrmBCertExtDataSignature,
14: Bytes(this.length - 8),
15: DrmBCertServerInfo,
16: DrmBcertSecurityVersion,
17: DrmBcertSecurityVersion
BCertObjType.BASIC: BasicInfo,
BCertObjType.DOMAIN: DomainInfo,
BCertObjType.PC: PCInfo,
BCertObjType.DEVICE: DeviceInfo,
BCertObjType.FEATURE: FeatureInfo,
BCertObjType.KEY: KeyInfo,
BCertObjType.MANUFACTURER: ManufacturerInfo,
BCertObjType.SIGNATURE: SignatureInfo,
BCertObjType.SILVERLIGHT: SilverlightInfo,
BCertObjType.METERING: MeteringInfo,
BCertObjType.EXTDATASIGNKEY: ExtDataSignKeyInfo,
BCertObjType.EXTDATACONTAINER: ExtDataContainer,
BCertObjType.EXTDATASIGNATURE: ExtDataSignature,
BCertObjType.EXTDATA_HWID: Bytes(this.length - 8),
BCertObjType.SERVER: ServerInfo,
BCertObjType.SECURITY_VERSION: SecurityVersion,
BCertObjType.SECURITY_VERSION_2: SecurityVersion
},
default=Bytes(this.length - 8)
)
@ -213,16 +312,16 @@ class Certificate(_BCertStructs):
basic_info = Container(
cert_id=cert_id,
security_level=security_level,
flags=0,
cert_type=2,
flags=BCertFlag.EMPTY,
cert_type=BCertCertType.DEVICE,
public_key_digest=signing_key.public_sha256_digest(),
expiration_date=expiry,
client_id=client_id
)
basic_info_attribute = Container(
flags=1,
tag=1,
length=len(_BCertStructs.DrmBCertBasicInfo.build(basic_info)) + 8,
flags=BCertObjFlag.MUST_UNDERSTAND,
tag=BCertObjType.BASIC,
length=len(_BCertStructs.BasicInfo.build(basic_info)) + 8,
attribute=basic_info
)
@ -232,58 +331,51 @@ class Certificate(_BCertStructs):
max_chain_depth=2
)
device_info_attribute = Container(
flags=1,
tag=4,
length=len(_BCertStructs.DrmBCertDeviceInfo.build(device_info)) + 8,
flags=BCertObjFlag.MUST_UNDERSTAND,
tag=BCertObjType.DEVICE,
length=len(_BCertStructs.DeviceInfo.build(device_info)) + 8,
attribute=device_info
)
feature = Container(
feature_count=3,
features=ListContainer([
# 1, # Transmitter
# 2, # Receiver
# 3, # SharedCertificate
4, # SecureClock
# 5, # AntiRollBackClock
# 6, # ReservedMetering
# 7, # ReservedLicSync
# 8, # ReservedSymOpt
9, # CRLS (Revocation Lists)
# 10, # ServerBasicEdition
# 11, # ServerStandardEdition
# 12, # ServerPremiumEdition
13, # PlayReady3Features
# 14, # DeprecatedSecureStop
BCertFeatures.SECURE_CLOCK,
BCertFeatures.SUPPORTS_CRLS,
BCertFeatures.SUPPORTS_PR3_FEATURES
])
)
feature_attribute = Container(
flags=1,
tag=5,
length=len(_BCertStructs.DrmBCertFeatureInfo.build(feature)) + 8,
flags=BCertObjFlag.MUST_UNDERSTAND,
tag=BCertObjType.FEATURE,
length=len(_BCertStructs.FeatureInfo.build(feature)) + 8,
attribute=feature
)
signing_key_public_bytes = signing_key.public_bytes()
cert_key_sign = Container(
type=1,
length=512, # bits
flags=0,
key=signing_key.public_bytes(),
type=BCertKeyType.ECC256,
length=len(signing_key_public_bytes) * 8, # bits
flags=BCertFlag.EMPTY,
key=signing_key_public_bytes,
usages_count=1,
usages=ListContainer([
1 # KEYUSAGE_SIGN
BCertKeyUsage.SIGN
])
)
encryption_key_public_bytes = encryption_key.public_bytes()
cert_key_encrypt = Container(
type=1,
length=512, # bits
flags=0,
key=encryption_key.public_bytes(),
type=BCertKeyType.ECC256,
length=len(encryption_key_public_bytes) * 8, # bits
flags=BCertFlag.EMPTY,
key=encryption_key_public_bytes,
usages_count=1,
usages=ListContainer([
2 # KEYUSAGE_ENCRYPT_KEY
BCertKeyUsage.ENCRYPT_KEY
])
)
key_info = Container(
key_count=2,
cert_keys=ListContainer([
@ -292,13 +384,13 @@ class Certificate(_BCertStructs):
])
)
key_info_attribute = Container(
flags=1,
tag=6,
length=len(_BCertStructs.DrmBCertKeyInfo.build(key_info)) + 8,
flags=BCertObjFlag.MUST_UNDERSTAND,
tag=BCertObjType.KEY,
length=len(_BCertStructs.KeyInfo.build(key_info)) + 8,
attribute=key_info
)
manufacturer_info = parent.get(0).get_attribute(7)
manufacturer_info = parent.get(0).get_attribute(BCertObjType.MANUFACTURER)
new_bcert_container = Container(
signature=b"CERT",
@ -321,17 +413,19 @@ class Certificate(_BCertStructs):
sign_payload = _BCertStructs.BCert.build(new_bcert_container)
signature = Crypto.ecc256_sign(group_key, sign_payload)
group_key_public_bytes = group_key.public_bytes()
signature_info = Container(
signature_type=1,
signature_size=64,
signature_type=BCertSignatureType.P256,
signature_size=len(signature),
signature=signature,
signature_key_size=512, # bits
signature_key=group_key.public_bytes()
signature_key_size=len(group_key_public_bytes) * 8, # bits
signature_key=group_key_public_bytes
)
signature_info_attribute = Container(
flags=1,
tag=8,
length=len(_BCertStructs.DrmBCertSignatureInfo.build(signature_info)) + 8,
flags=BCertObjFlag.MUST_UNDERSTAND,
tag=BCertObjType.SIGNATURE,
length=len(_BCertStructs.SignatureInfo.build(signature_info)) + 8,
attribute=signature_info
)
new_bcert_container.attributes.append(signature_info_attribute)
@ -357,7 +451,7 @@ class Certificate(_BCertStructs):
return attribute
def get_security_level(self) -> int:
basic_info_attribute = self.get_attribute(1).attribute
basic_info_attribute = self.get_attribute(BCertObjType.BASIC).attribute
if basic_info_attribute:
return basic_info_attribute.security_level
@ -366,12 +460,12 @@ class Certificate(_BCertStructs):
return name.rstrip(b'\x00').decode("utf-8", errors="ignore")
def get_name(self):
manufacturer_info = self.get_attribute(7).attribute
manufacturer_info = self.get_attribute(BCertObjType.MANUFACTURER).attribute
if manufacturer_info:
return f"{self._unpad(manufacturer_info.manufacturer_name)} {self._unpad(manufacturer_info.model_name)} {self._unpad(manufacturer_info.model_number)}"
def get_issuer_key(self) -> Union[bytes, None]:
key_info_object = self.get_attribute(6)
def get_issuer_key(self) -> Optional[bytes]:
key_info_object = self.get_attribute(BCertObjType.KEY)
if not key_info_object:
return
@ -381,11 +475,8 @@ class Certificate(_BCertStructs):
def dumps(self) -> bytes:
return self._BCERT.build(self.parsed)
def struct(self) -> _BCertStructs.BCert:
return self._BCERT
def verify(self, public_key: bytes, index: int):
signature_object = self.get_attribute(8)
signature_object = self.get_attribute(BCertObjType.SIGNATURE)
if not signature_object:
raise InvalidCertificate(f"No signature object found in certificate {index}")
@ -449,9 +540,6 @@ class CertificateChain(_BCertStructs):
def dumps(self) -> bytes:
return self._BCERT_CHAIN.build(self.parsed)
def struct(self) -> _BCertStructs.BCertChain:
return self._BCERT_CHAIN
def get_security_level(self) -> int:
# not sure if there's a better way than this
return self.get(0).get_security_level()

View File

@ -2,7 +2,8 @@ import base64
from typing import Union, List
from uuid import UUID
from construct import Struct, Int32ul, Int16ul, Array, this, Bytes, Switch, Int32ub, Const, Container, ConstructError
from construct import Struct, Int32ul, Int16ul, this, Bytes, Switch, Int8ub, Int24ub, Int32ub, Const, Container, \
ConstructError, Rebuild, Default, If, PrefixedArray, Prefixed, GreedyBytes
from pyplayready.exceptions import InvalidPssh
from pyplayready.system.wrmheader import WRMHeader
@ -12,10 +13,11 @@ class _PlayreadyPSSHStructs:
PSSHBox = Struct(
"length" / Int32ub,
"pssh" / Const(b"pssh"),
"fullbox" / Int32ub,
"version" / Rebuild(Int8ub, lambda ctx: 1 if (hasattr(ctx, "key_ids") and ctx.key_ids) else 0),
"flags" / Const(Int24ub, 0),
"system_id" / Bytes(16),
"data_length" / Int32ub,
"data" / Bytes(this.data_length)
"key_ids" / Default(If(this.version == 1, PrefixedArray(Int32ub, Bytes(16))), None),
"data" / Prefixed(Int32ub, GreedyBytes)
)
PlayreadyObject = Struct(
@ -32,8 +34,7 @@ class _PlayreadyPSSHStructs:
PlayreadyHeader = Struct(
"length" / Int32ul,
"record_count" / Int16ul,
"records" / Array(this.record_count, PlayreadyObject)
"records" / PrefixedArray(Int16ul, PlayreadyObject)
)
@ -58,6 +59,9 @@ class PSSH(_PlayreadyPSSHStructs):
try:
# PSSH Box -> PlayReady Header
box = self.PSSHBox.parse(data)
if self._is_utf_16_le(box.data):
self.wrm_headers = [WRMHeader(box.data)]
else:
prh = self.PlayreadyHeader.parse(box.data)
self.wrm_headers = self._read_playready_objects(prh)
except ConstructError:
@ -76,6 +80,23 @@ class PSSH(_PlayreadyPSSHStructs):
except ConstructError:
raise InvalidPssh("Could not parse data as a PSSH Box nor a PlayReady Object")
@staticmethod
def _is_utf_16_le(data: bytes) -> bool:
if len(data) % 2 != 0:
return False
try:
decoded = data.decode('utf-16-le')
except UnicodeDecodeError:
return False
for char in decoded:
if not (0x20 <= ord(char) <= 0x7E):
return False
return True
@staticmethod
def _read_playready_objects(header: Container) -> List[WRMHeader]:
return list(map(
@ -85,12 +106,3 @@ class PSSH(_PlayreadyPSSHStructs):
header.records
)
))
def get_wrm_headers(self) -> List[str]:
"""
Return a list of all WRM Headers in the PSSH as plaintext strings
"""
return list(map(
lambda wrm_header: wrm_header.dumps(),
self.wrm_headers
))

View File

@ -1,3 +1,5 @@
from typing import Optional
from Crypto.Random import get_random_bytes
from pyplayready.license.key import Key
@ -10,8 +12,8 @@ class Session:
self.number = number
self.id = get_random_bytes(16)
self.xml_key = XmlKey()
self.signing_key: ECCKey = None
self.encryption_key: ECCKey = None
self.signing_key: Optional[ECCKey] = None
self.encryption_key: Optional[ECCKey] = None
self.keys: list[Key] = []

View File

@ -1,5 +1,4 @@
import base64
import binascii
from enum import Enum
from typing import Optional, List, Union, Tuple
@ -34,7 +33,7 @@ class WRMHeader:
def _missing_(cls, value):
return cls.UNKNOWN
_RETURN_STRUCTURE = Tuple[List[SignedKeyID], Union[str, None], Union[str, None], Union[str, None]]
_RETURN_STRUCTURE = Tuple[List[SignedKeyID], Optional[str], Optional[str], Optional[str]]
def __init__(self, data: Union[str, bytes]):
"""Load a WRM Header from either a string, base64 encoded data or bytes"""
@ -45,8 +44,8 @@ class WRMHeader:
if isinstance(data, str):
try:
data = base64.b64decode(data).decode()
except (binascii.Error, binascii.Incomplete):
data = data.encode()
except Exception:
data = data.encode("utf-16-le")
self._raw_data: bytes = data
self._parsed = xmltodict.parse(self._raw_data)
@ -92,12 +91,7 @@ class WRMHeader:
checksum=kid.get("@CHECKSUM")
)]
return (
key_ids,
data.get("LA_URL"),
data.get("LUI_URL"),
data.get("DS_ID")
)
return key_ids, data.get("LA_URL"), data.get("LUI_URL"), data.get("DS_ID")
@staticmethod
def _read_v4_2_0_0(data: dict) -> _RETURN_STRUCTURE:
@ -114,12 +108,7 @@ class WRMHeader:
checksum=kid.get("@CHECKSUM")
))
return (
key_ids,
data.get("LA_URL"),
data.get("LUI_URL"),
data.get("DS_ID")
)
return key_ids, data.get("LA_URL"), data.get("LUI_URL"), data.get("DS_ID")
@staticmethod
def _read_v4_3_0_0(data: dict) -> _RETURN_STRUCTURE:
@ -135,19 +124,10 @@ class WRMHeader:
checksum=kid.get("@CHECKSUM")
))
return (
key_ids,
data.get("LA_URL"),
data.get("LUI_URL"),
data.get("DS_ID")
)
return key_ids, data.get("LA_URL"), data.get("LUI_URL"), data.get("DS_ID")
def read_attributes(self) -> _RETURN_STRUCTURE:
"""
Read any non-custom XML attributes
Returns a tuple structured like this: Tuple[List[SignedKeyID], <LA_URL>, <LUI_URL>, <DS_ID>]
"""
"""Read any non-custom XML attributes"""
data = self._header.get("DATA")
if not data:
raise ValueError("Not a valid PlayReady Header Record, WRMHEADER/DATA required")

View File

@ -4,12 +4,12 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "pyplayready"
version = "0.5.0"
version = "0.6.0"
description = "pyplayready CDM (Content Decryption Module) implementation in Python."
license = "CC BY-NC-ND 4.0"
authors = ["DevLARLEY, Erevoc", "DevataDev"]
readme = "README.md"
repository = "https://github.com/ready-dl/pyplayready"
repository = "https://git.gay/ready-dl/pyplayready"
keywords = ["python", "drm", "playready", "microsoft"]
classifiers = [
"Development Status :: 5 - Production/Stable",
@ -27,13 +27,13 @@ include = [
]
[tool.poetry.urls]
"Issues" = "https://github.com/ready-dl/pyplayready/issues"
"Issues" = "https://git.gay/ready-dl/pyplayready/issues"
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
requests = "^2.32.3"
pycryptodome = "^3.21.0"
construct = "^2.8.8"
construct = "2.8.8"
ECPy = "^1.2.5"
click = "^8.1.7"
xmltodict = "^0.14.2"

View File

@ -0,0 +1,8 @@
requests
pycryptodome
ecpy
construct==2.8.8
click
PyYAML
aiohttp
xmltodict

View File

@ -0,0 +1,15 @@
# This data serves as an example configuration file for the `serve` command.
# None of the sensitive data should be re-used.
# List of Playready Device (.prd) file paths to use with serve.
# Note: Each individual user needs explicit permission to use a device listed.
devices:
- 'C:\Users\ready-dl\Documents\PRDs\test_device_001.prd'
# List of User's by Secret Key. The Secret Key must be supplied by the User to use the API.
users:
fx206W0FaB2O34HzGsgb8rcDe9e3ijsf: # secret key, a-zA-Z-09{32} is recommended, case-sensitive
username: chloe # only for internal logging, user will not see this name
devices: # list of allowed devices by filename
- test_device_001
# ...

135
scripts/subby/.gitignore vendored Normal file
View File

@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
stubs/
mypy.ini
# Pyre type checker
.pyre/
# Ruff
.ruff_cache/
.ruff.toml

2
scripts/subby/.pylintrc Normal file
View File

@ -0,0 +1,2 @@
[FORMAT]
max-line-length=120

674
scripts/subby/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

137
scripts/subby/README.md Normal file
View File

@ -0,0 +1,137 @@
# Subby
Advanced subtitle converter and processor.
# Supported formats
WebVTT, DFXP/TTML/TTML2/SMPTE, SAMI, WVTT (WebVTT in MP4), STPP/ISMT (DFXP in MP4), JSON (Bilibili)
# Functionality
- converts supported input format to SRT
- retains select formatting tags (italics, basic \an8 positioning)
- corrects often found flaws in subtitles
- opinionated timing and formatting improvements
# Installation
```
git clone https://github.com/vevv/subby
cd subby
pip install .
```
# Usage notes
`CommonIssuesFixer` should be ran both after conversion and SDH stripping
as it's designed to fix source issues, including ones which can cause playback problems.
`CommonIssuesFixer` removes short gaps (2 frames) by default.
This can be disabled by setting `CommonIssuesFixer.remove_gaps` to `False` before running.
`subby.SubRipFile` accepts similar methods to `pysrt.SubRipFile`, but isn't a fully compatible replacement.
Only `from_string`, `clean_indexes`, `export`, `save` are guaranteed to work.
This object is otherwise just a list storing `srt.Subtitle` elements.
## Language specific fixing
As of 0.3.6, both `CommonIssuesFixer` and `SDHStripper` support a language parameter,
which accepts a BCP47 language code.
This is currently used only for RTL tagging in CommonIssuesFixer.
**It is highly recommended for every script to pass it for future use.**
# Command line usage
```
Usage: subby [OPTIONS] COMMAND [ARGS]...
Subby—Advanced Subtitle Converter and Processor.
Options:
-d, --debug Enable DEBUG level logs.
--help Show this message and exit.
Commands:
convert Convert a Subtitle to SubRip (SRT).
process SubRip (SRT) post-processing.
version Print version information.
```
Example
```
subby process /path/to/subs/subs.srt strip-sdh
```
# Library usage
## Converter
```py
from subby import WebVTTConverter
from pathlib import Path
converter = WebVTTConverter()
file = Path('test.vtt')
# All statements below are equivalent
srt = converter.from_file(file)
srt = converter.from_string(file.read_text())
srt = converter.from_bytes(file.read_bytes())
# srt is subby.SubRipFile
output = Path('file.srt')
srt.save(output)
# saved to file.srt
```
## Processor
Processor returns a bool indicating success - whether any changes were made, useful for determining if SDH subtitles should be saved.
```py
from subby import CommonIssuesFixer
from pathlib import Path
processor = CommonIssuesFixer()
file = Path('test.vtt')
# All statements below are equivalent
srt, status = processor.from_file(file)
srt, status = processor.from_string(file.read_text())
srt, status = processor.from_bytes(file.read_bytes())
# srt is subby.SubRipFile, status is bool
output = Path('test_fixed.srt')
srt.save(output)
# saved to test_fixed.srt
```
## Chaining
The following example will convert a VTT file, attempt to strip SDH, and then save the result.
```py
from subby import WebVTTConverter, CommonIssuesFixer, SDHStripper
from pathlib import Path
converter = WebVTTConverter()
fixer = CommonIssuesFixer()
stripper = SDHStripper()
file = Path('file.vtt')
file_sdh = Path('file_sdh.srt')
file_stripped = Path('file_stripped.srt')
srt, _ = fixer.from_srt(converter.from_file(file))
srt.save(file_sdh)
# saved to file_sdh.srt
stripped, status = stripper.from_srt(srt)
if status is True:
print('stripping successful')
stripped.save(file_stripped)
# saved to file_stripped.srt
```
## Tests
To run tests, go to the "tests" directory and run `pytest`.
## Contributors
<a href="https://github.com/vevv"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/68520787?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt=""/></a>
<a href="https://github.com/rlaphoenix"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/17136956?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt=""/></a>

551
scripts/subby/poetry.lock generated Normal file
View File

@ -0,0 +1,551 @@
# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
[[package]]
name = "beautifulsoup4"
version = "4.13.3"
description = "Screen-scraping library"
optional = false
python-versions = ">=3.7.0"
files = [
{file = "beautifulsoup4-4.13.3-py3-none-any.whl", hash = "sha256:99045d7d3f08f91f0d656bc9b7efbae189426cd913d830294a15eefa0ea4df16"},
{file = "beautifulsoup4-4.13.3.tar.gz", hash = "sha256:1bd32405dacc920b42b83ba01644747ed77456a65760e285fbc47633ceddaf8b"},
]
[package.dependencies]
soupsieve = ">1.2"
typing-extensions = ">=4.0.0"
[package.extras]
cchardet = ["cchardet"]
chardet = ["chardet"]
charset-normalizer = ["charset-normalizer"]
html5lib = ["html5lib"]
lxml = ["lxml"]
[[package]]
name = "click"
version = "8.1.8"
description = "Composable command line interface toolkit"
optional = false
python-versions = ">=3.7"
files = [
{file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"},
{file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"},
]
[package.dependencies]
colorama = {version = "*", markers = "platform_system == \"Windows\""}
[[package]]
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "construct"
version = "2.8.8"
description = "A powerful declarative parser/builder for binary data"
optional = false
python-versions = "*"
files = [
{file = "construct-2.8.8.tar.gz", hash = "sha256:1b84b8147f6fd15bcf64b737c3e8ac5100811ad80c830cb4b2545140511c4157"},
]
[[package]]
name = "exceptiongroup"
version = "1.2.2"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
{file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
{file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
]
[package.extras]
test = ["pytest (>=6)"]
[[package]]
name = "iniconfig"
version = "2.0.0"
description = "brain-dead simple config-ini parsing"
optional = false
python-versions = ">=3.7"
files = [
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
[[package]]
name = "langcodes"
version = "3.4.1"
description = "Tools for labeling human languages with IETF language tags"
optional = false
python-versions = ">=3.8"
files = [
{file = "langcodes-3.4.1-py3-none-any.whl", hash = "sha256:68f686fc3d358f222674ecf697ddcee3ace3c2fe325083ecad2543fd28a20e77"},
{file = "langcodes-3.4.1.tar.gz", hash = "sha256:a24879fed238013ac3af2424b9d1124e38b4a38b2044fd297c8ff38e5912e718"},
]
[package.dependencies]
language-data = ">=1.2"
[package.extras]
build = ["build", "twine"]
test = ["pytest", "pytest-cov"]
[[package]]
name = "language-data"
version = "1.3.0"
description = "Supplementary data about languages used by the langcodes module"
optional = false
python-versions = "*"
files = [
{file = "language_data-1.3.0-py3-none-any.whl", hash = "sha256:e2ee943551b5ae5f89cd0e801d1fc3835bb0ef5b7e9c3a4e8e17b2b214548fbf"},
{file = "language_data-1.3.0.tar.gz", hash = "sha256:7600ef8aa39555145d06c89f0c324bf7dab834ea0b0a439d8243762e3ebad7ec"},
]
[package.dependencies]
marisa-trie = ">=1.1.0"
[package.extras]
build = ["build", "twine"]
test = ["pytest", "pytest-cov"]
[[package]]
name = "lxml"
version = "5.3.1"
description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
optional = false
python-versions = ">=3.6"
files = [
{file = "lxml-5.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a4058f16cee694577f7e4dd410263cd0ef75644b43802a689c2b3c2a7e69453b"},
{file = "lxml-5.3.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:364de8f57d6eda0c16dcfb999af902da31396949efa0e583e12675d09709881b"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:528f3a0498a8edc69af0559bdcf8a9f5a8bf7c00051a6ef3141fdcf27017bbf5"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db4743e30d6f5f92b6d2b7c86b3ad250e0bad8dee4b7ad8a0c44bfb276af89a3"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:17b5d7f8acf809465086d498d62a981fa6a56d2718135bb0e4aa48c502055f5c"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:928e75a7200a4c09e6efc7482a1337919cc61fe1ba289f297827a5b76d8969c2"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a997b784a639e05b9d4053ef3b20c7e447ea80814a762f25b8ed5a89d261eac"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:7b82e67c5feb682dbb559c3e6b78355f234943053af61606af126df2183b9ef9"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_28_ppc64le.whl", hash = "sha256:f1de541a9893cf8a1b1db9bf0bf670a2decab42e3e82233d36a74eda7822b4c9"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_28_s390x.whl", hash = "sha256:de1fc314c3ad6bc2f6bd5b5a5b9357b8c6896333d27fdbb7049aea8bd5af2d79"},
{file = "lxml-5.3.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:7c0536bd9178f754b277a3e53f90f9c9454a3bd108b1531ffff720e082d824f2"},
{file = "lxml-5.3.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:68018c4c67d7e89951a91fbd371e2e34cd8cfc71f0bb43b5332db38497025d51"},
{file = "lxml-5.3.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:aa826340a609d0c954ba52fd831f0fba2a4165659ab0ee1a15e4aac21f302406"},
{file = "lxml-5.3.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:796520afa499732191e39fc95b56a3b07f95256f2d22b1c26e217fb69a9db5b5"},
{file = "lxml-5.3.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3effe081b3135237da6e4c4530ff2a868d3f80be0bda027e118a5971285d42d0"},
{file = "lxml-5.3.1-cp310-cp310-win32.whl", hash = "sha256:a22f66270bd6d0804b02cd49dae2b33d4341015545d17f8426f2c4e22f557a23"},
{file = "lxml-5.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:0bcfadea3cdc68e678d2b20cb16a16716887dd00a881e16f7d806c2138b8ff0c"},
{file = "lxml-5.3.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e220f7b3e8656ab063d2eb0cd536fafef396829cafe04cb314e734f87649058f"},
{file = "lxml-5.3.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f2cfae0688fd01f7056a17367e3b84f37c545fb447d7282cf2c242b16262607"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:67d2f8ad9dcc3a9e826bdc7802ed541a44e124c29b7d95a679eeb58c1c14ade8"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db0c742aad702fd5d0c6611a73f9602f20aec2007c102630c06d7633d9c8f09a"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:198bb4b4dd888e8390afa4f170d4fa28467a7eaf857f1952589f16cfbb67af27"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d2a3e412ce1849be34b45922bfef03df32d1410a06d1cdeb793a343c2f1fd666"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b8969dbc8d09d9cd2ae06362c3bad27d03f433252601ef658a49bd9f2b22d79"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:5be8f5e4044146a69c96077c7e08f0709c13a314aa5315981185c1f00235fe65"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_28_ppc64le.whl", hash = "sha256:133f3493253a00db2c870d3740bc458ebb7d937bd0a6a4f9328373e0db305709"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_28_s390x.whl", hash = "sha256:52d82b0d436edd6a1d22d94a344b9a58abd6c68c357ed44f22d4ba8179b37629"},
{file = "lxml-5.3.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:1b6f92e35e2658a5ed51c6634ceb5ddae32053182851d8cad2a5bc102a359b33"},
{file = "lxml-5.3.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:203b1d3eaebd34277be06a3eb880050f18a4e4d60861efba4fb946e31071a295"},
{file = "lxml-5.3.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:155e1a5693cf4b55af652f5c0f78ef36596c7f680ff3ec6eb4d7d85367259b2c"},
{file = "lxml-5.3.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:22ec2b3c191f43ed21f9545e9df94c37c6b49a5af0a874008ddc9132d49a2d9c"},
{file = "lxml-5.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7eda194dd46e40ec745bf76795a7cccb02a6a41f445ad49d3cf66518b0bd9cff"},
{file = "lxml-5.3.1-cp311-cp311-win32.whl", hash = "sha256:fb7c61d4be18e930f75948705e9718618862e6fc2ed0d7159b2262be73f167a2"},
{file = "lxml-5.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:c809eef167bf4a57af4b03007004896f5c60bd38dc3852fcd97a26eae3d4c9e6"},
{file = "lxml-5.3.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:e69add9b6b7b08c60d7ff0152c7c9a6c45b4a71a919be5abde6f98f1ea16421c"},
{file = "lxml-5.3.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4e52e1b148867b01c05e21837586ee307a01e793b94072d7c7b91d2c2da02ffe"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a4b382e0e636ed54cd278791d93fe2c4f370772743f02bcbe431a160089025c9"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2e49dc23a10a1296b04ca9db200c44d3eb32c8d8ec532e8c1fd24792276522a"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4399b4226c4785575fb20998dc571bc48125dc92c367ce2602d0d70e0c455eb0"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5412500e0dc5481b1ee9cf6b38bb3b473f6e411eb62b83dc9b62699c3b7b79f7"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c93ed3c998ea8472be98fb55aed65b5198740bfceaec07b2eba551e55b7b9ae"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:63d57fc94eb0bbb4735e45517afc21ef262991d8758a8f2f05dd6e4174944519"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_28_ppc64le.whl", hash = "sha256:b450d7cabcd49aa7ab46a3c6aa3ac7e1593600a1a0605ba536ec0f1b99a04322"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_28_s390x.whl", hash = "sha256:4df0ec814b50275ad6a99bc82a38b59f90e10e47714ac9871e1b223895825468"},
{file = "lxml-5.3.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:d184f85ad2bb1f261eac55cddfcf62a70dee89982c978e92b9a74a1bfef2e367"},
{file = "lxml-5.3.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b725e70d15906d24615201e650d5b0388b08a5187a55f119f25874d0103f90dd"},
{file = "lxml-5.3.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a31fa7536ec1fb7155a0cd3a4e3d956c835ad0a43e3610ca32384d01f079ea1c"},
{file = "lxml-5.3.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3c3c8b55c7fc7b7e8877b9366568cc73d68b82da7fe33d8b98527b73857a225f"},
{file = "lxml-5.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d61ec60945d694df806a9aec88e8f29a27293c6e424f8ff91c80416e3c617645"},
{file = "lxml-5.3.1-cp312-cp312-win32.whl", hash = "sha256:f4eac0584cdc3285ef2e74eee1513a6001681fd9753b259e8159421ed28a72e5"},
{file = "lxml-5.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:29bfc8d3d88e56ea0a27e7c4897b642706840247f59f4377d81be8f32aa0cfbf"},
{file = "lxml-5.3.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c093c7088b40d8266f57ed71d93112bd64c6724d31f0794c1e52cc4857c28e0e"},
{file = "lxml-5.3.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b0884e3f22d87c30694e625b1e62e6f30d39782c806287450d9dc2fdf07692fd"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1637fa31ec682cd5760092adfabe86d9b718a75d43e65e211d5931809bc111e7"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a364e8e944d92dcbf33b6b494d4e0fb3499dcc3bd9485beb701aa4b4201fa414"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:779e851fd0e19795ccc8a9bb4d705d6baa0ef475329fe44a13cf1e962f18ff1e"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c4393600915c308e546dc7003d74371744234e8444a28622d76fe19b98fa59d1"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:673b9d8e780f455091200bba8534d5f4f465944cbdd61f31dc832d70e29064a5"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:2e4a570f6a99e96c457f7bec5ad459c9c420ee80b99eb04cbfcfe3fc18ec6423"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_28_ppc64le.whl", hash = "sha256:71f31eda4e370f46af42fc9f264fafa1b09f46ba07bdbee98f25689a04b81c20"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_28_s390x.whl", hash = "sha256:42978a68d3825eaac55399eb37a4d52012a205c0c6262199b8b44fcc6fd686e8"},
{file = "lxml-5.3.1-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:8b1942b3e4ed9ed551ed3083a2e6e0772de1e5e3aca872d955e2e86385fb7ff9"},
{file = "lxml-5.3.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:85c4f11be9cf08917ac2a5a8b6e1ef63b2f8e3799cec194417e76826e5f1de9c"},
{file = "lxml-5.3.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:231cf4d140b22a923b1d0a0a4e0b4f972e5893efcdec188934cc65888fd0227b"},
{file = "lxml-5.3.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:5865b270b420eda7b68928d70bb517ccbe045e53b1a428129bb44372bf3d7dd5"},
{file = "lxml-5.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dbf7bebc2275016cddf3c997bf8a0f7044160714c64a9b83975670a04e6d2252"},
{file = "lxml-5.3.1-cp313-cp313-win32.whl", hash = "sha256:d0751528b97d2b19a388b302be2a0ee05817097bab46ff0ed76feeec24951f78"},
{file = "lxml-5.3.1-cp313-cp313-win_amd64.whl", hash = "sha256:91fb6a43d72b4f8863d21f347a9163eecbf36e76e2f51068d59cd004c506f332"},
{file = "lxml-5.3.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:016b96c58e9a4528219bb563acf1aaaa8bc5452e7651004894a973f03b84ba81"},
{file = "lxml-5.3.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82a4bb10b0beef1434fb23a09f001ab5ca87895596b4581fd53f1e5145a8934a"},
{file = "lxml-5.3.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d68eeef7b4d08a25e51897dac29bcb62aba830e9ac6c4e3297ee7c6a0cf6439"},
{file = "lxml-5.3.1-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:f12582b8d3b4c6be1d298c49cb7ae64a3a73efaf4c2ab4e37db182e3545815ac"},
{file = "lxml-5.3.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2df7ed5edeb6bd5590914cd61df76eb6cce9d590ed04ec7c183cf5509f73530d"},
{file = "lxml-5.3.1-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:585c4dc429deebc4307187d2b71ebe914843185ae16a4d582ee030e6cfbb4d8a"},
{file = "lxml-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:06a20d607a86fccab2fc15a77aa445f2bdef7b49ec0520a842c5c5afd8381576"},
{file = "lxml-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:057e30d0012439bc54ca427a83d458752ccda725c1c161cc283db07bcad43cf9"},
{file = "lxml-5.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4867361c049761a56bd21de507cab2c2a608c55102311d142ade7dab67b34f32"},
{file = "lxml-5.3.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3dddf0fb832486cc1ea71d189cb92eb887826e8deebe128884e15020bb6e3f61"},
{file = "lxml-5.3.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bcc211542f7af6f2dfb705f5f8b74e865592778e6cafdfd19c792c244ccce19"},
{file = "lxml-5.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaca5a812f050ab55426c32177091130b1e49329b3f002a32934cd0245571307"},
{file = "lxml-5.3.1-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:236610b77589faf462337b3305a1be91756c8abc5a45ff7ca8f245a71c5dab70"},
{file = "lxml-5.3.1-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:aed57b541b589fa05ac248f4cb1c46cbb432ab82cbd467d1c4f6a2bdc18aecf9"},
{file = "lxml-5.3.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:75fa3d6946d317ffc7016a6fcc44f42db6d514b7fdb8b4b28cbe058303cb6e53"},
{file = "lxml-5.3.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:96eef5b9f336f623ffc555ab47a775495e7e8846dde88de5f941e2906453a1ce"},
{file = "lxml-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:ef45f31aec9be01379fc6c10f1d9c677f032f2bac9383c827d44f620e8a88407"},
{file = "lxml-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0611da6b07dd3720f492db1b463a4d1175b096b49438761cc9f35f0d9eaaef5"},
{file = "lxml-5.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b2aca14c235c7a08558fe0a4786a1a05873a01e86b474dfa8f6df49101853a4e"},
{file = "lxml-5.3.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae82fce1d964f065c32c9517309f0c7be588772352d2f40b1574a214bd6e6098"},
{file = "lxml-5.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7aae7a3d63b935babfdc6864b31196afd5145878ddd22f5200729006366bc4d5"},
{file = "lxml-5.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8e0d177b1fe251c3b1b914ab64135475c5273c8cfd2857964b2e3bb0fe196a7"},
{file = "lxml-5.3.1-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:6c4dd3bfd0c82400060896717dd261137398edb7e524527438c54a8c34f736bf"},
{file = "lxml-5.3.1-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:f1208c1c67ec9e151d78aa3435aa9b08a488b53d9cfac9b699f15255a3461ef2"},
{file = "lxml-5.3.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:c6aacf00d05b38a5069826e50ae72751cb5bc27bdc4d5746203988e429b385bb"},
{file = "lxml-5.3.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:5881aaa4bf3a2d086c5f20371d3a5856199a0d8ac72dd8d0dbd7a2ecfc26ab73"},
{file = "lxml-5.3.1-cp38-cp38-win32.whl", hash = "sha256:45fbb70ccbc8683f2fb58bea89498a7274af1d9ec7995e9f4af5604e028233fc"},
{file = "lxml-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:7512b4d0fc5339d5abbb14d1843f70499cab90d0b864f790e73f780f041615d7"},
{file = "lxml-5.3.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5885bc586f1edb48e5d68e7a4b4757b5feb2a496b64f462b4d65950f5af3364f"},
{file = "lxml-5.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1b92fe86e04f680b848fff594a908edfa72b31bfc3499ef7433790c11d4c8cd8"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a091026c3bf7519ab1e64655a3f52a59ad4a4e019a6f830c24d6430695b1cf6a"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ffb141361108e864ab5f1813f66e4e1164181227f9b1f105b042729b6c15125"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3715cdf0dd31b836433af9ee9197af10e3df41d273c19bb249230043667a5dfd"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88b72eb7222d918c967202024812c2bfb4048deeb69ca328363fb8e15254c549"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa59974880ab5ad8ef3afaa26f9bda148c5f39e06b11a8ada4660ecc9fb2feb3"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:3bb8149840daf2c3f97cebf00e4ed4a65a0baff888bf2605a8d0135ff5cf764e"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_28_ppc64le.whl", hash = "sha256:0d6b2fa86becfa81f0a0271ccb9eb127ad45fb597733a77b92e8a35e53414914"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_28_s390x.whl", hash = "sha256:136bf638d92848a939fd8f0e06fcf92d9f2e4b57969d94faae27c55f3d85c05b"},
{file = "lxml-5.3.1-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:89934f9f791566e54c1d92cdc8f8fd0009447a5ecdb1ec6b810d5f8c4955f6be"},
{file = "lxml-5.3.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a8ade0363f776f87f982572c2860cc43c65ace208db49c76df0a21dde4ddd16e"},
{file = "lxml-5.3.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:bfbbab9316330cf81656fed435311386610f78b6c93cc5db4bebbce8dd146675"},
{file = "lxml-5.3.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:172d65f7c72a35a6879217bcdb4bb11bc88d55fb4879e7569f55616062d387c2"},
{file = "lxml-5.3.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e3c623923967f3e5961d272718655946e5322b8d058e094764180cdee7bab1af"},
{file = "lxml-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ce0930a963ff593e8bb6fda49a503911accc67dee7e5445eec972668e672a0f0"},
{file = "lxml-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:f7b64fcd670bca8800bc10ced36620c6bbb321e7bc1214b9c0c0df269c1dddc2"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:afa578b6524ff85fb365f454cf61683771d0170470c48ad9d170c48075f86725"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67f5e80adf0aafc7b5454f2c1cb0cde920c9b1f2cbd0485f07cc1d0497c35c5d"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2dd0b80ac2d8f13ffc906123a6f20b459cb50a99222d0da492360512f3e50f84"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:422c179022ecdedbe58b0e242607198580804253da220e9454ffe848daa1cfd2"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:524ccfded8989a6595dbdda80d779fb977dbc9a7bc458864fc9a0c2fc15dc877"},
{file = "lxml-5.3.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:48fd46bf7155def2e15287c6f2b133a2f78e2d22cdf55647269977b873c65499"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:05123fad495a429f123307ac6d8fd6f977b71e9a0b6d9aeeb8f80c017cb17131"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a243132767150a44e6a93cd1dde41010036e1cbc63cc3e9fe1712b277d926ce3"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c92ea6d9dd84a750b2bae72ff5e8cf5fdd13e58dda79c33e057862c29a8d5b50"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:2f1be45d4c15f237209bbf123a0e05b5d630c8717c42f59f31ea9eae2ad89394"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:a83d3adea1e0ee36dac34627f78ddd7f093bb9cfc0a8e97f1572a949b695cb98"},
{file = "lxml-5.3.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:3edbb9c9130bac05d8c3fe150c51c337a471cc7fdb6d2a0a7d3a88e88a829314"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2f23cf50eccb3255b6e913188291af0150d89dab44137a69e14e4dcb7be981f1"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df7e5edac4778127f2bf452e0721a58a1cfa4d1d9eac63bdd650535eb8543615"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:094b28ed8a8a072b9e9e2113a81fda668d2053f2ca9f2d202c2c8c7c2d6516b1"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:514fe78fc4b87e7a7601c92492210b20a1b0c6ab20e71e81307d9c2e377c64de"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:8fffc08de02071c37865a155e5ea5fce0282e1546fd5bde7f6149fcaa32558ac"},
{file = "lxml-5.3.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4b0d5cdba1b655d5b18042ac9c9ff50bda33568eb80feaaca4fc237b9c4fbfde"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:3031e4c16b59424e8d78522c69b062d301d951dc55ad8685736c3335a97fc270"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb659702a45136c743bc130760c6f137870d4df3a9e14386478b8a0511abcfca"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a11b16a33656ffc43c92a5343a28dc71eefe460bcc2a4923a96f292692709f6"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c5ae125276f254b01daa73e2c103363d3e99e3e10505686ac7d9d2442dd4627a"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c76722b5ed4a31ba103e0dc77ab869222ec36efe1a614e42e9bcea88a36186fe"},
{file = "lxml-5.3.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:33e06717c00c788ab4e79bc4726ecc50c54b9bfb55355eae21473c145d83c2d2"},
{file = "lxml-5.3.1.tar.gz", hash = "sha256:106b7b5d2977b339f1e97efe2778e2ab20e99994cbb0ec5e55771ed0795920c8"},
]
[package.extras]
cssselect = ["cssselect (>=0.7)"]
html-clean = ["lxml_html_clean"]
html5 = ["html5lib"]
htmlsoup = ["BeautifulSoup4"]
source = ["Cython (>=3.0.11,<3.1.0)"]
[[package]]
name = "lxml-stubs"
version = "0.4.0"
description = "Type annotations for the lxml package"
optional = false
python-versions = "*"
files = [
{file = "lxml-stubs-0.4.0.tar.gz", hash = "sha256:184877b42127256abc2b932ba8bd0ab5ea80bd0b0fee618d16daa40e0b71abee"},
{file = "lxml_stubs-0.4.0-py3-none-any.whl", hash = "sha256:3b381e9e82397c64ea3cc4d6f79d1255d015f7b114806d4826218805c10ec003"},
]
[package.extras]
test = ["coverage[toml] (==5.2)", "pytest (>=6.0.0)", "pytest-mypy-plugins (==1.9.3)"]
[[package]]
name = "marisa-trie"
version = "1.2.1"
description = "Static memory-efficient and fast Trie-like structures for Python."
optional = false
python-versions = ">=3.7"
files = [
{file = "marisa_trie-1.2.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a2eb41d2f9114d8b7bd66772c237111e00d2bae2260824560eaa0a1e291ce9e8"},
{file = "marisa_trie-1.2.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9e956e6a46f604b17d570901e66f5214fb6f658c21e5e7665deace236793cef6"},
{file = "marisa_trie-1.2.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:bd45142501300e7538b2e544905580918b67b1c82abed1275fe4c682c95635fa"},
{file = "marisa_trie-1.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a8443d116c612cfd1961fbf76769faf0561a46d8e317315dd13f9d9639ad500c"},
{file = "marisa_trie-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:875a6248e60fbb48d947b574ffa4170f34981f9e579bde960d0f9a49ea393ecc"},
{file = "marisa_trie-1.2.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:746a7c60a17fccd3cfcfd4326926f02ea4fcdfc25d513411a0c4fc8e4a1ca51f"},
{file = "marisa_trie-1.2.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e70869737cc0e5bd903f620667da6c330d6737048d1f44db792a6af68a1d35be"},
{file = "marisa_trie-1.2.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06b099dd743676dbcd8abd8465ceac8f6d97d8bfaabe2c83b965495523b4cef2"},
{file = "marisa_trie-1.2.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d2a82eb21afdaf22b50d9b996472305c05ca67fc4ff5a026a220320c9c961db6"},
{file = "marisa_trie-1.2.1-cp310-cp310-win32.whl", hash = "sha256:8951e7ce5d3167fbd085703b4cbb3f47948ed66826bef9a2173c379508776cf5"},
{file = "marisa_trie-1.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:5685a14b3099b1422c4f59fa38b0bf4b5342ee6cc38ae57df9666a0b28eeaad3"},
{file = "marisa_trie-1.2.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ed3fb4ed7f2084597e862bcd56c56c5529e773729a426c083238682dba540e98"},
{file = "marisa_trie-1.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0fe69fb9ffb2767746181f7b3b29bbd3454d1d24717b5958e030494f3d3cddf3"},
{file = "marisa_trie-1.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4728ed3ae372d1ea2cdbd5eaa27b8f20a10e415d1f9d153314831e67d963f281"},
{file = "marisa_trie-1.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8cf4f25cf895692b232f49aa5397af6aba78bb679fb917a05fce8d3cb1ee446d"},
{file = "marisa_trie-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7cca7f96236ffdbf49be4b2e42c132e3df05968ac424544034767650913524de"},
{file = "marisa_trie-1.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d7eb20bf0e8b55a58d2a9b518aabc4c18278787bdba476c551dd1c1ed109e509"},
{file = "marisa_trie-1.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b1ec93f0d1ee6d7ab680a6d8ea1a08bf264636358e92692072170032dda652ba"},
{file = "marisa_trie-1.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e2699255d7ac610dee26d4ae7bda5951d05c7d9123a22e1f7c6a6f1964e0a4e4"},
{file = "marisa_trie-1.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c484410911182457a8a1a0249d0c09c01e2071b78a0a8538cd5f7fa45589b13a"},
{file = "marisa_trie-1.2.1-cp311-cp311-win32.whl", hash = "sha256:ad548117744b2bcf0e3d97374608be0a92d18c2af13d98b728d37cd06248e571"},
{file = "marisa_trie-1.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:436f62d27714970b9cdd3b3c41bdad046f260e62ebb0daa38125ef70536fc73b"},
{file = "marisa_trie-1.2.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:638506eacf20ca503fff72221a7e66a6eadbf28d6a4a6f949fcf5b1701bb05ec"},
{file = "marisa_trie-1.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de1665eaafefa48a308e4753786519888021740501a15461c77bdfd57638e6b4"},
{file = "marisa_trie-1.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f713af9b8aa66a34cd3a78c7d150a560a75734713abe818a69021fd269e927fa"},
{file = "marisa_trie-1.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2a7d00f53f4945320b551bccb826b3fb26948bde1a10d50bb9802fabb611b10"},
{file = "marisa_trie-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98042040d1d6085792e8d0f74004fc0f5f9ca6091c298f593dd81a22a4643854"},
{file = "marisa_trie-1.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6532615111eec2c79e711965ece0bc95adac1ff547a7fff5ffca525463116deb"},
{file = "marisa_trie-1.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:20948e40ab2038e62b7000ca6b4a913bc16c91a2c2e6da501bd1f917eeb28d51"},
{file = "marisa_trie-1.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:66b23e5b35dd547f85bf98db7c749bc0ffc57916ade2534a6bbc32db9a4abc44"},
{file = "marisa_trie-1.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6704adf0247d2dda42e876b793be40775dff46624309ad99bc7537098bee106d"},
{file = "marisa_trie-1.2.1-cp312-cp312-win32.whl", hash = "sha256:3ad356442c2fea4c2a6f514738ddf213d23930f942299a2b2c05df464a00848a"},
{file = "marisa_trie-1.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:f2806f75817392cedcacb24ac5d80b0350dde8d3861d67d045c1d9b109764114"},
{file = "marisa_trie-1.2.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:b5ea16e69bfda0ac028c921b58de1a4aaf83d43934892977368579cd3c0a2554"},
{file = "marisa_trie-1.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9f627f4e41be710b6cb6ed54b0128b229ac9d50e2054d9cde3af0fef277c23cf"},
{file = "marisa_trie-1.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5e649f3dc8ab5476732094f2828cc90cac3be7c79bc0c8318b6fda0c1d248db4"},
{file = "marisa_trie-1.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46e528ee71808c961baf8c3ce1c46a8337ec7a96cc55389d11baafe5b632f8e9"},
{file = "marisa_trie-1.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36aa4401a1180615f74d575571a6550081d84fc6461e9aefc0bb7b2427af098e"},
{file = "marisa_trie-1.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce59bcd2cda9bb52b0e90cc7f36413cd86c3d0ce7224143447424aafb9f4aa48"},
{file = "marisa_trie-1.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f4cd800704a5fc57e53c39c3a6b0c9b1519ebdbcb644ede3ee67a06eb542697d"},
{file = "marisa_trie-1.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2428b495003c189695fb91ceeb499f9fcced3a2dce853e17fa475519433c67ff"},
{file = "marisa_trie-1.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:735c363d9aaac82eaf516a28f7c6b95084c2e176d8231c87328dc80e112a9afa"},
{file = "marisa_trie-1.2.1-cp313-cp313-win32.whl", hash = "sha256:eba6ca45500ca1a042466a0684aacc9838e7f20fe2605521ee19f2853062798f"},
{file = "marisa_trie-1.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:aa7cd17e1c690ce96c538b2f4aae003d9a498e65067dd433c52dd069009951d4"},
{file = "marisa_trie-1.2.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5e43891a37b0d7f618819fea14bd951289a0a8e3dd0da50c596139ca83ebb9b1"},
{file = "marisa_trie-1.2.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6946100a43f933fad6bc458c502a59926d80b321d5ac1ed2ff9c56605360496f"},
{file = "marisa_trie-1.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4177dc0bd1374e82be9b2ba4d0c2733b0a85b9d154ceeea83a5bee8c1e62fbf"},
{file = "marisa_trie-1.2.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f35c2603a6be168088ed1db6ad1704b078aa8f39974c60888fbbced95dcadad4"},
{file = "marisa_trie-1.2.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d659fda873d8dcb2c14c2c331de1dee21f5a902d7f2de7978b62c6431a8850ef"},
{file = "marisa_trie-1.2.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:b0ef26733d3c836be79e812071e1a431ce1f807955a27a981ebb7993d95f842b"},
{file = "marisa_trie-1.2.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:536ea19ce6a2ce61c57fed4123ecd10d18d77a0db45cd2741afff2b8b68f15b3"},
{file = "marisa_trie-1.2.1-cp37-cp37m-win32.whl", hash = "sha256:0ee6cf6a16d9c3d1c94e21c8e63c93d8b34bede170ca4e937e16e1c0700d399f"},
{file = "marisa_trie-1.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7e7b1786e852e014d03e5f32dbd991f9a9eb223dd3fa9a2564108b807e4b7e1c"},
{file = "marisa_trie-1.2.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:952af3a5859c3b20b15a00748c36e9eb8316eb2c70bd353ae1646da216322908"},
{file = "marisa_trie-1.2.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24a81aa7566e4ec96fc4d934581fe26d62eac47fc02b35fa443a0bb718b471e8"},
{file = "marisa_trie-1.2.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9c9b32b14651a6dcf9e8857d2df5d29d322a1ea8c0be5c8ffb88f9841c4ec62b"},
{file = "marisa_trie-1.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ac170d20b97beb75059ba65d1ccad6b434d777c8992ab41ffabdade3b06dd74"},
{file = "marisa_trie-1.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da4e4facb79614cc4653cfd859f398e4db4ca9ab26270ff12610e50ed7f1f6c6"},
{file = "marisa_trie-1.2.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25688f34cac3bec01b4f655ffdd6c599a01f0bd596b4a79cf56c6f01a7df3560"},
{file = "marisa_trie-1.2.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:1db3213b451bf058d558f6e619bceff09d1d130214448a207c55e1526e2773a1"},
{file = "marisa_trie-1.2.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:d5648c6dcc5dc9200297fb779b1663b8a4467bda034a3c69bd9c32d8afb33b1d"},
{file = "marisa_trie-1.2.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:5bd39a4e1cc839a88acca2889d17ebc3f202a5039cd6059a13148ce75c8a6244"},
{file = "marisa_trie-1.2.1-cp38-cp38-win32.whl", hash = "sha256:594f98491a96c7f1ffe13ce292cef1b4e63c028f0707effdea0f113364c1ae6c"},
{file = "marisa_trie-1.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:5fe5a286f997848a410eebe1c28657506adaeb405220ee1e16cfcfd10deb37f2"},
{file = "marisa_trie-1.2.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c0fe2ace0cb1806badbd1c551a8ec2f8d4cf97bf044313c082ef1acfe631ddca"},
{file = "marisa_trie-1.2.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:67f0c2ec82c20a02c16fc9ba81dee2586ef20270127c470cb1054767aa8ba310"},
{file = "marisa_trie-1.2.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a3c98613180cf1730e221933ff74b454008161b1a82597e41054127719964188"},
{file = "marisa_trie-1.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:429858a0452a7bedcf67bc7bb34383d00f666c980cb75a31bcd31285fbdd4403"},
{file = "marisa_trie-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2eacb84446543082ec50f2fb563f1a94c96804d4057b7da8ed815958d0cdfbe"},
{file = "marisa_trie-1.2.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:852d7bcf14b0c63404de26e7c4c8d5d65ecaeca935e93794331bc4e2f213660b"},
{file = "marisa_trie-1.2.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e58788004adda24c401d1751331618ed20c507ffc23bfd28d7c0661a1cf0ad16"},
{file = "marisa_trie-1.2.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:aefe0973cc4698e0907289dc0517ab0c7cdb13d588201932ff567d08a50b0e2e"},
{file = "marisa_trie-1.2.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6c50c861faad0a5c091bd763e0729f958c316e678dfa065d3984fbb9e4eacbcd"},
{file = "marisa_trie-1.2.1-cp39-cp39-win32.whl", hash = "sha256:b1ce340da608530500ab4f963f12d6bfc8d8680900919a60dbdc9b78c02060a4"},
{file = "marisa_trie-1.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:ce37d8ca462bb64cc13f529b9ed92f7b21fe8d1f1679b62e29f9cb7d0e888b49"},
{file = "marisa_trie-1.2.1.tar.gz", hash = "sha256:3a27c408e2aefc03e0f1d25b2ff2afb85aac3568f6fa2ae2a53b57a2e87ce29d"},
]
[package.dependencies]
setuptools = "*"
[package.extras]
test = ["hypothesis", "pytest", "readme-renderer"]
[[package]]
name = "packaging"
version = "24.2"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.8"
files = [
{file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"},
{file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"},
]
[[package]]
name = "pluggy"
version = "1.5.0"
description = "plugin and hook calling mechanisms for python"
optional = false
python-versions = ">=3.8"
files = [
{file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
{file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
]
[package.extras]
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "pymp4"
version = "1.4.0"
description = "Python parser for MP4 boxes"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "pymp4-1.4.0-py3-none-any.whl", hash = "sha256:3401666c1e2a97ac94dffb18c5a5dcbd46d0a436da5272d378a6f9f6506dd12d"},
{file = "pymp4-1.4.0.tar.gz", hash = "sha256:bc9e77732a8a143d34c38aa862a54180716246938e4bf3e07585d19252b77bb5"},
]
[package.dependencies]
construct = "2.8.8"
[[package]]
name = "pytest"
version = "7.4.4"
description = "pytest: simple powerful testing with Python"
optional = false
python-versions = ">=3.7"
files = [
{file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
{file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
]
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=0.12,<2.0"
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
[package.extras]
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
[[package]]
name = "setuptools"
version = "75.3.0"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
optional = false
python-versions = ">=3.8"
files = [
{file = "setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd"},
{file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"},
]
[package.extras]
check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"]
core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"]
cover = ["pytest-cov"]
doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
enabler = ["pytest-enabler (>=2.2)"]
test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"]
type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"]
[[package]]
name = "soupsieve"
version = "2.6"
description = "A modern CSS selector implementation for Beautiful Soup."
optional = false
python-versions = ">=3.8"
files = [
{file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"},
{file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"},
]
[[package]]
name = "srt"
version = "3.5.3"
description = "A tiny library for parsing, modifying, and composing SRT files."
optional = false
python-versions = ">=2.7"
files = [
{file = "srt-3.5.3.tar.gz", hash = "sha256:4884315043a4f0740fd1f878ed6caa376ac06d70e135f306a6dc44632eed0cc0"},
]
[[package]]
name = "tinycss"
version = "0.4"
description = "tinycss is a complete yet simple CSS parser for Python."
optional = false
python-versions = "*"
files = [
{file = "tinycss-0.4.tar.gz", hash = "sha256:12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e"},
]
[package.extras]
test = ["pytest-cov", "pytest-flake8", "pytest-isort", "pytest-runner"]
[[package]]
name = "tomli"
version = "2.2.1"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.8"
files = [
{file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"},
{file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"},
{file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"},
{file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"},
{file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"},
{file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"},
{file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"},
{file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"},
{file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"},
{file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"},
{file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"},
{file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"},
{file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"},
{file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"},
]
[[package]]
name = "typing-extensions"
version = "4.12.2"
description = "Backported and Experimental Type Hints for Python 3.8+"
optional = false
python-versions = ">=3.8"
files = [
{file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},
{file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "d1dc09a1492c59373465886d52b572d761f7e370239ae93c63a7c88f4a69c47f"

View File

@ -0,0 +1,33 @@
[tool.poetry]
name = "subby"
version = "0.3.19"
description = "Advanced subtitle converter and processor"
authors = ["vevv"]
license = "GPL-3.0-or-later"
readme = "README.md"
repository = "https://github.com/vevv/subby"
[tool.poetry.dependencies]
python = "^3.8"
pymp4 = "~1.4.0"
beautifulsoup4 = "^4.8.2"
tinycss = "^0.4"
click = "^8.1.3"
srt = "^3.5.3"
lxml = "^5.3.0"
langcodes = "^3.4.0"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
lxml-stubs = "^0.4.0"
[tool.poetry.scripts]
subby = "subby.cli:main"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

4
scripts/subby/setup.py Normal file
View File

@ -0,0 +1,4 @@
import setuptools
if __name__ == "__main__":
setuptools.setup()

View File

@ -0,0 +1,25 @@
from subby.converters.bilibili_json import BilibiliJSONConverter
from subby.converters.mp4 import ISMTConverter, WVTTConverter
from subby.converters.sami import SAMIConverter
from subby.converters.smpte import SMPTEConverter
from subby.converters.webvtt import WebVTTConverter
from subby.processors.common_issues import CommonIssuesFixer
from subby.processors.sdh import SDHStripper
from subby.subripfile import SubRipFile
__version__ = '0.3.19'
__all__ = [
# Converters
'SAMIConverter',
'SMPTEConverter', 'ISMTConverter',
'WebVTTConverter', 'WVTTConverter',
'BilibiliJSONConverter',
# Processors
'CommonIssuesFixer',
'SDHStripper',
# Utility
'SubRipFile',
# Version
'__version__'
]

217
scripts/subby/subby/cli.py Normal file
View File

@ -0,0 +1,217 @@
from __future__ import annotations
import logging
from datetime import datetime
from pathlib import Path
import click
from subby import (BilibiliJSONConverter, CommonIssuesFixer, ISMTConverter,
SAMIConverter, SDHStripper, SMPTEConverter, WebVTTConverter,
WVTTConverter, __version__)
@click.group()
@click.option("-d", "--debug", is_flag=True, default=False, help="Enable debug level logs.")
def main(debug: bool) -> None:
"""Subby—Advanced Subtitle Converter and Processor."""
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO)
logging.getLogger('srt').setLevel(logging.DEBUG if debug else logging.CRITICAL)
@main.command()
def version():
"""Print version information."""
log = logging.getLogger(__name__)
copyright_years = 2023
current_year = datetime.now().year
if copyright_years != current_year:
copyright_years = f"{copyright_years}-{current_year}"
log.info("Subby version %s Copyright (c) %s vevv", __version__, copyright_years)
log.info("https://github.com/vevv/subby")
@main.command()
@click.argument("file", type=Path)
@click.option("-o", "--out", type=Path, default=None, help="Output path.")
@click.option(
"-l",
"--language",
type=str,
default=None,
help="Subtitle language (used for language specific processing)"
)
@click.option(
"-e",
"--encoding",
type=str,
default="utf-8",
help="Character encoding (default: utf-8)."
)
@click.option(
"-n",
"--no-post-processing",
is_flag=True,
default=False,
help="Disable post-processing after conversion."
)
@click.option(
"-g",
"--keep-short-gaps",
is_flag=True,
help="Keep short gaps between lines (< 85 ms; only with post-processing enabled)"
)
def convert(
file: Path,
out: Path | None,
language: str,
encoding: str,
no_post_processing: bool,
keep_short_gaps: bool
):
"""Convert a Subtitle to SubRip (SRT)."""
if not isinstance(file, Path):
raise click.ClickException(f"Expected file to be a {Path} not {file!r}")
if out and not isinstance(out, Path):
raise click.ClickException(f"Expected out to be a {Path} not {out!r}")
if not out:
out = file.with_suffix(".srt")
log = logging.getLogger("convert")
data = file.read_bytes()
converter = None
if b"mdat" in data and b"moof" in data:
if b"</tt>" in data:
log.info("Subtitle format: ISMT (DFXP in MP4)")
converter = ISMTConverter()
elif b"vttc" in data:
log.info("Subtitle format: WVTT (WebVTT in MP4)")
converter = WVTTConverter()
elif b"<SAMI>" in data:
log.info("Subtitle format: SAMI")
converter = SAMIConverter()
elif b"</tt>" in data or b"</tt:tt>" in data:
log.info("Subtitle format: DFXP/TTML/TTML2")
converter = SMPTEConverter()
elif b"WEBVTT" in data:
log.info("Subtitle format: WebVTT")
converter = WebVTTConverter()
elif data.startswith(b'{') and b'"Stroke"' in data and b'"background_color"' in data:
log.info("Subtitle format: JSON (Bilibili)")
converter = BilibiliJSONConverter()
if not converter:
log.error("Subtitle format was unrecognized...")
return
srt = converter.from_file(file)
log.info("Converted subtitle to SubRip (SRT)")
if not no_post_processing:
processor = CommonIssuesFixer()
processor.remove_gaps = not keep_short_gaps
srt, status = processor.from_srt(srt, language=language)
log.info(f"Processed subtitle {['but no issues were found...', 'and repaired some issues!'][status]}")
srt.save(out, encoding=encoding)
log.info(f"Saved to: {out}")
log.debug(f"Used character encoding {encoding}")
@main.group()
@click.argument("file", type=Path)
@click.option("-o", "--out", type=Path, default=None, help="Output path.")
@click.option(
"-l",
"--language",
type=str,
default=None,
help="Subtitle language (used for language specific processing)"
)
@click.option(
"-e",
"--encoding",
type=str,
default="utf-8",
help="Character encoding (default: utf-8)."
)
@click.option(
"-n",
"--no-post-processing",
is_flag=True,
default=False,
help="Disable post-processing after SDH stripping."
)
@click.option(
"-g",
"--keep-short-gaps",
is_flag=True,
help="Keep short gaps between lines (< 85 ms)"
)
def process(file: Path, out: Path | None, **__):
"""SubRip (SRT) post-processing."""
if not isinstance(file, Path):
raise click.ClickException(f"Expected file to be a {Path} not {file!r}")
if out and not isinstance(out, Path):
raise click.ClickException(f"Expected out to be a {Path} not {out!r}")
@process.command()
@click.pass_context
def mend(ctx: click.Context):
"""Repair or Mend common issues in a Subtitle."""
file = ctx.parent.params["file"]
if not ctx.parent.params["out"]:
ctx.parent.params["out"] = file.with_stem(file.stem + "_mend")
log = logging.getLogger("process.mend")
processor = CommonIssuesFixer()
processor.remove_gaps = not ctx.parent.params["keep_short_gaps"]
processed_srt, status = processor.from_file(file, language=ctx.parent.params["language"])
log.info(f"Processed subtitle {['but no issues were found...', 'and repaired some issues!'][status]}")
return processed_srt, status
@process.command("strip-sdh")
@click.pass_context
def strip_sdh(ctx: click.Context):
"""Remove Hard-of-hearing descriptions from Subtitles."""
file = ctx.parent.params["file"]
if not ctx.parent.params["out"]:
ctx.parent.params["out"] = file.with_stem(file.stem + "_sdh_stripped")
log = logging.getLogger("process.strip_sdh")
processor = SDHStripper()
processed_srt, status = processor.from_file(file, language=ctx.parent.params["language"])
log.info(f"Processed subtitle {['but no SDH descriptions were found...', 'and removed SDH!'][status]}")
if not ctx.parent.params["no_post_processing"]:
processor = CommonIssuesFixer()
processor.remove_gaps = not ctx.parent.params["keep_short_gaps"]
processed_srt, _ = processor.from_srt(processed_srt, language=ctx.parent.params["language"])
log.info(
"Processed stripped subtitle "
+ ['but no issues were found...', 'and repaired some issues!'][status]
)
return processed_srt, status
@process.result_callback()
def process_result(result, out, encoding, *_, **__):
log = logging.getLogger("process")
processed_srt, status = result
if status:
processed_srt.save(out, encoding=encoding)
log.info(f"Saved to: {out}")
log.debug(f"Used character encoding {encoding}")

View File

@ -0,0 +1,27 @@
from abc import ABC, abstractmethod
from io import BytesIO
from pathlib import Path
from typing import BinaryIO
from subby.subripfile import SubRipFile
class BaseConverter(ABC):
"""Base subtitle converter class"""
def from_file(self, file: Path) -> SubRipFile:
"""Reads a given file and converts it to srt"""
with file.open(mode='rb') as stream:
return self.parse(stream)
def from_string(self, data: str) -> SubRipFile:
"""Reads a given string and converts it to srt"""
return self.parse(BytesIO(data.encode('utf-8')))
def from_bytes(self, data: bytes) -> SubRipFile:
"""Parses given data and converts it to srt"""
return self.parse(BytesIO(data))
@abstractmethod
def parse(self, stream: BinaryIO) -> SubRipFile:
"""Parses data from a given stream and converts it to srt"""

View File

@ -0,0 +1,27 @@
import datetime
import json
from srt import Subtitle
from subby.converters.base import BaseConverter
from subby.subripfile import SubRipFile
class BilibiliJSONConverter(BaseConverter):
"""Bilibili JSON subtitle converter"""
def parse(self, stream):
json_data = json.load(stream)
srt = SubRipFile()
for i, line in enumerate(json_data['body']):
if line['location'] != 2:
line['content'] = ('{\\an%s}' % line['location']) + line['content']
srt.append(Subtitle(
index=i,
start=datetime.timedelta(seconds=line['from']),
end=datetime.timedelta(seconds=line['to']),
content=line['content']
))
return srt

View File

@ -0,0 +1,111 @@
from collections import deque
from pymp4.parser import MP4
from pymp4.util import BoxUtil
from subby.converters.base import BaseConverter
from subby.converters.smpte import SMPTEConverter
from subby.converters.webvtt import WebVTTConverter
from subby.subripfile import SubRipFile
from subby.utils.time import timestamp_from_ms
class ISMTConverter(BaseConverter):
"""ISMT (DFXP in MP4) subtitle converter"""
def parse(self, stream):
srt = SubRipFile([])
for box in MP4.parse(stream.read()):
if box.type == b'mdat':
new = SMPTEConverter().from_bytes(box.data)
# Offset timecodes if necessary
# https://github.com/SubtitleEdit/subtitleedit/blob/abd36e5/src/libse/SubtitleFormats/IsmtDfxp.cs#L85-L90
if srt and new and srt[-1].start > new[0].start:
new.offset(srt[-1].end)
srt.extend(new)
return srt
class WVTTConverter(BaseConverter):
"""WVTT (WebVTT in MP4) subtitle converter"""
def parse(self, stream): # pylint: disable=too-many-locals, too-many-branches
sample_durations = deque()
vtt_lines = []
timescale = 0
for box in MP4.parse(stream.read()):
if box.type == b'moov':
for mdhd in BoxUtil.find(box, b'mdhd'):
timescale = mdhd.timescale
break
for stsd in BoxUtil.find(box, b'stsd'):
wvtt = stsd.entries[0]
header = [box.config for box in wvtt.children
if box.type == b'vttC'][0]
vtt_lines.append(f'{header}\n\n')
break
if box.type == b'moof':
start_offset = 0
duration = 0
for tfdt in BoxUtil.find(box, b'tfdt'):
start_offset = tfdt.baseMediaDecodeTime
break
for trun in BoxUtil.find(box, b'trun'):
for sample in trun.sample_info:
start_offset += sample.sample_composition_time_offsets or 0
duration += sample.sample_duration or 0
sample_durations.append({
'start_ms': (start_offset / timescale) * 1000,
'end_ms': ((start_offset + duration) / timescale) * 1000
})
if box.type == b'mdat':
vtt_boxes = MP4.parse(box.data)
new_start = None
for vtt_box in vtt_boxes:
settings = None
for sttg in BoxUtil.find(vtt_box, b'sttg'):
settings = sttg.settings
break
cue_text = None
for payl in BoxUtil.find(vtt_box, b'payl'):
cue_text = payl.cue_text
break
try:
sample_duration = sample_durations.popleft()
except IndexError: # broken line, no durations found
continue
if vtt_box.type == b'vttc':
try:
start_ms = end_ms
except UnboundLocalError:
end_ms = sample_duration['end_ms']
start_ms = end_ms
else:
start_ms = sample_duration['start_ms']
end_ms = sample_duration['end_ms']
if vtt_box.type == b'vtte':
new_start = end_ms
continue
if new_start:
start_ms = new_start
new_start = None
vtt_lines.append((f'{timestamp_from_ms(start_ms)} --> '
f'{timestamp_from_ms(end_ms)} '
f'{settings}\n{cue_text}\n\n'))
return WebVTTConverter().from_string(''.join(vtt_lines))

View File

@ -0,0 +1,90 @@
from html.parser import HTMLParser
from srt import Subtitle
from subby.converters.base import BaseConverter
from subby.subripfile import SubRipFile
from subby.utils.time import timedelta_from_ms
class SAMIConverter(BaseConverter):
"""SAMI subtitle converter"""
def parse(self, stream):
return _SAMIConverter(stream.read().decode('utf-8-sig')).srt
# Internal converter class as we inherit from HTMLParser
class _SAMIConverter(HTMLParser):
def __init__(self, subtitle):
super().__init__()
self.lines = []
self.tags = []
self.srt = SubRipFile([])
self.line_list = []
self.feed(self._correct_tags(subtitle))
self._convert()
def handle_starttag(self, tag, attrs_org):
attrs = {}
for attr, val in attrs_org:
attrs[attr] = val
if tag == 'sync':
data = {'text': ''}
data.update(attrs)
self.lines.append(data)
self.tags.append({'name': tag, 'attrs': attrs})
def handle_data(self, data):
last_tag = self.tags[-1]['name']
if last_tag == 'br':
self.lines[-1]['text'] += '\n'
return
if last_tag == 'i' and data.strip():
self.lines[-1]['text'] += f'<i>{data}</i>'
return
if last_tag != 'sync' and self.lines:
self.lines[-1]['text'] += data
def _convert(self):
for num, line in enumerate(self.lines):
# Use empty lines as the end of previous line
if not line.get('text', '').strip():
end_time = float(line['start'])
self.line_list[-1]['end'] = end_time
continue
if not line.get('end'):
# Arbitrarily set duration to 4s if end time not present
line['end'] = float(line['start']) + 4000
srt_line = {
'start': float(line['start']),
'end': float(line['end']),
'content': line['text'].strip()
}
self.line_list.append(srt_line)
for num, line in enumerate(self.line_list):
srt_line = Subtitle(
index=num,
start=timedelta_from_ms(line['start']),
end=timedelta_from_ms(line['end']),
content=line['content']
)
self.srt.append(srt_line)
@staticmethod
def _correct_tags(data):
data = data.replace('<i/>', '<i>')
data = data.replace(';>', '>')
data = data.replace('<br>', '\n')
data = data.replace('<br/>', '\n')
data = data.replace('<br >', '\n')
return data

View File

@ -0,0 +1,168 @@
import html
import logging
import re
import bs4
from srt import Subtitle
from subby.converters.base import BaseConverter
from subby.subripfile import SubRipFile
from subby.utils.time import timedelta_from_timestamp, timestamp_from_ms
class SMPTEConverter(BaseConverter):
"""DFXP/TTML/TTML2 subtitle converter"""
def parse(self, stream):
data = stream.read().decode('utf-8-sig')
if data.count('</tt>') == 1:
return _SMPTEConverter(data).srt
# Support for multiple XML documents in a single file
smpte_subs = [s + '</tt>' for s in data.strip().split('</tt>') if s]
srt = SubRipFile([])
for sub in smpte_subs:
srt.extend(_SMPTEConverter(sub).srt)
return srt
# Internal converter class as we need to handle multiple subs in one stream
class _SMPTEConverter:
def __init__(self, data):
self.logger = logging.getLogger(__name__)
self.root = bs4.BeautifulSoup(data, 'lxml-xml')
# Unescape only if necessary (parsing fails)
if not self.root:
self.root = bs4.BeautifulSoup(html.unescape(data), 'lxml-xml')
self.srt = SubRipFile([])
self.tickrate = int(self.root.tt.get('ttp:tickRate', 0))
self.frame_duration = 1
if (rate := self.root.tt.get('ttp:frameRate')) is not None:
num, denom = map(int, self.root.tt.get('ttp:frameRateMultiplier', '1 1').split())
framerate = (int(rate) * num) / denom
self.frame_duration = (1 / framerate) * 1000 # ms
self.italics = {}
self.an8 = {}
self.all_span_italics = '<span tts:fontStyle="italic">' not in data
self._parse_styles()
self._convert()
def _convert(self):
try:
assert self.root.tt.body.div is not None
except (AttributeError, AssertionError):
return
for num, line in enumerate(self.root.tt.body.div.find_all('p'), 1):
line_text = ''
try:
for time in ('begin', 'end'):
if line[time].endswith('t'):
line[time] = self._convert_ticks(line[time])
elif line[time].endswith('ms'):
line[time] = timestamp_from_ms(line[time][:-2])
else:
line[time] = self._parse_timestamp(line[time])
except (AttributeError, KeyError):
self.logger.warning(
'Could not parse %s timestamp for line %02d, skipping',
time, num
)
continue
srt_line = Subtitle(
index=num,
start=timedelta_from_timestamp(line['begin']),
end=timedelta_from_timestamp(line['end']),
content=''
)
for element in line:
line_text += self._parse_element(element)
if self._is_italic(line) and line_text.strip():
line_text = line_text.replace('<i>', '')
line_text = line_text.replace('</i>', '')
line_text = '<i>%s</i>' % line_text.strip()
if self._is_an8(line) and line_text.strip():
line_text = '{\\an8}%s' % line_text.strip()
srt_line.content = line_text.strip().strip('\n')
if srt_line.content:
self.srt.append(srt_line)
def _parse_styles(self):
for style in self.root.find_all('style'):
if style.get('xml:id'):
self.italics[style['xml:id']] = self._is_italic(style)
for region in self.root.find_all('region'):
if region.get('xml:id'):
self.an8[region['xml:id']] = self._is_an8(region)
def _parse_element(self, element):
element_text = ''
if isinstance(element, bs4.element.NavigableString):
element_text += element
elif isinstance(element, bs4.element.Tag):
subelement_text = ''
for subelement in element:
subelement_text += self._parse_element(subelement)
element_text += subelement_text
if element.name == 'br':
element_text += '\n'
if self._is_italic(element) and element_text.strip():
element_text = element_text.replace('<i>', '')
element_text = element_text.replace('</i>', '')
element_text = '<i>%s</i>' % element_text
if self._is_an8(element) and element_text.strip():
element_text = '{\\an8}%s' % element_text
return element_text
def _is_italic(self, element):
if element.get('tts:fontStyle'):
return element.get('tts:fontStyle') == 'italic'
elif element.get('style'):
return self.italics.get(element['style'])
elif element.name == 'span' and not element.attrs and self.all_span_italics:
return not self._is_italic(element.parent)
return False
def _is_an8(self, element):
if element.get('tts:displayAlign'):
return element.get('tts:displayAlign') == 'before'
elif element.get('region'):
return self.an8.get(element['region'])
return False
def _convert_ticks(self, ticks):
ticks = int(ticks[:-1])
offset = 1.0 / self.tickrate
seconds = (offset * ticks) * 1000
return timestamp_from_ms(seconds)
def _parse_timestamp(self, timestamp):
regex = r'([0-9]{2}):([0-9]{2}):([0-9]{2})[:\.,]?([0-9]{0,3})?'
parsed = re.search(regex, timestamp)
hours = int(parsed.group(1))
minutes = int(parsed.group(2))
seconds = int(parsed.group(3))
miliseconds = 0
if frames := parsed.group(4):
miliseconds = self.frame_duration * int(frames)
return "%02d:%02d:%02d.%03d" % (hours, minutes, seconds, miliseconds)

View File

@ -0,0 +1,162 @@
from __future__ import annotations
import html
import re
from functools import partial
from typing import Optional
import tinycss
from srt import Subtitle
from subby.converters.base import BaseConverter
from subby.subripfile import SubRipFile
from subby.utils.time import timedelta_from_timestamp
HTML_TAG = re.compile(r'</?(?!/?i)[^>\s]+>')
STYLE_TAG_OPEN = re.compile(r'^<c.([a-zA-Z0-9]+)>([^<]+)')
STYLE_TAG = re.compile(r'<c.([a-zA-Z0-9]+)>([^<]+)<\/c>')
STYLE_TAG_CLOSE = re.compile(r'<\/c>$')
SKIP_WORDS = ('WEBVTT', 'NOTE', '/*', 'X-TIMESTAMP-MAP')
SPEAKER_TAG = re.compile(r'<v\s+[^>]+>') # Matches opening <v Name> tags, closing tags handled by STYLE_TAG_CLOSE
class WebVTTConverter(BaseConverter):
"""WebVTT subtitle converter"""
def parse(self, stream):
srt = SubRipFile()
looking_for_text = False
looking_for_style = False
text = []
position = None
line_number = 1
styles = {}
current_style = []
css_parser = tinycss.make_parser('page3')
for line in stream:
# As our stream is bytes we have to deal with line breaks here
line = line.decode('utf-8').replace('\r\n', '\n').replace('\r', '\n').strip()
# Skip processing any unnecessary lines
if any(line.startswith(word) for word in SKIP_WORDS):
continue
# Empty line separates cues
if line == '':
# Parse current style
if looking_for_style:
stylesheet = css_parser.parse_stylesheet('\n'.join(current_style))
for rule in stylesheet.rules:
ft = next((e for e in rule.selector if e.type == 'FUNCTION'), None)
if not ft:
continue
name = next((t for t in ft.content if t.type == 'IDENT'), None)
if not name:
continue
styles[name.value] = {}
for dec in rule.declarations:
styles[name.value][dec.name] = dec.value.as_css()
looking_for_style = False
# Keep looking for text if last line has none
# this will only happen if there's an unexpected line break
if not text:
continue
srt[-1].content = '\n'.join(text)
text = []
looking_for_text = False
# Check for style start
elif 'STYLE' in line:
looking_for_style = True
# Check for style content
elif looking_for_style:
current_style.append(line)
# Check for time line
elif ' --> ' in line:
parts = line.strip().split()
position = self._get_position([p for p in parts[3:] if ':' in p])
start, _, end, *_ = parts
# Fix short timecodes (no hour)
if start.count(':') == 1:
start = f'00:{start}'
if end.count(':') == 1:
end = f'00:{end}'
srt.append(Subtitle(
index=line_number,
start=timedelta_from_timestamp(start),
end=timedelta_from_timestamp(end),
content=''
))
looking_for_text = True
line_number += 1
# Append text if we're inside a line
elif looking_for_text:
# Unescape html entities
line = html.unescape(line)
# Remove speaker tags here
line = re.sub(SPEAKER_TAG, '', line)
# Set \an8 tag if position is below 25
# (value taken from SubtitleEdit)
if position is not None and position < 25:
line = '{\\an8}' + line
position = None
text.append(line.strip())
# Add any leftover text to the last line
if text:
srt[-1].content += '\n'.join(text)
for line in srt:
# Replace styles with italics tag when appropriate
# (replace instead of match, to handle nested)
line.content = re.sub(
STYLE_TAG,
partial(self._replace_italics, styles=styles),
line.content
)
# Strip non-italic tags
line.content = re.sub(HTML_TAG, '', line.content)
return srt
@staticmethod
def _get_position(cue_settings: list[str]) -> Optional[float]:
"""
Parses list of cue settings and extracts position offset as a float
Line number based offset and alignment strings are ignored
https://www.w3.org/TR/webvtt1/#webvtt-line-cue-setting
"""
if not cue_settings or cue_settings == ['None']:
return None
position = None
for key, val in (pos.split(':') for pos in cue_settings):
if key == 'line' and val and (val := val.split(',')[0])[-1] == '%':
position = float(val[:-1])
break
elif key == 'line' and val and val == '0':
position = 0
break
return position
@staticmethod
def _replace_italics(match: re.Match, styles: dict[str, dict[str, str]]) -> str:
if (s := styles.get(match[1])) and s.get('font-style') == 'italic':
return f'<i>{match[2]}</i>'
return match[0]

View File

@ -0,0 +1,30 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from pathlib import Path
from subby.subripfile import SubRipFile
class BaseProcessor(ABC):
"""Base subtitle processor class"""
def from_srt(self, srt: SubRipFile, language: str | None = None) -> tuple[SubRipFile, bool]:
"""Processes given SubRipFile"""
return self.process(srt, language)
def from_file(self, file: Path, language: str | None = None) -> tuple[SubRipFile, bool]:
"""Processes given srt file"""
with file.open(mode='r', encoding='utf-8') as stream:
return self.from_string(stream.read(), language)
def from_string(self, data: str, language: str | None = None) -> tuple[SubRipFile, bool]:
"""Processes given string with srt subtitles"""
return self.process(SubRipFile.from_string(data), language)
@abstractmethod
def process(self, srt: SubRipFile, language: str | None = None) -> tuple[SubRipFile, bool]:
"""
Processes given SubRipFile
:return: Processed SubRipFile, success (whether any changes were made)
"""

View File

@ -0,0 +1,278 @@
import copy
import datetime
import html
import re
import unicodedata
from datetime import timedelta
import langcodes
from subby import regex as Regex
from subby.processors.base import BaseProcessor
from subby.processors.rtl import RTL_LANGUAGES, RTLFixer
from subby.subripfile import SubRipFile
from subby.utils.time import line_duration
class CommonIssuesFixer(BaseProcessor):
"""Processor fixing common issues found in subtitles"""
remove_gaps = True
def process(self, srt, language=None):
fixed = self._fix_time_codes(copy.deepcopy(srt))
corrected = self._correct_subtitles(fixed)
if language and langcodes.get(language).language in RTL_LANGUAGES:
corrected, _ = RTLFixer().process(corrected, language=language)
return corrected, corrected != srt
def _correct_subtitles(self, srt: SubRipFile) -> SubRipFile:
def _fix_line(line):
# [GENERAL] - Affects other regexes
# Remove more than one space
line = re.sub(r' {2,}', ' ', line)
# Correct lines starting with space
line = re.sub(r'^\s*', '', line)
line = re.sub(r'\n\s*', '\n', line)
#
# [ENCODING FIXES, CHARACTER REPLACEMENTS]
# Fix musical notes garbled by encoding
# has to happen before normalization as that replaces the TM char
line = line.replace(r'♪', '')
# Normalize unicode characters
line = unicodedata.normalize('NFKC', line)
# Replace short hyphen with regular size
line = line.replace(r'', r'-')
# Replace double note with single note
line = line.replace(r'', r'')
# Replace hashes, asterisks at the start of a line with a musical note
line = re.sub(
r'^((?:{\\an8})?(?:<i>)?)(- ?)?[#\*]{1,}(?=\s+)',
r'\1\2♪',
line,
flags=re.M
)
# Replace hashes, asterisks at the end of a line with a musical note
line = re.sub(
r'(?<=\s)(?<![#\*])(?:[#\*]{1,3}|[#\*]{1,3})(?![0-9A-Z])(</i>$|$)',
r'\1',
line,
flags=re.M
)
line = re.sub(r'^[#\*]+$', r'', line, flags=re.M)
# Move notes into italics, if rest of the line is
line = re.sub(r'♪ <i>(.*)', r'<i>♪ \1', line)
line = re.sub(r'(♪.*)</i>\s*♪', r'\1 ♪</i>', line)
# Replace some pound signs with notes (Binge...)
# (Matches only start/end of a line with a space
# to avoid false positives)
line = re.sub(r'', r'', line)
line = re.sub(r' £$', r'', line)
# Duplicated notes
line = re.sub(r'{1,}', r'', line)
# Add spaces between notes and text
line = re.sub(r'^♪([A-Za-z])', r'\1', line)
line = re.sub(r'([A-Za-z])♪', r'\1 ♪', line)
# Replace \h (non-breaking space in ASS) with a regular space
# (result of ffmpeg extraction of mp4-embedded subtitles)
line = re.sub(r'(\\h)+', ' ', line).strip()
# Fix leftover amps (html unescape fixes those, but not when they're duped)
line = re.sub(r'&(amp;){1,}', r'&', line)
# Fix "it'`s" -> "it's"
line = re.sub(r"'[`]", r"'", line)
# [TAG STRIPPING AND CORRECTING]
#
# Replace ASS positioning tags with top only
line = re.sub(r'(\{\\an[0-9]\}){1,}', r'{\\an8}', line)
# Remove space after ASS positioning tags
line = re.sub(r'(\{\\an[0-9]\}) +(?=[A-Za-z-])', r'{\\an8}', line)
# Fix hanging tags
line = re.sub(r'^(<[a-z]>)\n', r'\1', line)
line = re.sub(r'</([a-z])>$\n<([a-z])>', r'\n', line, flags=re.M)
# Remove duplicated tags
line = re.sub(r'(<[a-z]>){1,}', r'\1', line)
line = re.sub(r'(</[a-z]>){1,}', r'\1', line)
# Remove an unnecessary space after italic tag open
line = re.sub(r'^(<[a-z]>) {1,}', r'\1', line)
line = re.sub(r'^ {1,}', '', line)
# Remove non-italic tags
line = re.sub(r'</?(?!i>)[a-z]+>', '', line)
# Remove spaces between tags
line = re.sub(r'(<[a-z]>|\{\\an8\}) (<[a-z]>|\{\\an8\})', r'\1\2', line)
# Move hanging opening tags onto separate lines
line = re.sub(r'(<[a-z]>)\n', r'\n\1', line)
# Move hanging closing tags onto separate lines
line = re.sub(r'\n(</[a-z]>)', r'\1\n', line)
# Move spaces outside italic tags
line = re.sub(r'(<[a-z]>) ', r' \1', line)
line = re.sub(r' (</[a-z]>)', r'\1 ', line)
# Remove needless spaces inside italic tags
line = re.sub(r'^(<[a-z]>) ', r'\1', line)
# Fix "</tag>space<tag>"
line = re.sub(r'(?:</[a-z]>)(\s*)(?:<[a-z]>)', r'\1', line, flags=re.M)
# Remove empty tags
line = re.sub(r'<[a-z]>\s*</[a-z]>', r'', line)
# Move "{\an8}" to the rest of the text if it's on a new line
line = re.sub(r'({\\an8\})\n', r'\1', line)
# [REFORMATTING]
#
# Remove spaces inside brackets ("( TEXT )" -> "(TEXT)")
line = re.sub(r'\( (.*) \)', r'(\1)', line)
# Remove ">> " before text
line = re.sub(r'(^|\n)(</?[a-z]>|\{\\an8\})?>> ', r'\1\2', line)
# Remove lines consisting only of ">>"
line = re.sub(r'(^|\n)(</?[a-z]>|\{\\an8\})?>>($|\n)', r'', line)
# Replace any leftover <br> tags with a proper line break
line = re.sub(r'<br ?\/?>', '\n', line)
# Remove empty lines
line = re.sub(r'^\.?\s*$', '', line, flags=re.M)
line = re.sub(r'^-?\s*$', '', line, flags=re.M)
line = re.sub(r'^(</?i>|\{\\an8\})?\s*$', '', line, flags=re.M)
# Remove lines consisting only of a single character or digit
line = re.sub(r'^\[A-Za-z0-9]$', '', line)
# Adds missing spaces after "...", commas, and tags
line = re.sub(r'([a-z])(\.\.\.)([a-zA-Z][^.])', r'\1\2 \3', line)
line = re.sub(r'(</[a-z]>)(\w)', r'\1 \2', line)
line = re.sub(r'([a-z]),([a-zA-Z])', r'\1, \2', line)
line = re.sub(r',\n([a-z]+[\.\?])\s*$', r', \1', line)
# Correct front and end elypses
line = re.sub(
rf'({Regex.FRONT_OPTIONAL_TAGS_WITH_HYPHEN})' r'\.{1,}',
r'\1...',
line, flags=re.M
)
line = re.sub(r'\.{2,}' rf'({Regex.TAGS})?' r'\s*$', r'...\1', line, flags=re.M)
# Add space after frontal speaker hyphen
line = re.sub(r"^(<i>|\{\\an8\})?-+(?='?[\w\"\[\(\<\{\.\$♪¿¡])", r'\1- ', line, flags=re.M)
# Remove unnecessary space before "--"
line = re.sub(r'\s*--(\s*)', r'--\1', line, flags=re.M)
# Move notes inside tags (</i> ♪ -> </i>)
line = re.sub(r'(</[a-z]>)(\s*♪{1,})$', r'\2\1', line, flags=re.M)
# Remove trailing spaces
line = re.sub(r' +$', r'', line, flags=re.M).strip()
# [LINE SPLITS AND LINE BREAKS]
#
# Adds missing line splits (primarily present in Amazon subtitles)
line = re.sub(r'(.*)([^.][\]\)])([A-Z][^.])', r'\1\2\n\3', line)
line = re.sub(
r'(.*)([^\.\sA-Z][!\.;:?])(?<!(?:Mr|Ms)\.)(?<!Mrs\.)([A-Z][^.])',
r'- \1\2\n- \3',
line
)
# Fix weird linebreaks (caused by stripping SDH or not)
line = re.sub(r'(^<[a-z]>|\n<[a-z]>)(\w+)\n', r'\1\2 ', line)
# Add missing hyphens
line = re.sub(r'^\s*(?!-)(.*)\n- ([A-Z][a-z]+)$', r'- \1\n- \2', line)
# Remove linebreaks inside lines
line = re.sub(r'\r\n{1,}', r'\r\n', line).strip()
line = re.sub(r'\n{1,}', r'\n', line).strip()
# Remove duplicate spaces around italics
line = re.sub(r' +</i> +', r'</i> ', line).strip()
# Remove italics from hyphen, when content immediately following is not italics
line = re.sub(r'<i>-</i>([^<]+)', r'-\1', line).strip()
return line
for line in srt:
# Unescape html entities (twice, because yes, double encoding happens...)
for _ in range(2):
line.content = html.unescape(line.content)
# Run fix_line twice, as some of the fixes can introduce issues, e.g. double spaces
for _ in range(2):
line.content = _fix_line(line.content)
line.content = line.content.strip()
# Remove remaining linebreaks
line.content = line.content.strip('\n')
# Remove italics if every line is italicized, as this is almost certainly a mistake
# (using slices should be more performant than regex or startswith/endswith)
if len(srt) > 10 \
and all(line.content[:3] == '<i>' and line.content[-4:] == '</i>' for line in srt):
for line in srt:
line.content = line.content[3:-4]
combined = self._combine_timecodes(srt)
if self.remove_gaps:
return self._remove_gaps(combined)
return combined
def _combine_timecodes(self, srt: SubRipFile) -> SubRipFile:
"""Combines lines with timecodes and same content"""
subs_copy = SubRipFile([])
for line in srt:
if len(subs_copy) == 0:
subs_copy.append(line)
continue
if line_duration(subs_copy[-1]) == line_duration(line) \
and subs_copy[-1].start == line.start \
and subs_copy[-1].end == line.end:
if subs_copy[-1].content != line.content:
subs_copy[-1].content += '\n' + line.content
# Merge lines with the same text within 10 ms
elif self._subtract_ts(line.start, subs_copy[-1].end) < 10 \
and line.content == subs_copy[-1].content:
subs_copy[-1].end = line.end
# Merge lines with less than 2 frames of gap and same text
# to avoid duplicating lines as we remove gaps later
elif 0 < self._subtract_ts(line.start, subs_copy[-1].end) <= 85 \
and line.content.startswith(subs_copy[-1].content) \
and self.remove_gaps:
subs_copy[-1].end = line.end
subs_copy[-1].content = line.content
# Fix overlapping times
elif self._subtract_ts(line.start, subs_copy[-1].end) == 0:
subs_copy[-1].end -= timedelta(milliseconds=1)
subs_copy.append(line)
elif line.content.strip():
subs_copy.append(line)
subs_copy = subs_copy or srt
subs_copy.clean_indexes()
return subs_copy
def _remove_gaps(self, srt: SubRipFile) -> SubRipFile:
"""Remove short gaps between lines"""
subs_copy = SubRipFile([])
for line in srt:
if len(subs_copy) == 0:
subs_copy.append(line)
continue
# Remove 2-frame or smaller gaps (2 frames/83ms@24 is Netflix standard)
elif 1 < self._subtract_ts(line.start, subs_copy[-1].end) <= 85:
line.start = subs_copy[-1].end
subs_copy[-1].end -= timedelta(milliseconds=1)
subs_copy.append(line)
elif line.content.strip():
subs_copy.append(line)
subs_copy = subs_copy or srt
subs_copy.clean_indexes()
return subs_copy
@staticmethod
def _fix_time_codes(srt: SubRipFile) -> SubRipFile:
"""Fixes timecodes over 23:59, often present in live content"""
offset = 0
for line in srt:
hours, _ = divmod(line.start.seconds, 3600)
hours += line.start.days * 24
if not offset and hours > 23:
offset = hours
if offset:
line.start -= datetime.timedelta(hours=offset)
line.end -= datetime.timedelta(hours=offset)
return srt
@staticmethod
def _subtract_ts(ts1: datetime.timedelta, ts2: datetime.timedelta) -> int:
"""Subtracts two timestamps and returns a difference as int of miliseconds"""
return round((ts1 - ts2).total_seconds() * 1000)

View File

@ -0,0 +1,34 @@
import logging
import langcodes
from subby.processors.base import BaseProcessor
RTL_LANGUAGES = ('ar', 'fa', 'he', 'ps', 'syc', 'ug', 'ur')
RTL_CONTROL_CHARS = ('\u200e', '\u200f', '\u202a', '\u202b', '\u202c', '\u202d', '\u202e')
RTL_CHAR = '\u202b'
class RTLFixer(BaseProcessor):
"""Processor fixing right-to-left language tagging"""
def __init__(self):
self.logger = logging.getLogger(__name__)
def process(self, srt, language=None):
if language and langcodes.get(language).language not in RTL_LANGUAGES:
self.logger.warning('RTL tagger running on an unexpected language (%s)', language)
corrected = self._correct_subtitles(srt)
return srt, corrected != srt
def _correct_subtitles(self, srt):
for line in srt:
# Remove previous RTL-related formatting
for char in RTL_CONTROL_CHARS:
line.content = line.content.replace(char, '')
# Add RLM char at the start of every line
line.content = RTL_CHAR + line.content.replace("\n", f"\n{RTL_CHAR}")
return srt

View File

@ -0,0 +1,109 @@
from __future__ import annotations
import copy
import re
from subby import regex as Regex
from subby.processors.base import BaseProcessor
from subby.subripfile import SubRipFile
class SDHStripper(BaseProcessor):
"""Processor removing hard-of-hearing descriptions from subtitles"""
def __init__(self, extra_regexes: list[str] | None = None):
self.extra_regexes = [
re.compile(regex, re.MULTILINE)
for regex in extra_regexes or []
]
def process(self, srt, language=None):
stripped = [line for line in copy.deepcopy(srt)]
stripped = self._clean_full_line_descriptions(stripped)
stripped = self._clean_new_line_descriptions(stripped)
stripped = self._clean_inline_descriptions(stripped)
stripped = self._clean_speaker_names(stripped)
stripped = self._strip_notes(stripped)
stripped = self._remove_extra_hyphens(stripped)
stripped = self._run_extra_regexes(stripped)
stripped = SubRipFile([line for line in stripped if line.content])
stripped.clean_indexes()
return stripped, stripped != srt
def _clean_full_line_descriptions(self, srt):
"""Removes full line descriptions"""
for line in srt:
text = self._strip_tags(line.content)
for regex in (Regex.FULL_LINE_DESCIRPTION_BRACKET, Regex.FULL_LINE_DESCIRPTION_PARENTHESES):
text = re.sub(regex, r'', text, flags=re.S).strip()
if not text:
continue
yield line
def _clean_new_line_descriptions(self, srt):
"""Removes line descriptions taking up an entire line break"""
for line in srt:
position = re.match(Regex.POSITION_TAGS, line.content.strip())
for regex in (Regex.NEW_LINE_DESCRIPTION_BRACKET, Regex.NEW_LINE_DESCRIPTION_PARENTHESES):
line.content = re.sub(regex, r'', line.content, flags=re.M).strip()
# Restore position, if it has been removed with the description
if position and position[0] not in line.content:
line.content = position[0] + line.content
yield line
def _clean_inline_descriptions(self, srt):
"""Removes inline"""
for line in srt:
line.content = re.sub(Regex.FRONT_DESCRIPTION_BRACKET, r'\10', line.content, flags=re.M)
line.content = re.sub(Regex.FRONT_DESCRIPTION_PARENTHESES, r'\1', line.content, flags=re.M)
for regex in (
Regex.END_DESCRIPTION_BRACKET,
Regex.END_DESCRIPTION_PARENTHESES,
Regex.INLINE_DESCRIPTION
):
line.content = re.sub(regex, r'', line.content, flags=re.M)
line.content = line.content.strip()
yield line
def _clean_speaker_names(self, srt):
"""Removes speaker names"""
for line in srt:
# Retain frontal tags/hyphens
for regex in (Regex.SPEAKER_PARENTHESES, Regex.SPEAKER):
line.content = re.sub(regex, r'\2\3', line.content, flags=re.M).strip()
yield line
def _strip_notes(self, srt):
"""Removes lines with just musical notes"""
for line in srt:
if re.match(r'^♪+$', re.sub(r'\s*', r'', self._strip_tags(line.content).strip())):
continue
yield line
def _run_extra_regexes(self, srt):
"""Runs extra regexes provided by user"""
for line in srt:
for regex in self.extra_regexes:
line.content = re.sub(regex, r'', line.content)
yield line
def _remove_extra_hyphens(self, srt):
"""Remove speaker hyphens if there's only one line"""
for line in srt:
splits = len(re.findall(r'^(<i>|\{\\an8\})?-\s*', line.content, flags=re.M))
if splits == 1:
line.content = re.sub(r'^(<i>|\{\\an8\})?-\s*', r'\1', line.content.strip())
yield line
@staticmethod
def _strip_tags(text: str) -> str:
return re.sub(Regex.TAGS, r'', text)

View File

@ -0,0 +1,22 @@
TAGS = r'[<{][/\\]?[a-z0-9.]+[}>]'
POSITION_TAGS = r'^{\\an[0-9]}'
FRONT_OPTIONAL_TAGS_WITH_HYPHEN = rf'^\s*({TAGS})?\s*(-)?\s*({TAGS})?\s*'
TIME_LOOKAHEAD = r'(?![0-9]{2})'
SPEAKER = rf'({FRONT_OPTIONAL_TAGS_WITH_HYPHEN})\s*(Mc[A-Z][a-zA-Z]+|[A-Z0-9\&\[\]\.#\' ]+\s*|[A-Z][a-z]+):{TIME_LOOKAHEAD} ?'
SPEAKER_PARENTHESES = rf'({FRONT_OPTIONAL_TAGS_WITH_HYPHEN})\s*(?:[A-Z0-9\&\[\]\.#\' ]+\s*|[A-Z][a-z]+)(?: \([a-zA-Z ]+\)): ?'
FRONT_NOTES = r'(?:♪+\s+)'
BACK_NOTES = r'(?:\s+♪+)'
DESCRIPTION_BRACKET = r'\[(?:[^\]]|\s)*\]'
DESCRIPTION_PARENTHESES = r'\((?:[^\)]|\s)*\)'
FULL_LINE_DESCIRPTION_BRACKET = rf'^-?\s*{FRONT_NOTES}?\[[^\]]+\]{BACK_NOTES}?$'
NEW_LINE_DESCRIPTION_BRACKET = rf'^(?:{TAGS})?-?\s*{FRONT_NOTES}?{DESCRIPTION_BRACKET}(?:{TAGS})?{BACK_NOTES}?$'
FRONT_DESCRIPTION_BRACKET = rf'^(?:{SPEAKER}|{SPEAKER_PARENTHESES})?({FRONT_OPTIONAL_TAGS_WITH_HYPHEN}){DESCRIPTION_BRACKET}:?'
END_DESCRIPTION_BRACKET = rf'\s*{DESCRIPTION_BRACKET}\s*$'
FULL_LINE_DESCIRPTION_PARENTHESES = rf'^-?\s*{FRONT_NOTES}?\([^\)]+\){BACK_NOTES}?$'
NEW_LINE_DESCRIPTION_PARENTHESES = rf'^(?:{TAGS})?-?\s*{FRONT_NOTES}?{DESCRIPTION_PARENTHESES}{BACK_NOTES}?(?:{TAGS})?$'
FRONT_DESCRIPTION_PARENTHESES = rf'^({FRONT_OPTIONAL_TAGS_WITH_HYPHEN})(?:{SPEAKER}|{SPEAKER_PARENTHESES})?{DESCRIPTION_PARENTHESES}:?'
END_DESCRIPTION_PARENTHESES = rf'\s*{DESCRIPTION_PARENTHESES}:?\s*$'
INLINE_DESCRIPTION = r'(?:<[a-z]+>)?[\[(][A-Za-z]+[)\]](?:</[a-z]+>)?'

View File

@ -0,0 +1,38 @@
from __future__ import annotations
from collections import UserList
from datetime import timedelta
from pathlib import Path
import srt
class SubRipFile(UserList):
def __init__(self, data: list[srt.Subtitle] | None = None):
self.data: list[srt.Subtitle] = data or []
@classmethod
def from_string(cls, source: str):
return cls(list(srt.parse(source, ignore_errors=True)))
def clean_indexes(self):
self.data = list(srt.sort_and_reindex(self.data))
def offset(self, offset: timedelta):
for line in self.data:
line.start += offset
line.end += offset
def export(self, eol: str | None = None) -> str:
"""Exports subtitle as text"""
return srt.compose(self.data, eol=eol)
def save(self, path: Path, encoding: str = 'utf-8-sig', eol: str | None = None):
"""Exports subtitle as text"""
with path.open(mode='wb') as fp:
fp.write(srt.compose(self.data, eol=eol).encode(encoding))
def __eq__(self, other):
if not isinstance(other, SubRipFile):
raise NotImplementedError
return self.export(eol='\n') == other.export(eol='\n')

View File

@ -0,0 +1,44 @@
from __future__ import annotations
import datetime
import re
from srt import Subtitle
def timestamp_from_ms(duration: float | int) -> str:
"""Returns a formatted timestamp from miliseconds"""
seconds, miliseconds = divmod(float(duration), 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
return "%02d:%02d:%02d.%03d" % (hours, minutes, seconds, miliseconds)
def timestamp_from_seconds(duration: float | int) -> str:
"""Returns a formatted timestamp from seconds"""
return timestamp_from_ms(duration * 1000)
def ms_from_timestamp(timestamp: str) -> int:
"""Returns miliseconds from a timestamp"""
timestamp = re.sub(r'[;\.\,]', r':', timestamp.replace('T:', ''))
hours, minutes, seconds, miliseconds = map(int, timestamp.split(':'))
miliseconds += hours * 3600000
miliseconds += minutes * 60000
miliseconds += seconds * 1000
return miliseconds
def timedelta_from_timestamp(timestamp: str) -> datetime.timedelta:
"""Returns timedelta from a timestamp"""
return datetime.timedelta(seconds=ms_from_timestamp(timestamp) / 1000)
def timedelta_from_ms(duration: float | int) -> datetime.timedelta:
"""Returns timedelta from miliseconds"""
return datetime.timedelta(seconds=duration / 1000)
def line_duration(line: Subtitle):
"""Returns duration of a srt.Subtitle line"""
return abs(line.end - line.start)

View File

@ -1,44 +0,0 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['vinetrimmer\\vinetrimmer.py'],
pathex=['E:\\PitbullTools\\VT-0.1.0'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=True,
win_private_assemblies=True,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='vinetrimmer',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None , icon='assets\\icon.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='vinetrimmer')

View File

@ -7,6 +7,8 @@ import subprocess
import sys
import traceback
from http.cookiejar import MozillaCookieJar
import urllib3
import time
import click
@ -27,6 +29,7 @@ from vinetrimmer.utils.click import (AliasedGroup, ContextData, acodec_param, la
from vinetrimmer.utils.collections import as_list, merge_dict
from vinetrimmer.utils.io import load_yaml
from pywidevine import Device, Cdm, RemoteCdm
from pywidevine import PSSH as PSSHWV
from vinetrimmer.vendor.pymp4.parser import Box
@ -98,7 +101,7 @@ def get_cdm(log, service, profile=None, cdm_name=None):
device = Device.load(os.path.join(directories.devices, f"{cdm_name}.wvd"))
except:
device_path = os.path.abspath(os.path.join(directories.devices, f"{cdm_name}.prd"))
if ( int( time.time() ) - int( os.path.getmtime( device_path ) ) ) > 600000: #roughly a week
if ( int( time.time() ) - int( os.path.getmtime( device_path ) ) ) > 160000: #roughly 2 days
try:
reprovision_device(device_path)
log.info(f" + Reprovisioned Playready Device (.prd) file, {cdm_name}")
@ -108,27 +111,30 @@ def get_cdm(log, service, profile=None, cdm_name=None):
return device
except FileNotFoundError:
try:
return Device.from_dir(os.path.join(directories.devices, cdm_name))
device = Device.from_dir(os.path.join(directories.devices, cdm_name))
return device
except:
pass
cdm_api = next(iter(x for x in config.cdm_api if x["name"] == cdm_name), None)
if cdm_api:
device = None
try:
return RemoteCdm(**cdm_api)
device = RemoteCdm(**cdm_api)
except:
from vinetrimmer.utils.widevine.device import RemoteDevice
return RemoteDevice(**cdm_api) # seller distributed some wack version of serve in pywidevine
device = RemoteDevice(**cdm_api) # seller distributed some wack version of serve in pywidevine
finally:
return device
raise ValueError(f"Device {cdm_name!r} not found")
def get_service_config(service):
"""Get both service config and service secrets as one merged dictionary."""
#print(filenames.service_config.format(service=service.lower())) # This line is probably where the error while loading config under Linux originates #TO-DO
service_config = load_yaml(filenames.service_config.format(service=service.lower()))
user_config = (load_yaml(filenames.user_service_config.format(service=service.lower()))
or load_yaml(filenames.user_service_config.format(service=service)))
user_config = (load_yaml(filenames.user_service_config.format(service=service.lower())) or load_yaml(filenames.user_service_config.format(service=service)))
if user_config:
merge_dict(service_config, user_config)
@ -167,6 +173,17 @@ def get_cookie_jar(service, profile):
return cookie_jar
return None
def save_cookies(service_name, service, profile):
"""Save cookies from service session to profile's cookies."""
cookie_file = os.path.join(directories.cookies, service_name.lower(), f"{profile}.txt")
if not os.path.isfile(cookie_file):
cookie_file = os.path.join(directories.cookies, service_name , f"{profile}.txt")
if os.path.isfile(cookie_file):
cookie_jar = MozillaCookieJar(cookie_file)
for cookie in service.session.cookies:
cookie_jar.set_cookie(cookie)
cookie_jar.save(ignore_discard=False, ignore_expires=False)
def get_credentials(service, profile="default"):
"""Get the profile's credentials if available."""
@ -194,22 +211,30 @@ def get_credentials(service, profile="default"):
help="Profile to use when multiple profiles are defined for a service.")
@click.option("-q", "--quality", callback=quality_param, default=None,
help="Download Resolution, defaults to best available.")
@click.option("-cr", "--closest-resolution", is_flag=True, default=False,
help="If resolution specified not found, defaults to closest resolution available")
@click.option("-v", "--vcodec", callback=vcodec_param, default="H264",
help="Video Codec, defaults to H264.")
@click.option("-a", "--acodec", callback=acodec_param, default=None,
help="Audio Codec")
@click.option("-vb", "--vbitrate", "vbitrate", type=int,
@click.option("-vb", "--vbitrate", "vbitrate", type=str,
default=None,
help="Video Bitrate, defaults to Max.")
@click.option("-ab", "--abitrate", "abitrate", type=int,
default=None,
help="Audio Bitrate, defaults to Max.")
@click.option("-ac", "--audio-channels", type=str, default=None,
help="Select Audio by Channels Configuration, e.g `2.0`, `5.1`, `2.0,5.1`")
@click.option("-mac", "--max-audio-compatability", is_flag=True, default=False,
help="Select multiple audios for maximum compatibility with all devices")
@click.option("-aa", "--atmos", is_flag=True, default=False,
help="Prefer Atmos Audio")
@click.option("-r", "--range", "range_", callback=range_param, default="SDR",
help="Video Color Range, defaults to SDR.")
@click.option("-w", "--wanted", callback=wanted_param, default=None,
help="Wanted episodes, e.g. `S01-S05,S07`, `S01E01-S02E03`, `S02-S02E03`, e.t.c, defaults to all.")
@click.option("-le", "--latest-episode", is_flag=True, default=False,
help="Download the latest episode on episodes list.")
@click.option("-al", "--alang", callback=language_param, default="orig",
help="Language wanted for audio.")
@click.option("-sl", "--slang", callback=language_param, default="all",
@ -251,6 +276,10 @@ def get_credentials(service, profile="default"):
help="Do not mux the downloaded and decrypted tracks.")
@click.option("--mux", is_flag=True, default=False,
help="Force muxing when using --audio-only/--subs-only/--chapters-only.")
@click.option("-ss", "--strip-sdh", is_flag=True, default=False,
help="Stip SDH subtitles and convert them to CC. Plus fix common errors.")
@click.option("-mf", "--match-forced", is_flag=True, default=False,
help="Only select forced subtitles matching with specified audio language")
@click.pass_context
def dl(ctx, profile, cdm, *_, **__):
log = logging.getLogger("dl")
@ -278,9 +307,10 @@ def dl(ctx, profile, cdm, *_, **__):
except ValueError as e:
raise log.exit(f" - {e}")
device_name = device.system_id if "set_service_certificate" in dir(device) else device.get_name()
log.info(f" + Loaded {device.__class__.__name__}: {device_name} (L{device.security_level})")
cdm = Cdm(device) if "set_service_certificate" in dir(device) else CdmPr.from_device(device)
device_name = device.system_id if "vmp" in dir(device) else device.get_name().replace("_", " ").upper()
s = "" if "vmp" in dir(device) else "S"
log.info(f" + Loaded {device.__class__.__name__}: {device_name} ({s}L{device.security_level})")
cdm = Cdm.from_device(device) if "vmp" in dir(device) else CdmPr.from_device(device)
if profile:
cookies = get_cookie_jar(service, profile)
@ -300,11 +330,10 @@ def dl(ctx, profile, cdm, *_, **__):
credentials=credentials,
)
@dl.result_callback()
@click.pass_context
def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs_only, chapters_only, audio_description,
list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate: int, abitrate: int, no_mux, mux, selected, *_, **__):
def result(ctx, service, quality, closest_resolution, range_, wanted, alang, slang, acodec, audio_only, subs_only, chapters_only, audio_description, audio_channels, max_audio_compatability, match_forced,
list_, keys, cache, no_cache, no_subs, no_audio, no_video, no_chapters, atmos, vbitrate, abitrate: int, no_mux, mux, selected, latest_episode, strip_sdh, *_, **__):
def ccextractor():
log.info("Extracting EIA-608 captions from stream with CCExtractor")
track_id = f"ccextractor-{track.id}"
@ -330,6 +359,12 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
service_name = service.__class__.__name__
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # Disable insecure request warnings
if service_name in ["DisneyPlus", "Hulu"]: # Always retrieve fresh keys for DSNP so that content_keys variable has 2 kid:key pairs, change this to fetch all keys for title from cache
global content_keys
no_cache = True
log.info("Retrieving Titles")
try:
titles = Titles(as_list(service.get_titles()))
@ -341,6 +376,9 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
titles.order()
titles.print()
if latest_episode:
titles = Titles(as_list(titles[-1]))
for title in titles.with_wanted(wanted):
if title.type == Title.Types.TV:
log.info("Getting tracks for {title} S{season:02}E{episode:02}{name} [{id}]".format(
@ -384,11 +422,24 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
title.tracks.print()
try:
#title.tracks.select_videos(by_quality=quality, by_range=range_, one_only=True)
# Modified video track selection to choose closest resolution if exact match not found
if quality and closest_resolution:
available_resolutions = [int(track.height) for track in title.tracks.videos]
if available_resolutions == []:
log.error(" - No video tracks available")
continue
if quality not in available_resolutions:
closest_res = min(available_resolutions, key=lambda x: abs(x - quality))
log.warning(f" - No {quality}p resolution available, using closest available: {closest_res}p")
quality = closest_res
if range_ == "DV+HDR":
title.tracks.select_videos_multi(["HDR10", "DV"], by_quality=quality, by_vbitrate=vbitrate)
else:
title.tracks.select_videos(by_quality=quality, by_vbitrate=vbitrate, by_range=range_, one_only=True)
title.tracks.select_audios(by_language=alang, by_bitrate=abitrate, with_descriptive=audio_description)
# title.tracks.select_audios(by_language=alang, with_descriptive=audio_description)
title.tracks.select_subtitles(by_language=slang, with_forced=True)
title.tracks.select_audios(by_language=alang, by_bitrate=abitrate, with_descriptive=audio_description, by_codec=acodec, by_channels=audio_channels, max_audio_compatability=max_audio_compatability)
forced = alang if (match_forced and alang) else True
title.tracks.select_subtitles(by_language=slang, with_forced=forced)
except ValueError as e:
log.error(f" - {e}")
continue
@ -430,7 +481,9 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
continue # only wanted to see what tracks were available and chosen
skip_title = False
for track in title.tracks:
#Download might fail as auth token expires quickly for Hotstar. This is a problem for big downloads like a 4k track. So we reverse tracks and download audio first and large video later.
for track in (list(title.tracks)[::-1] if service_name == "Hotstar" else title.tracks):
if not keys:
log.info(f"Downloading: {track}")
if (service_name == "AppleTVPlus" or service_name == "iTunes") and "VID" in str(track):
@ -438,7 +491,12 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
if track.encrypted:
if not track.get_pssh(service.session):
raise log.exit(" - Failed to get PSSH")
log.info(f" + PSSH: {track.pssh}")
if track.psshPR:
log.info(f" + PSSH (PR): {track.psshPR}")
if track.psshWV:
log.info(f" + PSSH (WV): {track.psshWV}")
if not track.get_kid(service.session):
raise log.exit(" - Failed to get KID")
log.info(f" + KID: {track.kid}")
@ -447,7 +505,12 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
proxy = next(iter(service.session.proxies.values()), None)
else:
proxy = None
track.download(directories.temp, headers=service.session.headers, proxy=proxy)
if service:
save_cookies(service_name, service, ctx.obj.profile)
if isinstance(track, TextTrack):
time.sleep(5) # Sleep 5 seconds before downloading each subtitle track to avoid 403 errors
track.download(directories.temp, headers=service.session.headers, proxy=proxy, session=service.session)
log.info(" + Downloaded")
if isinstance(track, VideoTrack) and track.needs_ccextractor_first and not no_subs:
ccextractor()
@ -456,7 +519,7 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
if track.key:
log.info(f" + KEY: {track.key} (Static)")
elif not no_cache:
track.key, vault_used = ctx.obj.vaults.get(track.kid, title.id)
track.key, vault_used = ctx.obj.vaults.get(track.kid, title.id) #To-Do return all keys for title.id for DSNP, HULU
if track.key:
log.info(f" + KEY: {track.key} (From {vault_used.name} {vault_used.type.name} Key Vault)")
for vault in ctx.obj.vaults.vaults:
@ -473,9 +536,11 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
if cache:
skip_title = True
break
if "common_privacy_cert" in dir(ctx.obj.cdm):
session_id = ctx.obj.cdm.open(track.pssh)
session_id = ctx.obj.cdm.open()
log.info(f"CDM Session ID - {session_id.hex()}")
if "common_privacy_cert" in dir(ctx.obj.cdm) and track.psshWV:
ctx.obj.cdm.set_service_certificate(
session_id,
service.certificate(
@ -485,35 +550,42 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
session_id=session_id
) or ctx.obj.cdm.common_privacy_cert
)
ctx.obj.cdm.parse_license(
session_id,
service.license(
challenge=ctx.obj.cdm.get_license_challenge(session_id),
license = service.license(
challenge=ctx.obj.cdm.get_license_challenge(session_id=session_id, pssh=PSSHWV(track.psshWV)),
title=title,
track=track,
session_id=session_id
)
assert license
ctx.obj.cdm.parse_license(
session_id,
license
)
else:
session_id = ctx.obj.cdm.open()
log.info(f"CDM Session ID - {session_id.hex()}")
wrm_header = PSSH(track.pssh).get_wrm_headers()[0]
challenge = ctx.obj.cdm.get_license_challenge(session_id, wrm_header)
#log.info(f"{wrm_header} --> {challenge}")
licence = service.license(
elif "common_privacy_cert" not in dir(ctx.obj.cdm) and track.psshPR:
challenge = ctx.obj.cdm.get_license_challenge(session_id, PSSH(track.psshPR).wrm_headers[0])
license = service.license(
challenge=challenge,
title=title,
track=track,
)
log.debug(licence)
assert license
log.debug(license)
if isinstance(license, bytes):
license = license.decode("utf-8")
ctx.obj.cdm.parse_license(
session_id,
licence # expects the XML License not base64 encoded str.
license # expects the XML License not base64 encoded str.
)
else:
raise log.exit("Unable to license")
if service:
save_cookies(service_name, service, ctx.obj.profile)
content_keys = [
(x.kid, x.key) for x in ctx.obj.cdm.get_keys(session_id, content_only=True)
(str(x.kid).replace("-", ""), x.key.hex()) for x in ctx.obj.cdm.get_keys(session_id) if x.type == "CONTENT"
] if "common_privacy_cert" in dir(ctx.obj.cdm) else [
(str(x.key_id).replace("-", ""), x.key.hex()) for x in ctx.obj.cdm.get_keys(session_id)
]
@ -560,18 +632,18 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
# TODO: Move decryption code to Track
if not config.decrypter:
raise log.exit(" - No decrypter specified")
if config.decrypter == "packager" and not (track.descriptor == Track.Descriptor.ISM):
if service_name in ["DisneyPlus", "Hulu"] or (config.decrypter == "packager" and not (track.descriptor == Track.Descriptor.ISM)) :
platform = {"win32": "win", "darwin": "osx"}.get(sys.platform, sys.platform)
names = ["shaka-packager", "packager", f"packager-{platform}"]
executable = next((x for x in (shutil.which(x) for x in names) if x), None)
if not executable:
raise log.exit(" - Unable to find packager binary")
dec = os.path.splitext(track.locate())[0] + ".dec.mp4"
dec = os.path.splitext(track.locate())[0].replace("enc", "dec") + ".mp4"
os.makedirs(directories.temp, exist_ok=True)
try:
os.makedirs(directories.temp, exist_ok=True)
subprocess.run([
args = [
executable,
"input={},stream={},output={}".format(
track.locate(),
@ -583,18 +655,32 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
f"label=0:key_id={track.kid.lower()}:key={track.key.lower()}",
# Apple TV+ needs this as shaka pulls the incorrect KID, idk why
f"label=1:key_id=00000000000000000000000000000000:key={track.key.lower()}",
]),
]) if service_name not in ["DisneyPlus", "Hulu"] else
",".join(
[# This right here is a hack as DSNP/HULU sometimes has 2 kids and returns 2 keys. FFS.
"label={}:key_id={}:key={}".format(
content_keys.index(pair),
pair[0],
pair[1]
)
for pair
in content_keys
]
),
"--temp_dir", directories.temp
], check=True)
]
subprocess.run(args, check=True)
except subprocess.CalledProcessError:
raise log.exit(" - Failed!")
elif config.decrypter == "mp4decrypt" or (track.descriptor == Track.Descriptor.ISM):
elif service_name not in ["DisneyPlus", "Hulu"] or (config.decrypter == "mp4decrypt" or (track.descriptor == Track.Descriptor.ISM)):
executable = shutil.which("mp4decrypt")
if not executable:
raise log.exit(" - Unable to find mp4decrypt binary")
dec = os.path.splitext(track.locate())[0] + ".dec.mp4"
dec = os.path.splitext(track.locate())[0].replace("enc", "dec") + ".mp4"
os.makedirs(directories.temp, exist_ok=True)
try:
os.makedirs(directories.temp, exist_ok=True)
subprocess.run([
executable,
"--show-progress",
@ -612,6 +698,25 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
if keys:
continue
if isinstance(track, AudioTrack) and track.descriptor == Track.Descriptor.ISM and track.atmos:
#--enable-libmfx is the only difference between 6.1.1 and 7.X.
#FFMPEG 6.1.1 is necessary as that version correctly puts in place an init.mp4 for EAC-3-JOC ie Atmos
#https://github.com/GyanD/codexffmpeg/releases/tag/6.1.1
#https://github.com/BtbN/FFmpeg-Builds/releases/tag/latest
executable = shutil.which("ffmpeg")
if not executable:
raise log.exit(" - Unable to find ffmpeg binary")
eac3 = os.path.splitext(track.locate())[0] + ".eac3"
os.makedirs(directories.temp, exist_ok=True)
try:
os.makedirs(directories.temp, exist_ok=True)
exec_string = f"{executable} -i {track.locate()} -hide_banner -loglevel error -map 0 -c:a copy {eac3}"
subprocess.run(exec_string, check=True)
except subprocess.CalledProcessError:
raise log.exit(" - Failed!")
track.swap(eac3)
log.info(" + Fixed ISM Atmos")
if track.needs_repack or (config.decrypter == "mp4decrypt" and isinstance(track, (VideoTrack, AudioTrack))):
log.info("Repackaging stream with FFmpeg (to fix malformed streams)")
track.repackage()
@ -619,12 +724,26 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
if isinstance(track, VideoTrack) and track.needs_ccextractor and not no_subs:
ccextractor()
if isinstance(track, TextTrack) and strip_sdh:
track.strip_sdh()
log.info("Stripped SDH subtitles to CC with subby")
if skip_title:
for track in title.tracks:
track.delete()
continue
if keys:
continue
if range_ == "DV+HDR":
try:
hybrid_path = title.tracks.make_hybrid()
log.info(f" + Hybrid DV+HDR created: {hybrid_path}")
except Exception as e:
log.warning(f" - Skipped Hybrid DV+HDR: {e}")
if not list(title.tracks) and not title.tracks.chapters:
continue
# mux all final tracks to a single mkv file
@ -687,7 +806,6 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
os.path.join(final_file_path, f"{title.parse_filename(media_info=media_info)}.{extension}")
)
log.info("Processed all titles!")

View File

@ -61,6 +61,10 @@ device:
device_name: '%FIRST_NAME%''s%DUPE_STRATEGY_1ST% Hisense'
device_serial: '3cc61028646759e273'
#Hisense_HU32E5600FHWV: A2RGJ95OVLR12U
#Hisense_HU50A6100UW: AAJ692ZPT1X85
#Hisense_HE55A700EUWTS: A3REWRVYBYPKUM
#MTC_ATV: A2HYAJ0FEWP6N3
device_types:
browser: 'AOAGZA014O5RE' # all browsers? all platforms?
@ -95,7 +99,9 @@ endpoints:
# chapters/scenes
xray: '/swift/page/xray'
# device registration
ontv: '/region/eu/ontv/code?ref_=atv_auth_red_aft' #/gp/video/ontv/code
ontv: '/region/eu/ontv/code?ref_=atv_auth_red_aft'
ontvold: '/gp/video/ontv/code/ref=atv_device_code'
mytv: '/mytv'
devicelink: '/gp/video/api/codeBasedLinking'
codepair: '/auth/create/codepair'
register: '/auth/register'

View File

@ -0,0 +1,50 @@
certificate: |
CAUSugUKtAIIAxIQbj3s4jO5oUyWjDWqjfr9WRjA2afZBSKOAjCCAQoCggEBALhKWfnyA+FGn5P3tl6ffDjoGq2Oq86hKGl6aZIaGaF7XHPO5mIk7Q35ml
ZIgg1A458Udb4eXRws1n+kJFqtZXCY5S1yElLP0Om1WQsoEY2stpl+PZTGnVv/CsOJGKQ8K4KMr7rKjZem9lA9BrBoxgfXY3tbwlnSf3wTEohyANb5Qfpa
xsU4v8tQDA8PcjzzV9ICodl6crcFZhAy4QMNXfbWOv/ZrGFx5blSXrzP1sMQ64IY8bjUYw4coZM34NDhu8aCA692g8k2mTz2494x7u3Is8v7RKC9ZNiETE
K5/4oeVclXPpelNQokR4uvggnCD1L2EULG/pp6wnk1yWNNLxcCAwEAAToHYmFtdGVjaBKAA2FqHlqkE7EUmdOLiCi0hy5jRgBDJrU1CWNHfH6r2i6s5T5k
6LK7ZfD65Tv6uyqq1k82PsDz4++kxbpfJDZaypFbae4XPc6lZxRCc5X0toX/x9TftOQQ4N82l5Hxoha569EPRkrnNy7rO7xrRILa3ZVj1alttEnEEjxEuw
SV8usdlUg8/LvLA2C59T/HA2I77k7yVbTrVdy0f81r2l+E2SslivCy1JD3xKlgoaKl4xBnRxItWt8+DCw1Xm2lemYl2LGoh1Wk9gvlXQvr2Jv2+dFX3RNs
i5sd00KS9sePszfjoTkQ6fmpRd7ZgFCGFWYB9JZ92aGUFQRE14OTST2uwSf32YCfsoATDNs4V6dB8YDoTGKFGrcoc4gtHPKySGNt7z/fOW4/01ZGzKqoVY
Fp3jPq7R0qyt5P6fU5NshbLh5VKcnQvwg62BuKsdwV9u4NV36b2a546hGRl/3GBneQ+QDA7NRrgITR33Sz02Oq8yJr3sy24GfZRTbtLJ4qiWkjtw==
# taken from web application, firefox, linux
##
# firefox, linux: ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84
# android phones, tv, and fire tv stick: ZGlzbmV5JmFuZHJvaWQmMS4wLjA.bkeb0m230uUhv8qrAXuNu39tbE_mD5EEhM_NAcohjyA
# <INFO BASE64>.<KEY?> e.g. for browser: disney&browser&1.0.0
##
device_api_key: 'ZGlzbmV5JmFuZHJvaWQmMS4wLjA.bkeb0m230uUhv8qrAXuNu39tbE_mD5EEhM_NAcohjyA'
bamsdk:
##
# Browser (Windows, Chrome), isUhdAllowed: false.
# https://bam-sdk-configs.bamgrid.com/bam-sdk/v3.0/disney-svod-3d9324fc/browser/v6.1/windows/chrome/prod.json
# Android Phone, isUhdAllowed: false.
# https://bam-sdk-configs.bamgrid.com/bam-sdk/v3.0/disney-svod-3d9324fc/android/v5.1.0/google/handset/prod.json
# Android TV, isUhdAllowed: TRUE!
# https://bam-sdk-configs.bamgrid.com/bam-sdk/v3.0/disney-svod-3d9324fc/android/v5.1.0/google/tv/prod.json
# Amazon Fire TV, isUhdAllowed: TRUE!
# https://bam-sdk-configs.bamgrid.com/bam-sdk/v3.0/disney-svod-3d9324fc/android/v5.1.0/amazon/tv/prod.json
##
season: https://disney.api.edge.bamgrid.com/explore/v1.0/season/{id}
page: https://disney.api.edge.bamgrid.com/explore/v1.2/page/{id}
config: 'https://bam-sdk-configs.bamgrid.com/bam-sdk/v3.0/disney-svod-3d9324fc/android/v6.0.0/google/tv/prod.json'
family: 'browser'
profile: 'tv'
##
# android phone: handset
# android tv: tv? android?
##
applicationRuntime: 'android'
##
# android phone: android-phone
# android tv: android-tv
##
platform: 'android/google/tv'
version: '9.7.1'
##
# samsung s8: BAMSDK/v4.18.2 (disney-svod-3d9324fc 1.7.2.0; v2.0/v4.18.0; android; phone) samsung SM-G950F (PPR1.180610.011.G950FXXS8DTC1; Linux; 9; API 28)
# android tv: BAMSDK/v4.18.2 (disney-svod-3d9324fc 1.7.2.0; v2.0/v4.18.0; android; tv) google Nexus Player (OPR2.170623.027; Linux; 8.0.0; API 26)
##
user_agent: 'BAMSDK/v9.7.1 (disney-svod-3d9324fc 2.26.3-rc2.0; v5.0/v9.7.0; android; tv) SDMC S905X4 OTT Box (RTM6.230109.097; Linux; 11; API 30)'

View File

@ -0,0 +1,18 @@
needs_auth: false
endpoints:
login: 'https://api.hotstar.com/in/aadhar/v2/web/in/user/login'
refresh: 'https://www.hotstar.com/api/internal/bff/v2/start'
tv_title: 'https://api.hotstar.com/o/v1/show/detail'
tv_episodes: 'https://api.hotstar.com/o/v1/tray/g/1/detail'
movie_title: 'https://api.hotstar.com/o/v1/movie/detail'
manifest: 'https://apix.hotstar.com/v2/pages/watch'
device:
os:
name: 'Windows'
version: 10
platform:
name: 'web'
version: '7.35.0'

View File

@ -0,0 +1,16 @@
endpoints:
login: 'https://api.hotstar.com/in/aadhar/v2/web/th/user/login'
refresh: 'https://www.hotstar.com/api/internal/bff/v2/start'
tv_title: 'https://api.hotstar.com/o/v1/show/detail'
tv_episodes: 'https://api.hotstar.com/o/v1/tray/g/1/detail'
movie_title: 'https://api.hotstar.com/o/v1/movie/detail'
manifest: 'https://api.hotstar.com/play/v4/playback/content/{id}'
device:
os:
name: 'Windows'
version: 10
platform:
name: 'web'
version: '7.35.0'

View File

@ -0,0 +1,68 @@
user_agent: 'Mozilla/5.0 (Fire OS 6.2.7.6; Amazon AFTMM; armeabi-v7a) AppleWebKit/604.1.38 (KHTML, like Gecko) Neutron/1.3.37 Hulu/0 TV Safari/604.1.38'
endpoints:
movie: 'https://discover.hulu.com/content/v5/hubs/movie/{id}?limit=999&schema=9&referralHost=production'
series: 'https://discover.hulu.com/content/v5/hubs/series/{id}?limit=999&schema=9&referralHost=production'
season: 'https://discover.hulu.com/content/v5/hubs/series/{id}/season/{season}?limit=999&schema=9&referralHost=production'
device:
PC:
code: '159' # Referred to as just "PC", but what specifically is it
key: '6ebfc84f3c304217b20fd9a66cb5957f'
Chrome:
code: '190' # Same key as "PC", but chrome specific? code just changed?
key: '6ebfc84f3c304217b20fd9a66cb5957f'
FireTV:
code: '188'
key: 'ca8d311a734854871623d906b968a073'
FireTV4K:
code: '208'
key: 'fa49ca06261fe41b6e56fa2d24b4f295'
Shield:
code: '109'
key: 'd0f4adc1d8a774256acb00c0fff46f5f'
Shield2:
code: '142' # TODO: Might not be a shield device, was referred to as "shield2"
key: 'd6bdf1f49c73db36f465536162ccc830'
codecs:
video_selection: 'ONE'
audio_selection: 'ALL'
video:
- type: 'H265'
profile: 'MAIN_10'
width: 3840
height: 2160
framerate: 60
level: '5.1'
tier: 'MAIN'
- type: 'H264'
profile: 'HIGH'
width: 1920
height: 1080
framerate: 60
level: '5.2'
audio:
- type: 'AAC'
- type: 'EC3'
drm:
selection_mode: 'ONE'
hdcp: true
schemas:
- type: 'WIDEVINE'
version: 'MODULAR'
security_level: 'L1'
- type: 'PLAYREADY'
version: 'V2'
security_level: 'SL3000'

View File

@ -0,0 +1,5 @@
user_agent: 'ATVE/6.2.0 Android/10 build/6A226 maker/Google model/Chromecast FW/QTS2.200918.0337115981' # AppleTV6,2/11.1 | ATVE/1.1 FireOS/6.2.6.8 build/4A93 maker/Amazon model/FireTVStick4K FW/NS6268/2315
user_agent_browser: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
endpoints:
license: 'https://play.itunes.apple.com/WebObjects/MZPlay.woa/wa/fpsRequest'

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
US:
device_link: True
base_url: 'https://www.paramountplus.com'
at_token: 'ABC+2JjrOUYWbaaqKmzwPdppq0RDB2WdufcFmIsSnJDmDEQpVgyAjQpqpEDksKZNMKQ='
login: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/auth/login.json'
status: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/app/status.json'
movie: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/movies/{title_id}.json'
shows: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/shows/slug/{title}.json'
section: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/shows/{showId}/videos/config/{config}.json'
seasons: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/videos/section/{section}.json'
show: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/shows/{}.json'
video_items: 'https://www.paramountplus.com/apps-api/v2.0/{device}/video/cid/{content_id}.json'
barrearUrl: 'https://www.paramountplus.com/apps-api/v3.1/androidphone/irdeto-control/anonymous-session-token.json'
FR:
device_link: True
base_url: 'https://www.paramountplus.com'
at_token: 'ABAS/G30Pp6tJuNOlZ1OEE6Rf5goS0KjICkGkBVIapVuxemiiASyWVfW4v7SUeAkogc='
login: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/auth/login.json'
status: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/login/status.json'
movie: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/movies/{title_id}.json'
shows: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/shows/slug/{title}.json'
section: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/shows/{showId}/videos/config/{config}.json'
seasons: 'https://www.paramountplus.com/apps-api/v2.0/androidphone/videos/section/{section}.json'
show: 'https://www.paramountplus.com/apps-api/v3.0/androidphone/shows/{}.json'
video_items: 'https://www.paramountplus.com/apps-api/v2.0/{device}/video/cid/{content_id}.json'
barrearUrl: 'https://www.paramountplus.com/apps-api/v3.1/androidphone/irdeto-control/anonymous-session-token.json'
INTL:
device_link: False
rows: 50 # Int number between 1 and 50
base_url: 'https://www.intl.paramountplus.com'
at_token: 'ABAS/G30Pp6tJuNOlZ1OEE6Rf5goS0KjICkGkBVIapVuxemiiASyWVfW4v7SUeAkogc='
login: 'https://www.intl.paramountplus.com/apps-api/v2.0/androidphone/auth/login.json'
status: 'https://www.intl.paramountplus.com/apps-api/v3.0/androidphone/login/status.json'
movie: 'https://www.intl.paramountplus.com/apps-api/v3.0/androidphone/movies/{title_id}.json'
shows: 'https://www.intl.paramountplus.com/apps-api/v3.0/androidphone/shows/slug/{title}.json'
section: 'https://www.intl.paramountplus.com/apps-api/v2.0/androidphone/shows/{showId}/videos/config/{config}.json'
seasons: 'https://www.intl.paramountplus.com/apps-api/v2.0/androidphone/videos/section/{section}.json'
show: 'https://www.intl.paramountplus.com/apps-api/v3.0/androidphone/shows/{}.json'
video_items: 'https://www.intl.paramountplus.com/apps-api/v2.0/{device}/video/cid/{content_id}.json'
barrearUrl: 'https://www.intl.paramountplus.com/apps-api/v3.1/androidphone/irdeto-control/session-token.json'
Android:
UserAgent: 'Mozilla/5.0 (Linux; Android 13; SM-A536E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36'
LINK_PLATFORM_URL: 'http://link.theplatform.com/s/dJ5BDC/media/guid/2198311517/{video_id}'
license: 'https://cbsi.live.ott.irdeto.com/widevine/getlicense'
license_pr: 'https://cbsi.live.ott.irdeto.com/playready/rightsmanager.asmx'

View File

@ -0,0 +1,16 @@
endpoints:
refresh: 'https://apiv2.sonyliv.com/AGL/2.9/A/ENG/WEB/IN/TN/GETPROFILE?channelPartnerID=MSMIND'
hash: 'https://apiv2.sonyliv.com/AGL/2.0/SR/ENG/WEB/IN/TN/GETHASHVALUE'
title: 'https://apiv2.sonyliv.com/AGL/2.6/R/ENG/WEB/IN/MH/DETAIL-V2/{id}'
season: 'https://apiv2.sonyliv.com/AGL/2.6/SR/ENG/WEB/IN/MH/CONTENT/DETAIL/BUNDLE/{id}?from={ep_start}&to={ep_end}&orderBy=episodeNumber&sortOrder=asc&kids_safe=false'
# manifest: 'https://apiv2.sonyliv.com/AGL/3.8/SR/ENG/WEB/IN/MH/CONTENT/VIDEOURL/VOD/{id}?contactId={bid}'
manifest: 'https://apiv2.sonyliv.com/AGL/3.8/SR/ENG/SONY_ANDROID_TV/IN/MH/CONTENT/VIDEOURL/VOD/{id}?contactId={bid}'
license: 'https://apiv2.sonyliv.com/AGL/1.4/SR/ENG/WEB/IN/CONTENT/GETLAURL'
device:
chrome:
device_id: '577f872ae8554c14a16ac1ef3d11c0e9-1712427232539'
app_version: '3.5.63'
platform: 'web'
user-agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36'
td_client: '{"os_name":"Mac OS","os_version":"10.15.7","device_make":"none","device_model":"none","display_res":"1470","viewport_res":"894","conn_type":"4g","supp_codec":"H264,AV1,AAC","client_throughput":"16000","td_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36","hdr_decoder":"UNKNOWN","audio_decoder":"STEREO"}'

View File

@ -0,0 +1,13 @@
secret_key: A3s68aORSgHs$71P
client_secret: apalyaSonyTV
UA: okhttp/2.5.0
endpoints:
contentDetail: https://pwaapi.sunnxt.com/content/v3/contentDetail/{titleid}/?level=devicemax&fields=contents,user/currentdata,generalInfo,subtitles,globalServiceName,globalServiceId
playback: https://api.sunnxt.com/content/v3/media/{titleid}/
tv_content: https://pwaapi.sunnxt.com/content/v3/vods/GID_{_id}/?fields=contents,generalInfo,globalServiceName&startIndex={index}&count=100
#login
register_device_url: https://api.sunnxt.com/user/v7/registerDevice
code_url: https://api.sunnxt.com/user/v4/device/code
link_url: https://api.sunnxt.com/user/v4/device/validate

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAoVu83qcuNeQcIjfXzl9zCtXEKklvWndbp+04vFYJ/7s4tTrS
BQtECs6UHG5v7MNphq92oINzjLHRDS45sFYSCfKfqk6FEp6jKDexo82zi0oZB7Tz
mlqbFaf5y1txbGCm+A0cStJuHgfB7QIhmQh4lPY5DiLOLZjb/CsE1MjR9wcmD8eN
hXjtriV8Je2+b8Lm3RMT3GHjOCIxh0iX9PxfxrGSlvmrU2qexQMSLmyaTMPyFSsR
uFgLu4bQbFvFDiFGv53k/7S3AydWHqW+6PaZ/65D9jzJ+6RBUulfCGUP1LIloDbM
Y2ez/jgiWzMB6J6GDQzelpjVVeYnFPCU9txyMQIDAQABAoIBAAM+GbSLvYT9uYcC
gka2alRsaU3EPgWeYmwke0BlpjvKYmBZ90B8snhZIGbV3U/vuV4ohoTBP4AzTpUq
OaSOhjxG8Oh2PXxbTcIQJHS7PIFvEsOx4jdW3Mj5oC5y/vuDkbdoZAoo4meeFkqS
AWTW471ymUDseCI4cStHHgi8pGOHbAbZJh2xKQfVFpKiZYGWpr2eu/xatwWtk9y7
Pl69qhjDur6rkY55EBYl94EmsIT6yx9btESDWB+jcQ0zg+NlgtLOLZfHzlsEx8Lp
qaoQoqpuziURdevrk+3RxbHPZcjt51UWtUBauncFyu1O4/zVpB/gTnbJNCXOcrw4
hRQJHkUCgYEA440KJXT7GRke25RM6MGFc6S2z0270LxSFcmYlgNpNPuE+vm23lBv
WC5tmRmmS/Y19MLtdeD+cJsYj6BZlXUiZjZC/MXNGWDEPLyN3R9gxH0HjxPrcX/l
iXlfkzhd5dRwUXZs+L9ix4ANHPzIa3vsVwmyhbrWGz5dumeRkPtw/MsCgYEAtYgl
/ZMP3VSpol9KHQV8j1pI6AO5b+eT8Ic9f1KQejZP3t/fbY/7XIMiqUPG9APhv3qC
4ZTydc8RybXu7L9nzNewvwaCtJr5Zgdt4XOcTQqgX8UK+0z/Fm+omlObKrcJNoWH
SEHcVVAMtRHdmo9eOAxnsXpwtgII/+NcCq1vSXMCgYEApvWXWkBo9NNfttErVSSZ
HG7gy15HzjI/MElIsdky2nMp8VRD/v6Zk+QM+ma9g8LVeA+GWBWL22eRL+EBmg3l
/YUWxY0EnfhIRCA9Ht+lCsaKQ0rkV9T1wFbT75tOGhIzjzILZsBWY/bqqDg5fdPh
Z0NwP3sFGdw6vUi8n9o93t0CgYEAjoXsPeA+bmlQHdlumMZ7+xjJcM+rwb4xmoCz
uckbAbiukK93/c8zbHjQt9As3dxGW01WgMGucuw2bQXYJixI1LzrWa9E44NhF8fx
bzaTmrEjJM3RR2g2Rmk4GKJXivvV0eaYRhTfZmPI9kimkfjJ4ntq1h7paxzB8BWT
aBau7x0CgYEA0F9zW5P4Jc76WRtogc+OMlmqVMkxYVFr84MgzK2n13ExtvMWRHhN
KNHeZmukvqYYXlymPpBqvXibndXnHJjfX7NsX41l2u61mKcsKeQ65mCz4K+C9tOi
EMKMO4L9fCaylP5cbIO4ogmEtY/9He+yEdBZQaVz3d5t8wUT9inaT3s=
-----END RSA PRIVATE KEY-----

Some files were not shown because too many files have changed in this diff Show More