mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
57a645e503
commit
6092dcda65
@ -64,11 +64,11 @@ class ft(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def get_cover_url(self):
|
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:
|
try:
|
||||||
soup = self.index_to_soup(url)
|
soup = self.index_to_soup(url)
|
||||||
except Exception:
|
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"]')
|
img = soup.select_one('img.attachment-full[src*="Financial-Times"]')
|
||||||
src = img['src']
|
src = img['src']
|
||||||
return src
|
return src
|
||||||
|
@ -6,8 +6,8 @@ from itertools import zip_longest
|
|||||||
from urllib.parse import quote, urlencode
|
from urllib.parse import quote, urlencode
|
||||||
|
|
||||||
from calibre import browser
|
from calibre import browser
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ def get_article(article_id):
|
|||||||
'User-Agent': 'okhttp/4.10.0',
|
'User-Agent': 'okhttp/4.10.0',
|
||||||
'Accept-Encoding': 'gzip',
|
'Accept-Encoding': 'gzip',
|
||||||
'Cache-Control': 'no-cache',
|
'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()
|
br = browser()
|
||||||
req = Request(
|
req = Request(
|
||||||
@ -35,7 +35,7 @@ class WSJ(BasicNewsRecipe):
|
|||||||
description = (
|
description = (
|
||||||
'The Print Edition of WSJ. The Wall Street Journal is your source '
|
'The Print Edition of WSJ. The Wall Street Journal is your source '
|
||||||
'for breaking news, analysis and insights from the U.S. and '
|
'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'
|
language = 'en_US'
|
||||||
masthead_url = 'https://s.wsj.net/media/wsj_amp_masthead_lg.png'
|
masthead_url = 'https://s.wsj.net/media/wsj_amp_masthead_lg.png'
|
||||||
|
@ -5,8 +5,8 @@ from itertools import zip_longest
|
|||||||
from urllib.parse import quote, urlencode
|
from urllib.parse import quote, urlencode
|
||||||
|
|
||||||
from calibre import browser
|
from calibre import browser
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ def get_article(article_id):
|
|||||||
'User-Agent': 'okhttp/4.10.0',
|
'User-Agent': 'okhttp/4.10.0',
|
||||||
'Accept-Encoding': 'gzip',
|
'Accept-Encoding': 'gzip',
|
||||||
'Cache-Control': 'no-cache',
|
'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()
|
br = browser()
|
||||||
req = Request(
|
req = Request(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user