This commit is contained in:
Nirvana
2025-12-01 15:23:24 +01:00
parent 017f6f179a
commit 435154ce64
2 changed files with 10 additions and 2 deletions
@@ -124,6 +124,13 @@ class LicenseConfig:
if not all(c in "0123456789abcdefABCDEF" for c in key):
raise ValueError(f"Invalid KEY format: {key}")
@classmethod
def create_with_base64_req_data(cls, req_data_template: str, **kwargs):
"""Helper to ensure req_data is base64 encoded"""
import base64
req_data_encoded = base64.b64encode(req_data_template.encode('utf-8')).decode('utf-8')
return cls(req_data=req_data_encoded, **kwargs)
@dataclass
class DRMConfig:
system: DRMSystem
@@ -416,11 +416,12 @@ class HRTiProvider(StreamingProvider):
])
# Create the license configuration
license_config = LicenseConfig(
# Use the class method to create LicenseConfig with base64 encoded req_data
license_config = LicenseConfig.create_with_base64_req_data(
req_data_template='{CHA-RAW}', # The placeholder string
server_url=self.hrti_config.license_url,
use_http_get_request=False,
req_headers=license_headers,
req_data='{CHA-RAW}', # Placeholder - inputstream will replace with actual challenge
wrapper=None,
unwrapper='json,base64',
unwrapper_params=LicenseUnwrapperParams(path_data="license")