Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-22-2014, 09:40 PM   #1
Mr.Walkman
Junior Member
Mr.Walkman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: Kindle
Question Epub -> Mobi -> Mail with commandline

Hi there,

I'm trying to use the Automator in Mac to do a oneclick solution for converting a epub-file to mobi and then send this file by mail to my kindle.

I got the conversion working with this bash-skript:

Code:
while read LINE
do
	/usr/bin/ebook-convert "$LINE" "$LINE.mobi" --output-profile kindle_pw
done
I tried to include calibre-smtp but the script always failes. How can i hand over the converted file to calibre-smtp in the same command?

calibre-smpt -a "$LINE.mobi" -u... -p... and so on isn't working.

Thanks for your help!
Mr.Walkman is offline   Reply With Quote
Old 02-23-2014, 04:48 AM   #2
Mr.Walkman
Junior Member
Mr.Walkman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: Kindle
okay I got it working. for everyone who also want's to give this a try here is the code:
Code:
while read LINE
do
	/usr/bin/ebook-convert "$LINE" "${LINE/.*/}.mobi"
	/usr/bin/calibre-smtp from@mail.com to@mail.com "sender_name" -r senders_smtp_server -u username -a "${LINE/.*/}.mobi" -p password -e TLS --port 587
rm "${LINE/.epub/}.mobi"
done
This does: convert any file to mobi, sends this file to the kindle and then delete the mobi file again.

replace:

from@mail.com with your personal email
to@mail.com with your kindle email
sender_name with the name you want the mail send to be from (also can leave it empty)
senders_smtp_server with your outgoing smtp server (just google it)
username with your email username
password with your password
TLS either TLS or SSL depends on your providers smpt (just google it)
587 with your providers smtp port (just google it)

just start automator, do a new application add a shell-command field, paste the code, alter it and save the application. drag and drop your file onto the application and the rest will just work
Mr.Walkman is offline   Reply With Quote
Advert
Old 11-18-2020, 07:30 AM   #3
ickam
Junior Member
ickam began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2020
Device: kindle paperwhite 2019
Quote:
Originally Posted by Mr.Walkman View Post
okay I got it working. for everyone who also want's to give this a try here is the code:
Code:
while read LINE
do
	/usr/bin/ebook-convert "$LINE" "${LINE/.*/}.mobi"
	/usr/bin/calibre-smtp from@mail.com to@mail.com "sender_name" -r senders_smtp_server -u username -a "${LINE/.*/}.mobi" -p password -e TLS --port 587
rm "${LINE/.epub/}.mobi"
done
This does: convert any file to mobi, sends this file to the kindle and then delete the mobi file again.
Sorry for replying in an old thread, but is there a way to alter this comment so that it outputs what it is actually doing? I had been using another command thus far, which is

Code:
 find . -name '*.epub' -type f -exec bash -c 'ebook-convert "$0" "${0%.epub}.mobi" --prefer-author-sort --output-profile=kindle --linearize-tables --smarten-punctuation --enable-heuristics' {} \;
which works very nicely and outputs steps as well as progress, but I don't know how to automatize the email sending portion.
ickam is offline   Reply With Quote
Old 11-18-2020, 08:01 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,722
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@ickam, what is it about your ePub that you feel the need to enable heuristics?
JSWolf is offline   Reply With Quote
Old 11-18-2020, 09:07 AM   #5
ickam
Junior Member
ickam began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2020
Device: kindle paperwhite 2019
@JSWolf I was under the impression that heurestics improves line break handling.
ickam is offline   Reply With Quote
Advert
Old 11-18-2020, 10:05 AM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,722
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by ickam View Post
@JSWolf I was under the impression that heurestics improves line break handling.
If the ePub is converted from PDF maybe. But otherwise, there's no reason and all it does is slow down the conversion.
JSWolf is offline   Reply With Quote
Old 11-18-2020, 11:57 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ickam View Post
@JSWolf I was under the impression that heurestics improves line break handling.
Yep. IF the input was a mess (PDF conversion or OCR).
IMHO it can introduce other flaws AND it adds to the time it takes to convert.
theducks is offline   Reply With Quote
Old 11-18-2020, 04:32 PM   #8
ickam
Junior Member
ickam began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2020
Device: kindle paperwhite 2019
Gentlemen, please focus on the emailing part of my question
ickam is offline   Reply With Quote
Old 11-18-2020, 11:35 PM   #9
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: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Make a script that does the conversion and emailling for the passed in filename. Then call it via find.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
18MB EPUB converts to 40MB Mobi! What can I do to reduce Mobi file size? perdman Conversion 11 12-09-2017 04:18 AM
Epub capable ebook reader for win7 with commandline options (CLI) Togg Windows Devices 1 04-24-2013 04:07 PM
Conversion from mobi (to mobi, or epub) breaks internal links bounder Conversion 1 10-09-2012 11:56 AM
Commandline only build plord Calibre 11 11-27-2010 06:56 PM
Automatic Web conversion to mobi/epub and send mail by Calibre bthoven Amazon Kindle 0 11-14-2010 09:56 PM


All times are GMT -4. The time now is 08:05 AM.


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