|
|
#1 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
financial times update
they changed something and each image is around 10MB.. it takes 10-15 minutes just to load all content and uses too much data and so the output file is also too large.
updated it to resize images. change line 122 from attached recipe to return '<span><img src="{}">'.format(url) instead of <p>.. the text before image also pertains to image. Last edited by unkn0wn; 08-26-2022 at 10:57 AM. |
|
|
|
|
|
#2 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
feed based one needs changing too..
made some minor changes to both recipes. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
ft cover fails
replace with this.. in both recipes (used from telegraph recipe) Code:
def get_cover_url(self):
from datetime import date
cover = 'http://img.kiosko.net/' + str(
date.today().year
) + '/' + date.today().strftime('%m') + '/' + date.today(
).strftime('%d') + '/uk/ft_uk.750.jpg'
br = BasicNewsRecipe.get_browser(self)
try:
br.open(cover)
except:
index = 'https://en.kiosko.net/uk/np/ft_uk.html'
soup = self.index_to_soup(index)
for image in soup.findAll('img', src=True):
if image['src'].endswith('750.jpg'):
return image['src']
self.log("\nCover unavailable")
cover = None
return cover
Last edited by unkn0wn; 08-31-2022 at 04:04 AM. |
|
|
|
|
|
#4 |
|
Junior Member
![]() ![]() Posts: 3
Karma: 158
Join Date: Oct 2022
Device: Kobo Sage
|
I kept getting an SSL error:
Spoiler:
So I rewrote the cover section of the recipe to account for no cover on Sundays for the FT: Code:
def get_cover_url(self):
from datetime import date, timedelta
coverdate = date.today()
if coverdate.weekday() == 6:
coverdate = coverdate - timedelta(days = 1)
cover = 'http://img.kiosko.net/' + str(
coverdate.year
) + '/' + coverdate.strftime('%m') + '/' + coverdate.strftime('%d') + '/uk/ft_uk.750.jpg'
return cover
|
|
|
|
|
|
#5 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
actually this will work.
Code:
def get_cover_url(self):
from datetime import date
cover = 'https://img.kiosko.net/' + str(
date.today().year
) + '/' + date.today().strftime('%m') + '/' + date.today(
).strftime('%d') + '/uk/ft_uk.750.jpg'
br = BasicNewsRecipe.get_browser(self)
try:
br.open(cover)
except:
index = 'https://en.kiosko.net/uk/np/ft_uk.html'
soup = self.index_to_soup(index)
for image in soup.findAll('img', src=True):
if image['src'].endswith('750.jpg'):
return 'https:' + image['src']
self.log("\nCover unavailable")
cover = None
return cover
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Junior Member
![]() ![]() Posts: 3
Karma: 158
Join Date: Oct 2022
Device: Kobo Sage
|
I'm still getting the same error with that change for some reason, SSL wrong signature type
|
|
|
|
|
|
#7 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
Is this the same error type?
https://www.mobileread.com/forums/sh...72&postcount=2 Quote:
did you somehow visit the http link type for it to work? I suggested the above changes so that it will work even when ft isn't published on weekdays or cover isn't updated in kiosko website. In the above changes i used https, make it http.. maybe this will work. Spoiler:
I think if datetime method wont return image.. it should go to kiosko site and find that image. Or this would be much better, Code:
def get_cover_url(self):
soup = self.index_to_soup('https://en.kiosko.net/uk/np/ft_uk.html')
for image in soup.findAll('img', src=True):
if image['src'].endswith('750.jpg'):
return 'https:' + image['src']
self.log("\nCover unavailable")
cover = None
return cover
Last edited by unkn0wn; 10-03-2022 at 06:25 AM. |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Financial times update | kiklop74 | Recipes | 0 | 08-20-2017 03:38 PM |
| Financial Times (UK) and Financial Times (International) recipes are broken | mattyb | Recipes | 1 | 09-05-2014 11:49 AM |
| Financial Times (UK) Update | rainrdx | Recipes | 1 | 04-05-2013 11:02 PM |
| Financial Times | St28 | Calibre | 2 | 07-05-2011 11:50 AM |
| Update Financial Times recipe | sir-archimedes | Recipes | 0 | 04-24-2011 11:39 AM |