This commit is contained in:
Kovid Goyal 2025-06-19 16:54:23 +05:30
parent 57a645e503
commit 6092dcda65
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 7 deletions

View File

@ -64,11 +64,11 @@ class ft(BasicNewsRecipe):
]
def get_cover_url(self):
url = f"https://www.tomorrowspapers.co.uk/financial-times-front-page-{date.today():%Y-%m-%d}/"
url = f'https://www.tomorrowspapers.co.uk/financial-times-front-page-{date.today():%Y-%m-%d}/'
try:
soup = self.index_to_soup(url)
except Exception:
return f"https://img.kiosko.net/{date.today():%Y/%m/%d}/uk/ft_uk.750.jpg"
return f'https://img.kiosko.net/{date.today():%Y/%m/%d}/uk/ft_uk.750.jpg'
img = soup.select_one('img.attachment-full[src*="Financial-Times"]')
src = img['src']
return src

View File

@ -6,8 +6,8 @@ from itertools import zip_longest
from urllib.parse import quote, urlencode
from calibre import browser
from calibre.ptempfile import PersistentTemporaryFile
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.ptempfile import PersistentTemporaryFile
from calibre.web.feeds.news import BasicNewsRecipe, classes
@ -18,7 +18,7 @@ def get_article(article_id):
'User-Agent': 'okhttp/4.10.0',
'Accept-Encoding': 'gzip',
'Cache-Control': 'no-cache',
'x-api-key': ('e''0''5''9''9''5''f''f''4''4''2''1''4''3''2''5''5''e''b''8''3''8''1''f''7''2''d''4''9''1''3''b''f''7''5''0''3''d''6''c'), # noqa: ISC001
'x-api-key': ('e''0''5''9''9''5''f''f''4''4''2''1''4''3''2''5''5''e''b''8''3''8''1''f''7''2''d''4''9''1''3''b''f''7''5''0''3''d''6''c'), # noqa: ISC001
}
br = browser()
req = Request(
@ -35,7 +35,7 @@ class WSJ(BasicNewsRecipe):
description = (
'The Print Edition of WSJ. The Wall Street Journal is your source '
'for breaking news, analysis and insights from the U.S. and '
'around the world, the world\'s leading business and finance publication.'
"around the world, the world's leading business and finance publication."
)
language = 'en_US'
masthead_url = 'https://s.wsj.net/media/wsj_amp_masthead_lg.png'

View File

@ -5,8 +5,8 @@ from itertools import zip_longest
from urllib.parse import quote, urlencode
from calibre import browser
from calibre.ptempfile import PersistentTemporaryFile
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.ptempfile import PersistentTemporaryFile
from calibre.web.feeds.news import BasicNewsRecipe, classes
@ -17,7 +17,7 @@ def get_article(article_id):
'User-Agent': 'okhttp/4.10.0',
'Accept-Encoding': 'gzip',
'Cache-Control': 'no-cache',
'x-api-key': ('e''0''5''9''9''5''f''f''4''4''2''1''4''3''2''5''5''e''b''8''3''8''1''f''7''2''d''4''9''1''3''b''f''7''5''0''3''d''6''c'), # noqa: ISC001
'x-api-key': ('e''0''5''9''9''5''f''f''4''4''2''1''4''3''2''5''5''e''b''8''3''8''1''f''7''2''d''4''9''1''3''b''f''7''5''0''3''d''6''c'), # noqa: ISC001
}
br = browser()
req = Request(