Browse Source

zdf-mediathek: decode data to string before parsing to avoid issues with python 3.4

Helmut Pozimski 6 years ago
parent
commit
095dc6481f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib_stov/zdf_mediathek.py

+ 2 - 1
lib_stov/zdf_mediathek.py

@@ -74,7 +74,8 @@ class Connector(object):
         connection = urllib.request.urlopen(
             "https://zdf-cdn.live.cellular.de/mediathekV2/broadcast-missed/%s"
             % (today-timedelta(days=1)).strftime("%Y-%m-%d"))
-        response = json.load(connection)
+        data = connection.read().decode("utf-8")
+        response = json.loads(data)
         for cluster in response["broadcastCluster"]:
             for broadcast in cluster["teaser"]:
                 if self._name in broadcast["titel"]: