From 384feacec44602a433268b761c444a1df6abe4cd Mon Sep 17 00:00:00 2001 From: ByteTheBubble Date: Wed, 28 May 2025 10:27:19 +0200 Subject: [PATCH] Add missing front cover to financial_times.recipe Use 'https://www.tomorrowspapers.co.uk' as a new source for the front cover of the FT --- recipes/financial_times.recipe | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/financial_times.recipe b/recipes/financial_times.recipe index 6322a54b37..d7f320f1d3 100644 --- a/recipes/financial_times.recipe +++ b/recipes/financial_times.recipe @@ -2,6 +2,7 @@ # vim:fileencoding=utf-8 import json import re +from datetime import date from urllib.parse import quote from html5_parser import parse @@ -63,8 +64,11 @@ class ft(BasicNewsRecipe): ] def get_cover_url(self): - soup = self.index_to_soup('https://www.frontpages.com/financial-times/') - return 'https://www.frontpages.com' + soup.find('img', attrs={'id':'giornale-img'})['src'] + url = f"https://www.tomorrowspapers.co.uk/financial-times-front-page-{date.today():%Y-%m-%d}/" + soup = self.index_to_soup(url) + img = soup.select_one('img.attachment-full[src*="Financial-Times"]') + src = img['src'] + return src # needs_subscription = 'optional' #