From 51663c3d277a0f446c36141ab3224230cb13b6c2 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Sat, 30 Sep 2023 21:56:31 +0530 Subject: [PATCH] Update natgeomag.recipe fix missing images --- recipes/natgeomag.recipe | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/recipes/natgeomag.recipe b/recipes/natgeomag.recipe index bfe52c8f4d..926e0429ea 100644 --- a/recipes/natgeomag.recipe +++ b/recipes/natgeomag.recipe @@ -54,6 +54,16 @@ def parse_body(item): elif c.get('cmsType') == 'image': for line in parse_lead_image(c): yield line + elif c.get('cmsType') == 'imagegroup': + for imgs in c['images']: + for line in parse_lead_image(imgs): + yield line + elif c.get('cmsType') == 'pullquote': + if 'quote' in c: + yield '
' + c['quote'] + "" + elif c.get('cmsType') == 'editorsNote': + if 'note' in c: + yield '
' + c['note'] + "" else: if c['mrkup'].strip().startswith('<'): yield c['mrkup'] @@ -88,6 +98,10 @@ def article_parse(data): continue for mod in frm.get('mods', ()): for edg in mod.get('edgs', ()): + if edg.get('cmsType') == 'ImmersiveLeadTile': + if 'image' in edg.get('cmsImage', {}): + for line in parse_lead_image(edg['cmsImage']): + yield line if edg.get('cmsType') == 'ArticleBodyTile': for line in parse_article(edg): yield line