Browse Source

use alternative attribute brandTitle to find videos in the ZDF Mediathek

Helmut Pozimski 6 years ago
parent
commit
81c03bc7f5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib_stov/zdf_mediathek.py

+ 6 - 1
lib_stov/zdf_mediathek.py

@@ -69,6 +69,7 @@ class Connector(object):
         :return: List of all newly retrieved videos
         :rtype: list
         """
+        name_found = False
         videos_list = []
         new_videos = []
         today = datetime.today()
@@ -81,7 +82,11 @@ class Connector(object):
             response = json.loads(data)
             for cluster in response["broadcastCluster"]:
                 for broadcast in cluster["teaser"]:
-                    if self._name in broadcast["headline"]:
+                    try:
+                        name_found = self._name in broadcast["brandTitle"]
+                    except KeyError:
+                        name_found = self._name in broadcast["headline"]
+                    if name_found:
                         if self._search:
                             if self._search in broadcast["titel"]:
                                 new_videos.append((broadcast["sharingUrl"],