From c58089b459006cafc52b8c8c1db43a01ffb40af0 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Sat, 19 Apr 2025 08:27:17 +0530 Subject: [PATCH] Update wash_post.recipe add cover --- recipes/wash_post.recipe | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/wash_post.recipe b/recipes/wash_post.recipe index d5a9ad42c7..995e6bf5c2 100644 --- a/recipes/wash_post.recipe +++ b/recipes/wash_post.recipe @@ -58,6 +58,13 @@ class TheWashingtonPost(BasicNewsRecipe): .time { font-size:small; color: #202020; } ''' + def get_cover_url(self): + soup = self.index_to_soup('https://www.washingtonpost.com/todays_paper/updates/') + if img := soup.find( + 'img', attrs={'src': lambda x: x and x.endswith('_FrontPage.png')} + ): + return img['src'] + def get_browser(self, *args, **kwargs): kwargs['user_agent'] = ( 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'