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 09-07-2023, 01:50 AM   #1
daneel_olivaw
Junior Member
daneel_olivaw began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2023
Device: Kindle Paperwhite
Request: Substack recipe that excludes paid posts

The Substack recipe currently downloads previews of paywalled articles when one is not logged in. I'm wondering if it's possible to create a recipe that excludes paywalled posts.

Don't have the technical skills to code it myself but happy to attempt to hack it together if someone can point me to another recipe that uses similar kind of conditional exclude rules - I'm thinking either based on post tags, or if specific words are present in the post (for ex: all paywalled substack posts include the words read more as part of the link to access the rest of the post).
daneel_olivaw is offline   Reply With Quote
Old 09-07-2023, 04:19 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,930
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
you can call self.abort_article inside the preprocess_html() method if you detect it is not an article you want. That method has access to the article contents.
kovidgoyal is offline   Reply With Quote
Old 09-11-2023, 02:11 AM   #3
daneel_olivaw
Junior Member
daneel_olivaw began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2023
Device: Kindle Paperwhite
Are you aware of any other recipes that use self.abort_article?

Like I said, I don't actually understand the code or where/how it needs to be inserted and in what format, with what arguments, but could maybe try and figure it out if given an example that is doing similar things.

Would be grateful if you could point me to a recipe that I could look at. Thanks!
daneel_olivaw is offline   Reply With Quote
Old 09-11-2023, 08:12 AM   #4
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: 454
Karma: 82686
Join Date: May 2021
Device: kindle
there are a lot of recipes that does this, try searching for self.abort_article on github calibre recipes folder.

i used it in Indian express recipe, for example.
unkn0wn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
add login information to substack custom recipe tonedeaf Recipes 0 03-24-2023 06:27 AM
WSJ (paid) recipe - request for filename/title change stualden Recipes 4 09-13-2019 09:53 AM
Recipe help for paid posts on blog ds92 Recipes 4 09-10-2013 07:46 AM
Paid Recipe Request rainrdx Recipes 1 07-26-2012 03:31 PM
Recipe Volkskrant paid version prodsaaw Calibre 0 02-18-2010 04:00 PM


All times are GMT -4. The time now is 08:02 PM.


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