Created
May 16, 2019 04:28
-
-
Save MythodeaLoL/ff93959d068b4ebe2d347c8a3644d742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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