From c18b4f3838a5c45a09bd8ebca82ebfd80eba3ac4 Mon Sep 17 00:00:00 2001 From: Sandmann79 Date: Wed, 31 Jul 2024 18:38:54 +0200 Subject: [PATCH] [network] iterate through all body objects Signed-off-by: Sandmann79 --- .../resources/lib/network.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugin.video.amazon-test/resources/lib/network.py b/plugin.video.amazon-test/resources/lib/network.py index 49774c1e..0ee36cc0 100644 --- a/plugin.video.amazon-test/resources/lib/network.py +++ b/plugin.video.amazon-test/resources/lib/network.py @@ -484,17 +484,18 @@ def do(url, postData): elif 'props' in m: m = m['props'] if 'body' in m and len(m['body']) > 0: - body = m['body'][0] + bodies = m['body'] if 'siteWide' in m and 'bodyStart' in m['siteWide'] and len(m['siteWide']['bodyStart']) > 0: for bs in m['siteWide']['bodyStart']: if 'name' in bs and bs['name'] == 'navigation-bar' and 'props' in bs: - m = bs['props'] - if 'props' in body: - body = body['props'] - for p in ['atf', 'btf', 'landingPage', 'browse', 'search', 'categories', 'genre']: - Merge(m, body.get(p, {})) - for p in ['content']: - Merge(m, {p: body.get(p, {})}) + m = bs['props'] + for bd in bodies: + if 'props' in bd: + body = bd['props'] + for p in ['atf', 'btf', 'landingPage', 'browse', 'search', 'categories', 'genre']: + Merge(m, body.get(p, {})) + for p in ['content']: + Merge(m, {p: body.get(p, {})}) if _s.json_dump_raw: # Prune useless/sensitive info