Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-19-2018, 07:34 PM   #31
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,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@davidnye: The username and password were not used int he old recipe either. The NYT uses a captcha at login even with valid usernames and passwords.

@bobbysteel: Because I have no interest in implementing/maintaining it, and it creates extremely large downloads.
kovidgoyal is offline   Reply With Quote
Old 02-21-2018, 05:38 AM   #32
nelson1379
Enthusiast
nelson1379 began at the beginning.
 
Posts: 31
Karma: 32
Join Date: Jan 2012
Device: Kindle Paperwhite
I saw you caught the class "supported-by" that added some cruft to articles. Thanks! There's just one more class at the moment that I've found, "accessibility-ad-header visually-hidden", that also adds cruft to each article (typically the word "Advertisement" to each article, around the fifth paragraph). I used this line in my own recipe, which does the job:

Quote:
classes('accessibility-ad-header visually-hidden'),
A side question -- I'm still curious about replacing hyperlinks in the recipe with plain old text, a change which I gather is not desirable for the upstream recipe in Calibre. I've been trying to implement it in the version of the recipe that I run, and from what I've seen on this forum and in other recipes, this bit of code is instrumental in removing hyperlinks:

Quote:
def preprocess_html(self, soup):
for alink in soup.findAll('a'):
if alink.string is not None:
tstr = alink.string
alink.replaceWith(tstr)
return soup
I've tried it everywhere in the NYT recipe, but wherever I put it, it seems to have no effect. Can anyone tell me if there's something I'm missing -- is there a place I'm supposed to put it, or an extra bit of code that it hooks into, or something special about the structure of this recipe that requires something different? Thanks.
nelson1379 is offline   Reply With Quote
Advert
Old 02-21-2018, 06:31 AM   #33
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,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You are probably indenting it incorrectly. The method needs to be indented at four spaces to be considered a part of the class. But probably easier to just add

remove_attributes = ['href']
kovidgoyal is offline   Reply With Quote
Old 02-22-2018, 05:48 AM   #34
nelson1379
Enthusiast
nelson1379 began at the beginning.
 
Posts: 31
Karma: 32
Join Date: Jan 2012
Device: Kindle Paperwhite
Thank you -- that's perfect.
nelson1379 is offline   Reply With Quote
Old 09-09-2018, 07:04 PM   #35
kingduct
Enthusiast
kingduct doesn't litterkingduct doesn't litterkingduct doesn't litter
 
Posts: 45
Karma: 220
Join Date: Jul 2010
Device: none
Setting is_web_edition=False in The New York Times recipe

I run a headless linux server that downloads my New York Times so I can read it on my Kindle. Running /usr/bin/xvfb-run /opt/calibre/ebook-convert "The New York Times.recipe" with options brings it in.

I would prefer to get "Today's Paper" rather than the web edition. Yet, when I add "--is_web_edition=False" to my command, I get en ebook-convert error telling me there's no such option.

Years ago, when I installed Calibre at the command line, it would include a recipes directory. But now, it appears that it always downloads the current version of the recipe. Usually, this is great. However, it also means I can't just enter the recipe file and set "is_web_edition" to False.

Is there a way I can pass this value from the command line? If not, how can I download the current version of the recipe and set it up such that it works from the command line? Or is there a different recipe for getting "Today's Paper?"

Thanks in advance.

Quote:
Originally Posted by nelson1379 View Post
Completed successfully for me with "is_web_edition = True".

I should note that when it crashed before with "is_web_edition = False", it crashed within seconds.

I don't know why mspark and I would get two separate outcomes.
kingduct is offline   Reply With Quote
Advert
Old 09-09-2018, 11:09 PM   #36
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,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1) You dont need xvfb-run
2) calibre still includes a recipe directory (it's zipped up as builtin_recipes.zip) and you can specify recipe files directly by path to the recipe file instead of using a title, in which case no downloading of recipes happens
kovidgoyal is offline   Reply With Quote
Old 10-11-2018, 10:29 PM   #37
kingduct
Enthusiast
kingduct doesn't litterkingduct doesn't litterkingduct doesn't litter
 
Posts: 45
Karma: 220
Join Date: Jul 2010
Device: none
Thank you!

I think I have it working as desired.
kingduct is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New York Times Technology Beat is broken NSILMike Recipes 1 04-16-2017 12:55 AM
New York Times Book Review broken again. wingmongyee Recipes 9 03-24-2016 07:20 PM
New York Times Book Review broken wingmongyee Recipes 3 01-02-2016 12:32 AM
New York Times Recipe dieterpops Recipes 1 01-20-2013 12:26 PM
New York Times recipe broken? gianfri Calibre 1 03-20-2010 09:52 AM


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


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