Fix association of preceding HLS EXT-X-KEYs with m3u8 fork

This will improve efficiency and accuracy of getting appropriate DRM systems when downloading segments.

This can dramatically improve download speed from less than 50 kb/s to full speed if the HLS playlist used a lot of AES-128 EXT-X-KEYs. E.g., a unique key for each segment.

This was caused because the HLS.get_drm function took EVERY EXT-X-KEY, checked for supported systems, loaded them, and returned the supported objects. This meant it could load possibly 100s of AES-128 ClearKey objects (likely requiring URL downloads for the key URI) causing a huge delay before downloading each segment.
This commit is contained in:
rlaphoenix
2023-03-09 21:46:48 +00:00
parent 7bb215d496
commit 111dac9264
3 changed files with 20 additions and 25 deletions

View File

@@ -32,7 +32,6 @@ crccheck = "^1.3.0"
jsonpickle = "^3.0.1"
langcodes = { extras = ["data"], version = "^3.3.0" }
lxml = "^4.9.2"
m3u8 = "^3.4.0"
pproxy = "^2.7.8"
protobuf = "4.21.6"
pycaption = "^2.1.1"
@@ -45,6 +44,7 @@ pywidevine = { extras = ["serve"], version = "^1.6.0" }
PyYAML = "^6.0"
requests = { extras = ["socks"], version = "^2.28.2" }
rich = "^13.3.1"
"rlaphoenix.m3u8" = "^3.4.0"
"ruamel.yaml" = "^0.17.21"
sortedcontainers = "^2.4.0"
subtitle-filter = "^1.4.4"