Skip to content

Instantly share code, notes, and snippets.

@MythodeaLoL
Created May 16, 2019 04:28
Show Gist options
  • Save MythodeaLoL/ff93959d068b4ebe2d347c8a3644d742 to your computer and use it in GitHub Desktop.
Save MythodeaLoL/ff93959d068b4ebe2d347c8a3644d742 to your computer and use it in GitHub Desktop.
import base64
import uuid
from pymp4.parser import Box
def get_moov_pssh(fd):
while True:
x = Box.parse_stream(fd)
if x.type == b'moov':
for y in x.children:
if y.type == b'pssh' and y.system_ID == uuid.UUID('edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'):
return base64.b64encode(y.init_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment