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 10-28-2011, 08:57 PM   #1
awitko
Member
awitko began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2011
Device: Kindle
Embedding user name/password for crontab

I am trying to implement calibre on a linode vps server. I have gotten it to work in general for other periodicals by running a script containing something like the following.

ebook-convert /opt/calibre/resources/recipes/nytimes.recipe nytimes.mobi
calibre-smtp --attachment nytimes.mobi --relay smtp.gmail.com --port 587 --username gmailusername --password "gmailpassword" --encryption-method TLS gmailusername@gmail.com kindleusername@free.kindle.com ""
rm nytimes.mobi

Is there any way I can specify the ny times user name and password in the command line, the shell, or in the recipe. This is a headless server which will run these using crontab? And similarly for wsj and economist?

Alex
awitko is offline   Reply With Quote
Old 10-28-2011, 10:39 PM   #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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
--username xxx --password yyy

Last edited by kovidgoyal; 10-28-2011 at 10:53 PM.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-04-2011, 04:01 PM   #3
vov
Junior Member
vov began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2010
Device: none
Thanks for calibre. It is a very useful tool.

Could you provide an option to include the username and password in the recipe for feeds that require them.

I want to be able to do something simple like this bulk conversion:

for i in *.recipe ; do ebook-convert "$i" $(basename $i recipe)epub; done

but recipes which require passwords will obviously fail as things stand.
vov is offline   Reply With Quote
Old 12-04-2011, 09:31 PM   #4
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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
--username and --password
kovidgoyal is offline   Reply With Quote
Old 12-05-2011, 03:33 AM   #5
vov
Junior Member
vov began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2010
Device: none
Perhaps I didn't make things clear enough.

% ls -CF *recipe
instapaper_calibre.recipe
spiegel_int.recipe
theonion.recipe

% for i in *.recipe ; do ebook-convert $i $(basename $i recipe)epub; done
1% Converting input to HTML...
InputFormatPlugin: Recipe Input running
Traceback (most recent call last):
File "site.py", line 58, in main
File "site-packages/calibre/ebooks/conversion/cli.py", line 287, in main
File "site-packages/calibre/ebooks/conversion/plumber.py", line 959, in run
File "site-packages/calibre/customize/conversion.py", line 204, in __call__
File "site-packages/calibre/web/feeds/input.py", line 104, in convert
File "site-packages/calibre/web/feeds/news.py", line 718, in __init__
ValueError: The "Instapaper" recipe needs a username and password.

==
But I had included these lines in the instapaper.recipe

username = "user@bla.bla"
password = "password"

I know that I can do this instead, but it is not what I want:
ebook-convert instapaper.recipe instapaper.epub --username="user@bla.bla" --password="password"

I'd like the conversion to loop through several recipes some of which may require usernames and passwords, hence my request to have the option of storing those in the recipe. I wouldn't want to pass those values explicitly via the script for maintenance reasons.

Thanks.
vov is offline   Reply With Quote
Advert
Old 12-05-2011, 05:21 AM   #6
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,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
So setup a dictionary mapping recipe names to usernames and apsswords in your script and loop over it. Or modify the get_browser functions in the recpes you care about.
kovidgoyal is offline   Reply With Quote
Reply

Tags
crontab, password, user name


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 CharisSIL embedding Richelieu Sony Reader 2 10-09-2010 08:07 PM
Embedding fonts JaneFancher Calibre 14 04-10-2010 09:28 PM
User Password Protected PDF Ebook debbielovesbooks PDF 1 01-09-2010 02:04 PM
Embedding Tags PieOPah Calibre 4 08-21-2009 06:54 PM
User / Password every 5 Min. Axelos Feedback 11 08-26-2008 04:54 AM


All times are GMT -4. The time now is 04:45 PM.


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