Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-04-2022, 10:06 AM   #1
itssudipok
Junior Member
itssudipok began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2021
Location: West Bengal
Device: Kindle Paper White 11th Gen
Recipe fails to download some images due to slow loading of the images

Hi,

I have modified 'The Hindu' recipe already available to fetch news/articles from the Hindu for fetching news and articles from the Ananda Bazar Patrika, a bengali daily. The script works fine meaning the 'feeds' is okay, but it downloads some image place holders (a white image showing the newspaper name) instead of the real images, which take a bit of time to appear on the place holders in the webpage. As a result, with other images related to the articles, I am getting some annoying image place holders in the final epub version. Could anyone help me with this so that calibre could wait for a bit for appearing the images and then start fetching it from there?

Thanks in advance.
With Best Regards
itssudipok is offline   Reply With Quote
Old 07-05-2022, 01:25 AM   #2
unkn0wn
Evangelist
unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.
 
Posts: 468
Karma: 82692
Join Date: May 2021
Device: kindle
try adding this to the recipe and check.
Code:
def preprocess_html(self, soup):
        for img in soup.findAll('img', attrs={'data-src': True}):
            img['src'] = img['data-src']
        return soup
upload the recipe here. you'll most probably be the only bengali here using this recipe but might help others someday.
unkn0wn is offline   Reply With Quote
Advert
Old 07-05-2022, 01:05 PM   #3
itssudipok
Junior Member
itssudipok began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2021
Location: West Bengal
Device: Kindle Paper White 11th Gen
Quote:
Originally Posted by unkn0wn View Post
try adding this to the recipe and check.
Code:
def preprocess_html(self, soup):
        for img in soup.findAll('img', attrs={'data-src': True}):
            img['src'] = img['data-src']
        return soup
upload the recipe here. you'll most probably be the only bengali here using this recipe but might help others someday.
Thank you very much for your help. Yes, it works perfect for me.
Definitely I will upload it, actually I am trying to make the script clean. Once it is done, I will upload the recipe here.
itssudipok is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Pocket recipe download ALL images from each article and not just one? Pino76 Recipes 1 10-29-2015 12:15 PM
build-in scmp recipe didn't download images timoy_kindle Recipes 1 09-27-2014 07:40 AM
FAZ.NET recipe fails due to website redesign juco Recipes 7 10-07-2011 11:53 AM
Fails to export images? st_albert Writer2ePub 4 07-20-2011 05:47 PM
slow loading of images on my jetbook jcarlos Ectaco jetBook 3 09-07-2009 12:01 AM


All times are GMT -4. The time now is 06:52 PM.


MobileRead.com is a privately owned, operated and funded community.