From 1404d59865b09271f6e7ec7dd42c76802b9faf0c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 4 Oct 2018 10:22:17 +0200 Subject: [PATCH] Fixed response encoding --- platypush/plugins/video/omxplayer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/video/omxplayer.py b/platypush/plugins/video/omxplayer.py index a16408e9b..0a8e68fc2 100644 --- a/platypush/plugins/video/omxplayer.py +++ b/platypush/plugins/video/omxplayer.py @@ -487,13 +487,17 @@ class VideoOmxplayerPlugin(Plugin): }) ) + response = request.read() + if isinstance(response, bytes): + response = response.decode('utf-8') + results = [ { 'url': _['items'][0]['torrent_magnet'], 'title': _['title'], } - for _ in json.loads(request.read())['MovieList'] + for _ in json.loads(response).get('MovieList', []) ] return results