04-26-2013, 03:26 AM | #541 |
Enthusiast
Posts: 32
Karma: 10
Join Date: Jun 2012
Device: Kindle 4 NT (broke), Kindle Paperwhite, Kindle 2
|
Hi. thanks for the update.
|
04-27-2013, 03:15 AM | #542 |
Enthusiast
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
|
Thanks for great handy tool.
But there's a problem. Windows 7 x32, KindleUnpack 0.61, 0.62 From GUI shell the tool works perfectly, but when it is started from command line AND filename contains cyrillic symbols, it says that "'utf8' codec can't decode byte 0xcb in position 0: invalid continuation byte". Renamed with latin characters file will be unpacked pretty well, so the problem only with filename handling. Is it possible to do something with it? |
Advert | |
|
04-27-2013, 10:44 PM | #543 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
Even in command line mode, kindleunpack makes calls to get the command line using Windows Wide calls to get a full unicode version of all arguments, which it then converts to utf-8 internally. So I am surprised you are having trouble. What shell and what encoding are you using to invoke the command line? Are you by any chance using a bat file? If so you will need to use cp65001 on the same line you use to invoke kindleunpack. Thanks, KevinH Quote:
|
|
04-28-2013, 02:37 AM | #544 |
Enthusiast
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
|
The command line codepage is cp866, the shell is cmd.exe. As I said, when invoking from command line / bat file, it gets the error. Even if the directory path of the MOBI file contains cyrillic, but the filename itself in latin chars, then it's all OK. Is it necessary to convert filename? For example, the kindlestrip tool, written on python too, works well. Without conversion or something like that.
|
04-28-2013, 02:17 PM | #545 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
You should just be able to fix your bat file to change to cp65001 on the same line you invoke kindleunpack.py Something similar to the following should work in your bat file Code:
chcp 65001 > nul && start /min python kindleunpack.py %* Changing to utf-8 (cp-65001) first allows all chars from every language to be represented and properly passed to Windows so hat Windows wide calls can be made to get all arguments. Please give something similar to this a try and you should be able to get the command line to work properly on Windows. If not, enable debug mode from the command line and post a full debug output here in case the problem is occurring someplace other than right at the command line interface. Please let me know the result. Thanks, KevinH Quote:
|
|
Advert | |
|
04-28-2013, 03:01 PM | #546 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
You are right it is a bug. In kindleunpack.py, near the end of the file, you will see the following code block: Code:
argv=utf8_argv() progname = os.path.basename(argv[0]) try: opts, args = getopt.getopt(sys.argv[1:], "hdrs") except getopt.GetoptError, err: print str(err) usage(progname) sys.exit(2) if len(args)<1: usage(progname) sys.exit(2) for o, a in opts: if o == "-d": DUMP = True if o == "-r": WRITE_RAW_DATA = True if o == "-s": SPLIT_COMBO_MOBIS = True if o == "-h": usage(progname) sys.exit(0) if len(args) > 1: infile, outdir = args else: infile = args[0] Code:
opts, args = getopt.getopt(sys.argv[1:], "hdrs") Code:
opts, args = getopt.getopt(argv[1:], "hdrs") Hope this fixes the issue! Thanks, KevinH Last edited by KevinH; 04-28-2013 at 03:07 PM. |
04-28-2013, 04:52 PM | #547 |
Enthusiast
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
|
Oh, thank you! Now it works with any symbol set.
|
04-28-2013, 08:15 PM | #548 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
Thanks for letting me know that did the trick. I will include it in the next update but that may be a while away since neither the gui nor the calibre plugin uses the command line interface. Take care, Kevin |
06-17-2013, 01:41 PM | #549 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jun 2013
Device: ipad,kindle
|
Hi,
I have a problem with the KindleUnpack/MobiUnpack drag&drop applescript. The mobi file I'd like to unpack is a custom-made non-drm book I create with kindlegen from an ePub file. The problem is that if I drag the mobi file over the MobiUnpack applescript and drop it, I can see the script opening and closing on the dock but no folder appears close to the mobi file. Isn't the folder of the unpacked book supposed to appear in the same folder the two files are? Am I doing something wrong? I was used to use those scripts while ago and maybe I forgot how to use them properly (or maybe they don't work on the last OSX?..btw I have OSX 10.8.4). Thanks in advance to everyone. Sorry for bothering you with my issues. |
06-17-2013, 02:14 PM | #550 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi,
Try simply double-clicking on that applescript (instead of dragging and dropping something on it) and see if it allows you to set or change preferences. Perhaps there is a preference where you tell it where to put the unpacked files? I am not too sure but Paul will know for sure. If not, then it may be a bug in KindleUnpack somehow? You can try running it via the command line or by simply double-clicking the KindleUnpack.pyw app and following along. Once there you can see a log file and turn on debug and raw flags so that we can see what is happening. Thanks, KevinH Quote:
|
|
06-17-2013, 06:13 PM | #551 | |
The Grand Mouse 高貴的老鼠
Posts: 72,497
Karma: 309060442
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
|
|
06-21-2013, 10:42 AM | #552 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jun 2013
Device: ipad,kindle
|
Problem solved!
Thank you sooooooo much!! You guys are life savers! |
07-17-2013, 01:44 AM | #553 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Hello again!
I'm still using a stripped down KindleUnpack in the Kindle ScreenSavers hack, and one user just ran into a weird thing: a JPEG file with no EXIF or JFIF header, used as the cover. imghdr doesn't handle those, so it gets discarded as an unknown resource. FWIW, GIMP chokes on it too, but ImageMagick handles it fine. Since I'm using IM, I amended the imghdr check with another one, right after: Code:
# imghdr only checks for JFIF or Exif JPEG files. Apparently, there are some with only the magic JPEG bytes out there... ImageMagick handle those, so, do it too. if imgtype is None and data[0:2] == chr(0xFF) + chr(0xD8): imgtype = "jpeg" Last edited by NiLuJe; 07-17-2013 at 01:49 AM. |
07-17-2013, 01:46 AM | #554 |
creator of calibre
Posts: 44,528
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
07-17-2013, 02:31 AM | #555 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Ha ! Should have checked Calibre ;-)
Thanks ! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 05:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 08:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 02:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 01:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 10:28 AM |