From c59cdc2963d592938fc457839928de74e072b0e2 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:31:14 +0530 Subject: [PATCH] Update reuters.recipe images too large. --- recipes/reuters.recipe | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/reuters.recipe b/recipes/reuters.recipe index 2264749e92..f9d0e40f3a 100644 --- a/recipes/reuters.recipe +++ b/recipes/reuters.recipe @@ -101,3 +101,8 @@ class Reuters(BasicNewsRecipe): article['url'] = 'https://{}{}'.format(base, article['url']) yield article self.log('\t', article['title'], article['url']) + + def preprocess_html(self, soup): + for img in soup.findAll('img', attrs={'srcset':True}): + img['src'] = img['srcset'].split()[0] + return soup