Skip to content

OpenCast downloads are broken since the json returned by the API has changed #125

@D-VR

Description

@D-VR

Error happens in #.

It seems like the engage API now returns a list of videos in mediapackage and a list of formats mimetype.

i.e. tracks:

        tracks = episodejson["search-results"]["result"]["mediapackage"]["media"][
            "track"
        ]

now can be gotten by:

        tracks = [track["mediapackage"]["media"]["track"] for track in episodejson["result"]]

This is easy to fix by simply iterating over all, however we should also handle multiple videos being returned (I guess this is for opencasts with a presenter and screencast?)

Quick fix would be just throw away all except the first video

edit:

After making the hotfix, I've got a better understanding of the changes. Main change is that 'search-results' has been dropped. Instead we now get a list of 'mediapackages' which likely means that there can now be multiple 'medias' associated with an 'episode' in opencast. Hotfix will only take the first 'media' and ignore the rest.

Would be good to take a better look at the api changes, when there is time.

You can test out the hotfix with:

pip install git+https://github.com/Romern/syncMyMoodle.git@125-opencast-downloads-are-broken-since-the-json-returned-by-the-api-has-changed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions