- added back the ability to use cookies.txt file (netscape format)
- updated error message for course subscription when failed to find classes
- remove requirement for shaka-packager in favor of ffmpeg (v5+)
This commit is contained in:
Puyodead1
2024-07-18 18:46:43 -04:00
parent 4b80e32433
commit d123403434
2 changed files with 67 additions and 58 deletions

View File

@@ -24,14 +24,14 @@ def extract_kid(mp4_file):
if not os.path.exists(mp4_file):
raise Exception("File does not exist")
for box in boxes:
if box.header.box_type == 'moov':
if box.header.box_type == "moov":
pssh_box = next(x for x in box.pssh if x.system_id == "edef8ba979d64acea3c827dcd51d21ed")
hex = codecs.decode(pssh_box.payload, "hex")
pssh = widevine_pssh_data_pb2.WidevinePsshData()
pssh.ParseFromString(hex)
content_id = base64.b16encode(pssh.content_id)
return content_id.decode("utf-8")
return content_id.decode("utf-8").lower()
# No Moof or PSSH header found
return None
return None