From b8cdf762ee56589a79470c36e669c7fde33c456b Mon Sep 17 00:00:00 2001 From: unkn0wn <51942695+unkn0w7n@users.noreply.github.com> Date: Thu, 24 Jul 2025 11:39:32 +0530 Subject: [PATCH] ... --- recipes/wash_post_print.recipe | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/wash_post_print.recipe b/recipes/wash_post_print.recipe index 6d15122032..1e7a5aa9cd 100644 --- a/recipes/wash_post_print.recipe +++ b/recipes/wash_post_print.recipe @@ -80,7 +80,11 @@ class wapoprint(BasicNewsRecipe): feeds.append((secname, articles)) return feeds - def preprocess_raw_html(self, raw, *a): + def preprocess_raw_html(self, raw, url): + if '/interactive/' in url: + return ('

' + root.xpath('//h1')[0].text + '

' + 'This article is supposed to be read in a browser.' + '
') root = parse(raw) m = root.xpath('//script[@id="__NEXT_DATA__"]') @@ -89,10 +93,7 @@ class wapoprint(BasicNewsRecipe): text = data.get('label', {}).get('basic', {}).get('text', '') label = f'

{text}

' if text else '' - if data.get('headlines'): - title = '

' + data['headlines']['basic'] + '

' - elif data.get('metadata'): - title = '

' + data['metadata']['headlines']['basic'] + '

' + title = '

' + data['headlines']['basic'] + '

' subhead = '

' + data['description'].get('basic', '') + '' promo_img = ''