|10-28-2011, 08:57 PM||#1|
Join Date: Oct 2011
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 firstname.lastname@example.org email@example.com ""
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?
|12-04-2011, 04:01 PM||#3|
Join Date: Aug 2010
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.
|12-05-2011, 03:33 AM||#5|
Join Date: Aug 2010
Perhaps I didn't make things clear enough.
% ls -CF *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 = "firstname.lastname@example.org"
password = "password"
I know that I can do this instead, but it is not what I want:
ebook-convert instapaper.recipe instapaper.epub --username="email@example.com" --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.
|12-05-2011, 05:21 AM||#6|
creator of calibre
Join Date: Oct 2006
Location: Mumbai, India
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.
|crontab, password, user name|
|Thread Tools||Search this Thread|
|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||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|