Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occured after adding AES encryption if key_file_uri is blank #150

Open
subaru-shoji opened this issue Dec 25, 2018 · 1 comment

Comments

@subaru-shoji
Copy link

I set None to key_file_uri to create encryption.key. Then submit like below.

aes128 = AESDRM(
    key=key,
    iv=iv,
    outputs=[output],
    method='AES_128',
    key_file_uri=None,
    name=name
)
bitmovin.encodings.Muxing.TS.DRM.AES.create(object_=aes128,
                                            encoding_id=encoding_id,
                                            muxing_id=muxing_id).resource

After that, an error occued on receiving response.

  File "/Users/shoji/Documents/ghq/github.logica.io/streaks/bitmovin-handler/.venv/lib/python3.7/site-packages/bitmovin/services/rest_service.py", line 31, in create
    response=response, class_=self.class_)
  File "/Users/shoji/Documents/ghq/github.logica.io/streaks/bitmovin-handler/.venv/lib/python3.7/site-packages/bitmovin/services/parsing_utils.py", line 38, in parse_bitmovin_resource_from_response
    resource = class_.parse_from_json_object(json_object=result)
  File "/Users/shoji/Documents/ghq/github.logica.io/streaks/bitmovin-handler/.venv/lib/python3.7/site-packages/bitmovin/resources/models/encodings/drms/aes_drm.py", line 25, in parse_from_json_object
    key_file_uri = json_object['keyFileUri']

I think json response doesn't have keyFileUrl key if I set None
It should be .get like below.

class AESDRM(DRM):
    ...

    @classmethod
    def parse_from_json_object(cls, json_object):
        drm = super().parse_from_json_object(json_object=json_object)
        ...
        key_file_uri = json_object.get('keyFileUri')
        iv = json_object.get('iv')

        aes_drm = AESDRM(method=method, key=key, key_file_uri=key_file_uri, iv=iv, outputs=outputs, id_=id_,
                         custom_data=custom_data, name=name, description=description)

        return aes_drm
@matt-lee-bitmovin
Copy link
Contributor

Hello, we have just released 1.52.0 with an improvement to make the key_file_uri optional, so you can not specify it, and it should now succeed.

Please update your Python client, and let us know the result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants