From 6c9e2d14a217cca19c21f1b3ee606bbba6960c1d Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Sat, 28 Sep 2024 11:16:28 +0530 Subject: [PATCH] ... --- recipes/india_today.recipe | 2 +- recipes/scientific_american.recipe | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/india_today.recipe b/recipes/india_today.recipe index 23ec834516..e7b7c1b73c 100644 --- a/recipes/india_today.recipe +++ b/recipes/india_today.recipe @@ -103,7 +103,7 @@ class IndiaToday(BasicNewsRecipe): if 'description_short' in data: desc = '
' + data['description_short'] + '
\n' if data.get('author'): - author = ''.join([names['title'] for names in data['author']]) + author = ', '.join([names['title'] for names in data['author']]) if 'city' in data: city = data['city'] if 'datetime_updated' in data: diff --git a/recipes/scientific_american.recipe b/recipes/scientific_american.recipe index 72f2985313..4a0374ec70 100644 --- a/recipes/scientific_american.recipe +++ b/recipes/scientific_american.recipe @@ -26,10 +26,9 @@ class ScientificAmerican(BasicNewsRecipe): extra_css = """ [class^="article_dek-"] { font-style:italic; color:#202020; } [class^="article_authors-"] {font-size:small; color:#202020; } - [class^="article__image-"] { font-size:small; text-align:center; } - [class^="lead_image-"] { font-size:small; text-align:center; } + [class^="article__image-"], [class^="lead_image-"], .calibre-nuked-tag-figcaption { font-size:small; } [class^="bio-"] { font-size:small; color:#404040; } - em { color:#202020; } + em, blockquote { color:#202020; } """ needs_subscription = "optional" @@ -44,9 +43,11 @@ class ScientificAmerican(BasicNewsRecipe): ] def preprocess_html(self, soup): + for h2 in soup.findAll(['h2', 'h3']): + h2.name = 'h4' for fig in soup.findAll('figcaption'): - for p in fig.findAll(['p', 'div']): - p.name = 'span' + for p in fig.findAll('p'): + p.name = 'div' res = '?w=600' w = self.recipe_specific_options.get('res') if w and isinstance(w, str):