07-03-2023, 01:42 PM | #1 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
|
[Help] Recipe for a Medium blog, images missing
Hello! There is this blog on Medium that I really like, and the other day I decided to try and make a calibre recipe to read it on my Kobo. All of Medium's blogs have a hidden RSS feed, obtained by adding "/feed" to the link, so I could easily make a recipe:
Feed recipe Spoiler:
This recipe gets the full text from the feed itself and works perfectly. The only problem with it is that the feed lists only the latest 10 articles, and ideally I'd like a way bigger number. So I read the manual and I embarked on making a way more complicated recipe, based on the complete list of articles found here on Reddit After some hours of frustrations, print statements and regex hell I got this more than acceptable result: New recipe Spoiler:
The new recipe does all I want it to, except for a big problem: no images are downloaded. The two relevant lines while debugging are: Code:
Processing images... Recursion limit reached. Skipping links in https://admiralcloudberg.medium.com/a-sickness-and-its-cure-the-crash-of-trans-colorado-airlines-flight-2286-fab2e7b2fcc3 I don't really know Python apart from the basics, so any help debugging or with the parameters would be really appreciated |
07-03-2023, 07:44 PM | #2 |
creator of calibre
Posts: 43,963
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
the images are likley loaded via javascript (delay loading) look at the actual downloaded html you get and see if you can find a reference to the images in the hTML, it's often something like an <img> tag with a data-src attribute or a wrapper tag that contains the actual img URL. Implement preprocess_html in your recipe and convert those into notmal <img src> tags.
|
07-04-2023, 11:42 AM | #3 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
|
That was the problem, thanks! The new recipe is now almost perfect, I'll post it here for anyone interested in working with Medium.
New recipe Spoiler:
There are still two minor things with which I'm having a hard time:
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe fails to download some images due to slow loading of the images | itssudipok | Recipes | 2 | 07-05-2022 01:05 PM |
New Recipe - Cachys Blog - DE | VoHegg | Recipes | 0 | 05-14-2022 06:56 AM |
Washington Post recipe missing images | ghantaz | Recipes | 0 | 11-14-2021 04:48 PM |
REQUEST: recipe for blog | ayurazzz | Recipes | 0 | 03-25-2011 01:00 PM |
PDF images not visible in Medium size font | asaxena11 | Sony Reader | 3 | 12-20-2008 10:10 PM |