Update remote_device_pr.py
This commit is contained in:
parent
920d39807c
commit
6be1c180a4
@ -1,3 +1,5 @@
|
||||
import base64
|
||||
|
||||
from flask import Blueprint, jsonify, request, current_app, Response
|
||||
import os
|
||||
import yaml
|
||||
@ -6,6 +8,7 @@ from pyplayready.cdm import Cdm as PlayReadyCDM
|
||||
from pyplayready import PSSH as PlayReadyPSSH
|
||||
from pyplayready.exceptions import (InvalidSession, TooManySessions, InvalidLicense, InvalidPssh)
|
||||
from custom_functions.database.user_db import fetch_username_by_api_key
|
||||
from custom_functions.decrypt.api_decrypt import is_base64
|
||||
from custom_functions.user_checks.device_allowed import user_allowed_to_use_device
|
||||
from pathlib import Path
|
||||
|
||||
@ -180,6 +183,8 @@ def remote_cdm_playready_parse_license(device):
|
||||
})
|
||||
session_id = bytes.fromhex(body["session_id"])
|
||||
license_message = body["license_message"]
|
||||
if is_base64(license_message):
|
||||
license_message = base64.b64decode(license_message).decode("utf-8")
|
||||
try:
|
||||
cdm.parse_license(session_id, license_message)
|
||||
except InvalidSession:
|
||||
|
Loading…
x
Reference in New Issue
Block a user