Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Removing DRM protection from eBooks (http://stream-recorder.com/forum/forumdisplay.php?f=63)
-   -  

How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindle)

(http://stream-recorder.com/forum/showthread.php?t=5426)

headala 07-05-2010 02:19 AM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
If there is anyone who could please help me with the above error I would appreciate it.

I've now tried it on a 32-bit system as well, with the same results. Perhaps it's an issue with my ebook?

nerfherder 07-21-2010 02:41 PM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by headala (Post 19925)
Is anyone else getting an "Error - -249 outside of string table limits" with this? I get it with both the CLI and the GUI.

I had a similar error. I've had success before, so I think it only happens with certain books. This version of convert2xml.py worked for me:

Code:

http://pastebin.com/RDERReyk
The version number is the same as the one that failed for me, but this one is clearly an improvement.

headala 07-25-2010 09:16 PM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by nerfherder (Post 20383)
I had a similar error. I've had success before, so I think it only happens with certain books. This version of convert2xml.py worked for me:

Code:

http://pastebin.com/RDERReyk
The version number is the same as the one that failed for me, but this one is clearly an improvement.

Thank you SO very much for your reply...I was beginning to lose hope that anyone would help!

However, I am still getting the same error. Could you PM me or post the whole topaz tools files you are using? Thanks!

epstewart 08-15-2010 11:56 AM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Help! I accidentally obtained a Topaz e-book and, via Amazon Kindle for Mac, downloaded it. I also downloaded it to Kindle for the iPhone. I would like to convert it to an EPUB for iBooks on the iPhone. As I read through the posts in this thread, I find myself getting very confused. Exactly how do I do what I want to do?

I do know how to use the skindle app to unlock the downloaded file (using Parallels emulator software which lets me run Windows on my Mac). The result can be either a compressed .tpz file or an uncompressed one — but neither of those works with calibre! Does unlocking the original file with skindle get me any closer to the result I'm after?

Some of the Python scripts mentioned here seem to assume one has a physical Kindle, for which one needs to specify the PID (whatever that is). How do I go about doing things if all I have are a Mac and an iPhone, with no PID?

I get the feeling I have to convert the downloaded .tpz file to the SVG format. I have no idea what SVG means, though, or why I can't convert the .tpz file directly to an EPUB. I'd like to find out the answers to both those questions.

I also think I understand that the SVG file then has to be converted to HTML, which can at last be input to calibre and converted to EPUB format. Am I right about that? Again, why not just convert the .tpz file directly to (if not EPUB) HTML?

Any help anyone can give me will be much appreciated ...

Stream Recorder 08-15-2010 09:40 PM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by epstewart (Post 20879)
Help! I accidentally obtained a Topaz e-book and, via Amazon Kindle for Mac, downloaded it. I also downloaded it to Kindle for the iPhone. I would like to convert it to an EPUB for iBooks on the iPhone. As I read through the posts in this thread, I find myself getting very confused. Exactly how do I do what I want to do?

I do know how to use the skindle app to unlock the downloaded file (using Parallels emulator software which lets me run Windows on my Mac). The result can be either a compressed .tpz file or an uncompressed one — but neither of those works with calibre! Does unlocking the original file with skindle get me any closer to the result I'm after?

Some of the Python scripts mentioned here seem to assume one has a physical Kindle, for which one needs to specify the PID (whatever that is). How do I go about doing things if all I have are a Mac and an iPhone, with no PID?

I get the feeling I have to convert the downloaded .tpz file to the SVG format. I have no idea what SVG means, though, or why I can't convert the .tpz file directly to an EPUB. I'd like to find out the answers to both those questions.

I also think I understand that the SVG file then has to be converted to HTML, which can at last be input to calibre and converted to EPUB format. Am I right about that? Again, why not just convert the .tpz file directly to (if not EPUB) HTML?

Any help anyone can give me will be much appreciated ...

There is no need to use Parallels Desktop for Max OS X:
http://stream-recorder.com/forum/sho...8&postcount=24

Anonymouslemming 09-10-2010 04:13 PM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by Stream Recorder (Post 20892)

Hi - that post you link to states that you need to know your PID. I can't find that from Kindle4Mac or Kindle4PC. Where would I get that without owning a kindle ?

Also, when I run TopazExtract_Kindle4PC.pyw, I get the following error:

ImportError: cannot import name windll

Stream Recorder 09-11-2010 01:03 AM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by Anonymouslemming (Post 21362)
Hi - that post you link to states that you need to know your PID. I can't find that from Kindle4Mac or Kindle4PC. Where would I get that without owning a kindle ?

skindle - remove DRM from KindleForPC ebooks (mobi and topaz)
Removing DRM protection from Kindle for PC ebooks using unswindle
DeDRM AppleScript for Mac OS X 10.5, 10.6

ch mn 09-11-2010 09:03 AM

Script bugs?


 
I finally found the tools to try to convert a topaz book to something more portable (maybe?). The book downloaded to my PC as .azw file along with a .mbp file, but it looked like a topaz book and Skindle identified it as a topaz book. I renamed it Book.tpz for simplicity and ran the following script:

python cmbtc_dump.py -d -o Book Book.tpz

I got the following result:
File "cmbtc_dump.py", line 774
except Exception as message:
^
SyntaxError: invalid syntax

However this script seemed to work:
python cmbtc_dump_nonk4pc.py -d -o Book -p abCdeFgh Book.tpz

Following the instructions, I then ran:
python gensvg.py Book

Which in the end resulted in the following:
page0055.dat
Traceback (most recent call last):
File "gensvg.py", line 405, in <module>
sys.exit(main(''))
File "gensvg.py", line 329, in main
flat_xml = convert2xml.main(pargv)
File "C:\EZSkindle\Topaz\lib\convert2xml.py", line 789, in main
xmlpage = pp.process()
File "C:\EZSkindle\Topaz\lib\convert2xml.py", line 703, in process
tag = self.procToken(self.dict.lookup(v))
File "C:\EZSkindle\Topaz\lib\convert2xml.py", line 439, in procToken
subtagres.append(self.procToken(self.dict.lookup(v al)))
File "C:\EZSkindle\Topaz\lib\convert2xml.py", line 439, in procToken
subtagres.append(self.procToken(self.dict.lookup(v al)))
File "C:\EZSkindle\Topaz\lib\convert2xml.py", line 140, in lookup
print "Error - %d outside of string table limits" % val
TypeError: int argument required

Of course everything after that failed.

Although I am an engineer, I am not a programmer. I don't know if I got a buggy version of the tools or if there is something weird about this book, or if did something wrong. I have not tried another book, as this is the only one I have unless someone can point me a free download that is definitely a topaz book that these tools have successfully been used on.

Stream Recorder 10-05-2010 07:35 AM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Quote:

Originally Posted by Chris9 (Post 21963)
I used TopazExtract_Kindle4PC.pyw on a PRC file successfully ... but when I use topazfiles2html.pyw I just get an error message: "HTML conversion failed"

If I use topazfiles2xml.pyw it will work, but is there then a way to convert the xml files into an epub????

Use Calibre for converting XML to ePub or other formats.

Chris9 10-05-2010 08:00 AM

Re: How to convert Topaz ebooks to HTML (Remove DRM from TPZ and AZW1 books for Kindl


 
Nevermind, I was able to make it work. You have to run the files in this order (for a topaz prc) ...

1. TopazExtract_Kindle4PC
2. TopazFiles2SVG
3. TopazFiles2html

The resulting book.html file was easily exported into Calibre with a metadata TOC intact. On a quick inspection, there may be only minor cleanups needed which I can do in Sigil.

Edit: It wasn't as clean as I thought it would be. There are typical errors you get from OCR books, as this uses an OCR process to convert the books. Topaz is a crappy format, and even on K4PC the book's text doesn't look that great. One problem is that Amazon doesn't specify on its kindle books whether they are topaz format or not. So it's risky buying from them unless you ONLY want to read the book on a kindle device. In this case, for me, I could not find this title in an ebook version anyplace else. So it was worth it for me. But if I have a choice, I will always opt for a non-Amazon ebook first.


All times are GMT -6. The time now is 10:03 PM.