View Single Post
Old 12-05-2016, 08:22 AM   #5
notimp
Addict
notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.
 
Posts: 248
Karma: 892441
Join Date: Jul 2010
Device: K2i
Thank you very much for your work and this great extension. Sync is faster than with other solutions running on top of Amazons Whispersync in the past.

I only found one shortcoming so far and that is, that files don't get downloaded correctly if there is an unexpected non-standard character (like an umlaut) in the filename.

But I was able to easily fix this with a shell script on my Mac (thats used to move files to the Dropbox folder).

Also, I managed to get an entire soft-hyphenation and conversion workflow set up using only the command line - so the azw3 file that now ends up in my sync folder already is hyphenated once it reaches the Kindle, after running one simple script.

My (macOS) script (save as a .sh file), if some of you wan't to set up something similar:
Code:
cd ~/Downloads

mv "$(ls -t | grep '\.epub$' |head -1)" ~/Dropbox/

sleep 0.5

cd ~/Dropbox

cp "$(ls -t | grep '\.epub$' |head -1)" ~/Dropbox/Books/

cd ~/Dropbox/Books

find . -name '*.epub' -exec /Applications/calibre.app/Contents/console.app/Contents/MacOS/calibre-debug -e ~/Documents/kindle-hyphens/main.py {} {} \;

sleep 0.5

/Applications/calibre.app/Contents/console.app/Contents/MacOS/ebook-convert "$(ls -t | grep '\.epub$' |head -1 | grep -Po '.*(?=\.)' | sed 's/(\(.*\))//' | sed -e 's/[^A-Za-z0-9._-]/ /g').azw3" --share-not-sync --change-justification justify

rm "$(ls -t | grep '\.epub$' |head -1)"

sleep 1

killall Terminal
This script uses calibre (you also have to have the Modify ePub plugin (https://www.mobileread.com/forums/sh...d.php?t=154371) installed) and kindle-hyphens (https://github.com/dmalinovsky/kindle-hyphens).

To use kindle-hyphens you must have Calibre (with the Modify ePub plugin), Python and lxml installed.

To install lxml read the kindle-hyphens readme, or look at this thread: http://stackoverflow.com/questions/1...-mac-os-x-10-9

What the script above does:

Takes the most recent epub in ~/Downloads, moves it to ~/Dropbox and copies it to ~/Dropbox/Books , lets kindle-hyphens put soft hyphens in the epub in ~/Dropbox/Books, uses calibre to convert it to an .azw3 (and some | grep | sed magic to remove all special characters and brackets (including the stuff in the brackets) from the filename, then deletes the .epub in ~/Dropbox/Books (.azw3 remains there of course), but leaves the one in ~/Dropbox for archival purposes.

Have fun setting up a similar workflow for yourselves.

n.

Last edited by notimp; 04-16-2017 at 09:29 AM.
notimp is offline   Reply With Quote