Skip to content

Commit

Permalink
[network] iterate through all body objects
Browse files Browse the repository at this point in the history
Signed-off-by: Sandmann79 <[email protected]>
  • Loading branch information
Sandmann79 committed Jul 31, 2024
1 parent 1143f49 commit c18b4f3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions plugin.video.amazon-test/resources/lib/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c18b4f3

Please sign in to comment.