From b762ad852e173fa045c61f91bf99ce0d2101b797 Mon Sep 17 00:00:00 2001 From: rols1 Date: Wed, 26 Apr 2023 10:41:21 +0200 Subject: [PATCH] Einzelupdate ARDnew.py --- resources/lib/ARDnew.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/resources/lib/ARDnew.py b/resources/lib/ARDnew.py index fc1defb..09fb865 100644 --- a/resources/lib/ARDnew.py +++ b/resources/lib/ARDnew.py @@ -10,8 +10,8 @@ # 21.11.2019 Migration Python3 Modul kodi_six + manuelle Anpassungen # ################################################################################ -# 41 # Numerierung für Einzelupdate -# Stand: 18.04.2023 +# 42 # Numerierung für Einzelupdate +# Stand: 26.04.2023 # Python3-Kompatibilität: from __future__ import absolute_import # sucht erst top-level statt im akt. Verz. @@ -1242,24 +1242,11 @@ def get_json_content(li, page, ID, mark='', mehrzS=''): mediatype=''; pagetitle='' PLog(page[:80]) - jsonpath = "teasers" # Default - if page.startswith(u'{"binaryFeatures"'): - jsonpath = "widgets|0|teasers" - - try: - page_obs = json.loads(page) - PLog(len(page_obs)) - obs = GetJsonByPath(jsonpath, page_obs) - except Exception as exception: - PLog(str(exception)) - obs=[] - if len(obs) == 0: # Altern. - jsonpath = "widgets|0|teasers" - try: - obs = GetJsonByPath(jsonpath, page_obs) - except Exception as exception: - PLog(str(exception)) - obs=[] + page_obs = json.loads(page) + if "teasers" in page_obs: + obs =page_obs["teasers"] + if "widgets" in page_obs: + obs =page_obs["widgets"][0]["teasers"] PLog("obs: %d" % len(obs)) # typ-Info Einzelbeträge: ["live", "event", "broadcastMainClip",