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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2014, 07:07 PM   #16
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Just saw your edit.
eschwartz is offline   Reply With Quote
Old 11-27-2018, 04:38 AM   #17
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
This post really save a lot of time running the kindlegen and kindlestrip in bulk. Thanks Doitsu!

Last edited by toancv; 12-27-2018 at 02:58 AM.
toancv is offline   Reply With Quote
Advert
Old 01-02-2019, 09:39 PM   #18
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
I am just wondering if we can batch coverting epub to azw3 by this similar, without using Caliber as Caliber tend to change the css after conversion?
toancv is offline   Reply With Quote
Old 01-03-2019, 06:59 AM   #19
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by toancv View Post
I am just wondering if we can batch coverting epub to azw3 by this similar, without using Caliber as Caliber tend to change the css after conversion?
Batch file AZW3 conversion would require Python post-processing with KindleUnpack without Calibre.

However, if you install Kindle Previewer and the Calibre KFX Output plugin, you could use the following command to convert all your .epub books to .kfx books.

Code:
FOR %%f IN ("*.epub") DO (calibre-debug -r "KFX Output" "%%f" >> conversion.log)
(The KFX Output plugin also uses KindleGen and only changes the original .epub file, if it'd otherwise not compile with KindleGen.)
Doitsu is offline   Reply With Quote
Old 01-07-2019, 12:30 AM   #20
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
Thanks Doitsu!

I have Python installed in PC and Kindle Unpacked installed in Calibre. Is there any way to batch converting epub to azw3?
toancv is offline   Reply With Quote
Advert
Old 01-09-2019, 06:01 AM   #21
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by toancv View Post
I have Python installed in PC and Kindle Unpacked installed in Calibre. Is there any way to batch converting epub to azw3?
I've attached a simple Python 3.x script that'll convert all .epub files to .azw3 files with KindleGen and KindleUnpack. To use it simply extract convert.py and the kindleunpack folder from the attached .zip file to the folder that contains the .epub files that you want to convert and double-click convert.py.
If you didn't install Kindle Previewer or didn't install it in the default location, you'll also need to copy kindlegen.exe or kindlegen to the folder.

If books fail to convert, have a look at the KindleGen warning and error messages in errors.txt. (If nothing happens after you double-click convert.py, you'll have to manually execute the script in a command prompt/terminal window.)

BTW, the script will also add (fake) ASIN numbers to azw3 files by default. If you don't want it to add ASIN numbers, change the following line in convert.py from:

Code:
    add_asin = True
to:

Code:
    add_asin = False
Attached Files
File Type: zip epub2azw3.zip (15.1 KB, 255 views)
Doitsu is offline   Reply With Quote
Old 01-11-2019, 04:50 AM   #22
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
Thanks for Doitsu!. Try your script without success. I installed python 3.7.2 and Kindle Previewer latest version. There is no .txt file created when I double click 'converter.py'. When I use command line, the follwoing error show up:
Quote:
C:\Users\toancv\Downloads\Epub to azw3>converter.py
Traceback (most recent call last):
File "C:\Users\toancv\Downloads\Epub to azw3\converter.py", line 10, in <module>
from mobi_split import mobi_split
File "C:\Users\toancv\Downloads\Epub to azw3\kindleunpack\mobi_split.py", line 11, in <module>
from unipath import pathof
File "C:\Users\toancv\Downloads\Epub to azw3\kindleunpack\unipath.py", line 29, in <module>
from compatibility_utils import PY2, PY3, text_type, binary_type
File "C:\Users\toancv\Downloads\Epub to azw3\kindleunpack\compatibility_utils.py", line 51, in <module>
_h = HTMLParser()
NameError: name 'HTMLParser' is not defined
toancv is offline   Reply With Quote
Old 01-11-2019, 05:34 AM   #23
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by toancv View Post
Thanks for Doitsu!. Try your script without success. I installed python 3.7.2 and Kindle Previewer latest version. There is no .txt file created when I double click 'converter.py'. When I use command line, the follwoing error show up:
The error that you got is only displayed, if converter.py is executed with a Python 2 interpreter.

Open a command prompt window and enter the full Python 3 path before convert.py. For example:

Code:
"C:\Python37\python.exe" "D:\books\epub2azw3\converter.py"
BTW, if Sigil is installed on your computer, you should also be able to use the bundled Python 3 interpreter:

Code:
"C:\Program Files\Sigil\python3.exe" "D:\books\epub2azw3\converter.py"
(Obviously, you'll need to adjust all paths.)
Doitsu is offline   Reply With Quote
Old 01-24-2019, 04:24 AM   #24
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
Hi Doitsu,
I tried many times but still could not succeed. Here is the error:

Quote:
C:\Users\toancv>"C:\Program Files\Sigil\python3.exe"
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> "C:\Users\toancv\Downloads\Epub2azw3\converter .py"
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
>>>
toancv is offline   Reply With Quote
Old 01-24-2019, 04:40 AM   #25
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by toancv View Post
Hi Doitsu,
I tried many times but still could not succeed. Here is the error:
In the code that you posted there was a space before ".py".

Code:
>>> "C:\Users\toancv\Downloads\Epub2azw3\converter .py"
You're also not supposed to open converter.py from within the Python interpreter. Use the following command line:

Code:
"C:\Program Files\Sigil\python3.exe" "C:\Users\toancv\Downloads\Epub2azw3\converter.py"
Doitsu is offline   Reply With Quote
Old 01-24-2019, 07:36 AM   #26
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
Thanks. I successfully managed to create the azw3 file as your instruction. However, with kindlegen plugin in Sigil, I can reserve the mobi-asin in original epub file when creating azw3 file by choosing "Add fake ASIN". For this method, the original mobi-asin has been replaced by the new created mobi-asin. Any way to fix it?

Edit: It works ok with epub2. But it cannot reserve original mobi-asin with my epub3.

Last edited by toancv; 01-24-2019 at 08:08 AM.
toancv is offline   Reply With Quote
Old 01-24-2019, 08:09 AM   #27
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by toancv View Post
For this method, the original mobi-asin has been replaced by the new created mobi-asin. Any way to fix it?
Currently the script only supports ASIN metadata entries in epub2 files.
I might add epub3 ASIN support in the next version, if more users ask for it.
Doitsu is offline   Reply With Quote
Old 01-24-2019, 09:31 PM   #28
toancv
Connoisseur
toancv began at the beginning.
 
Posts: 69
Karma: 10
Join Date: Nov 2018
Device: Kindle paperwhite, Likebook Mars, Kobo Aura Ed. 2, Kobo Touch
Doitsu, thanks for your clarification and help!
toancv is offline   Reply With Quote
Old 01-25-2019, 10:01 AM   #29
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Sigil's bundled Python won't really work (reliably) as a standalone Python environment without a lot of environment variables and paths being properly set before-hand. Sigil's plugin-launcher makes certain the environment is correct (and isolated) before running any python scripts.

It may work in most cases, but I wouldn't trust it all that much outside of Sigil's plugin framework.
DiapDealer 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
Scripting ebook-convert for batch parallel processing? joewiz Conversion 9 03-15-2013 05:34 AM
Tag editor with batch processing semenoof General Discussions 0 01-17-2013 03:12 AM
Batch processing of PDB files? Asterra iRex 6 12-04-2007 01:10 PM


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


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