Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Other discussions > Removing DRM protection from eBooks
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 05-01-2011, 11:36 AM
drsquash drsquash is offline
Junior Member
 
Join Date: May 2011
Posts: 9
drsquash is on a distinguished road
Default

Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


hi there,

I just bought a book on Amazon, and I would like to read it also on my sony prs. Needless to say, I need to get rid of the DRM.

I use Calibre, so I installed the latest version of the drm tools, all went fine. I installed Kindle for PC on wine-1.3 (both the current updated version and an older one) and I downloaded on the hard drive the book I bought as a prc file (the first time, I downloaded the book on my android phone, with the kindle app, but I did not manage to find it in the filesystem). I thought I read that if you use Kindle for PC, you need nor a serial nor a PID. I just tried importing the book with calibre, but I get this error message

Code:
Error decoding: /home/blabla/My Kindle Content/mybook.prc
the book is in the collection however, so I tried to convert it in order to get some more verbose error message. When I try to convert to lrf I get:


Code:
calibre, version 0.7.58
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (BOOKNAME)

Convert book 1 of 1 (BOOKNAME)
Resolved conversion options
calibre version: 0.7.58
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': 'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'/tmp/calibre_0.7.58_tmp_Nn4kaW/calibre_0.7.58_7viLlp.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'enable_autorotation': False,
 'enable_heuristics': False,
 'extra_css': None,
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'header': False,
 'header_format': u'%t by %a',
 'header_separation': 0.0,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x37bd810>,
 'insert_blank_line': False,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_indent': 0.0,
 'minimum_line_height': 120.0,
 'mono_family': u'None',
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.SonyReaderOutput object at 0x37c30d0>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'/tmp/calibre_0.7.58_tmp_Nn4kaW/calibre_0.7.58_JU5sCu.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'render_tables_as_images': False,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'sans_family': u'None',
 'series': None,
 'series_index': None,
 'serif_family': u'None',
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'tags': None,
 'text_size_multiplier_for_rendered_tables': 1.0,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2,
 'wordspace': 2.5}
InputFormatPlugin: MOBI Input running
on /data/books/AUTHOR/BOOKNAME/mybook.prc
Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/utils/ipc/worker.py", line 119, in main
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 920, in run
  File "site-packages/calibre/customize/conversion.py", line 204, in __call__
  File "site-packages/calibre/ebooks/mobi/input.py", line 27, in convert
  File "site-packages/calibre/ebooks/mobi/reader.py", line 308, in extract_content
DRMError
So I tried with the commandline directly, using mobidedrm.py

Code:
python mobidedrm.py 1.prc out.prc PIIII\$ID
MobiDeDrm v0.20. Copyright 2008-2010 The Dark Reverser.
MOBI header version = 6, length = 232
Extra Data Flags = 10
Error: no key found. maybe the PID is incorrect
where PIIII\$ID is the PID I got by running mobipocket reader (v.62, again on wine), because I had no other clue where to find the PID.

Any ideas? Even I pointer to where to start would be appreciated.

/dr
Reply With Quote
  #2  
Old 05-02-2011, 03:40 AM
Stream Recorder
 
Posts: n/a
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


If you use Kindle for PC, you do not need PID. But I have no idea whether K4PC works correctly when using WINE or not.

Do you use Linux or Mac OS?
Reply With Quote
  #3  
Old 05-02-2011, 09:38 AM
drsquash drsquash is offline
Junior Member
 
Join Date: May 2011
Posts: 9
drsquash is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


Thanks for the reply.
I use linux, but why could kindle 4 pc behave differently? It's just downloading the prc file on the hard drive. It should not be "aware" that is being run withine iwine.

/dr
Reply With Quote
  #4  
Old 05-02-2011, 10:09 AM
Stream Recorder
 
Posts: n/a
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


WINE is just an emulator. Some programs work fine when you use it, but many other don't. May be Kindle for PC works fine. May be you just need to find the PID from it, but I don't know how to do it.

Another problem is that I don't know how to find PID for Kindle for Android.

If you buy your ebooks on a PC, Mac or iPhone, there shouldn't be any problems.

Right now I can only suggest to keep bugging the developers of DRM removal tools to support devices that you have.
Reply With Quote
  #5  
Old 05-02-2011, 03:45 PM
drsquash drsquash is offline
Junior Member
 
Join Date: May 2011
Posts: 9
drsquash is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


Thanks for your help. I will try to look more around, maybe have a look at the source code one of these days.

It is a bit sad: I want to buy book and just read them on the device I choose, I would not like to download an ebook from torrent, but they are really asking for it...

/dr
Reply With Quote
  #6  
Old 05-04-2011, 02:35 AM
Stream Recorder
 
Posts: n/a
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


I tried to use Kindle for PC 1.0.1 and 1.50 with K4MobiDeDRM_v02.8_plugin.zip plugin for Calibre on Ubuntu 11.04 x64 and it didn't work (for PRC files from K4PC 1.0.1 and for AZW files from K4PC 1.50).



In Windows it is important to use Python 2.6 x32. I wonder whether my 64-bit installation and/or other version of Python are to blame.
Reply With Quote
  #7  
Old 05-08-2011, 12:59 PM
Ripper Ripper is offline
Junior Member
 
Join Date: May 2011
Posts: 3
Ripper is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


Quote:
Originally Posted by drsquash View Post
hi there,

I just bought a book on Amazon, and I would like to read it also on my sony prs. Needless to say, I need to get rid of the DRM.

I use Calibre, so I installed the latest version of the drm tools, all went fine. I installed Kindle for PC on wine-1.3 (both the current updated version and an older one) and I downloaded on the hard drive the book I bought as a prc file (the first time, I downloaded the book on my android phone, with the kindle app, but I did not manage to find it in the filesystem). I thought I read that if you use Kindle for PC, you need nor a serial nor a PID. I just tried importing the book with calibre, but I get this error message

Code:
Error decoding: /home/blabla/My Kindle Content/mybook.prc
the book is in the collection however, so I tried to convert it in order to get some more verbose error message. When I try to convert to lrf I get:


Code:
calibre, version 0.7.58
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (BOOKNAME)

Convert book 1 of 1 (BOOKNAME)
Resolved conversion options
calibre version: 0.7.58
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': 'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'/tmp/calibre_0.7.58_tmp_Nn4kaW/calibre_0.7.58_7viLlp.jpeg',
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'enable_autorotation': False,
 'enable_heuristics': False,
 'extra_css': None,
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'header': False,
 'header_format': u'%t by %a',
 'header_separation': 0.0,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x37bd810>,
 'insert_blank_line': False,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_indent': 0.0,
 'minimum_line_height': 120.0,
 'mono_family': u'None',
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.SonyReaderOutput object at 0x37c30d0>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'/tmp/calibre_0.7.58_tmp_Nn4kaW/calibre_0.7.58_JU5sCu.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'render_tables_as_images': False,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'sans_family': u'None',
 'series': None,
 'series_index': None,
 'serif_family': u'None',
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'tags': None,
 'text_size_multiplier_for_rendered_tables': 1.0,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2,
 'wordspace': 2.5}
InputFormatPlugin: MOBI Input running
on /data/books/AUTHOR/BOOKNAME/mybook.prc
Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/utils/ipc/worker.py", line 119, in main
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 920, in run
  File "site-packages/calibre/customize/conversion.py", line 204, in __call__
  File "site-packages/calibre/ebooks/mobi/input.py", line 27, in convert
  File "site-packages/calibre/ebooks/mobi/reader.py", line 308, in extract_content
DRMError
So I tried with the commandline directly, using mobidedrm.py

Code:
python mobidedrm.py 1.prc out.prc PIIII\$ID
MobiDeDrm v0.20. Copyright 2008-2010 The Dark Reverser.
MOBI header version = 6, length = 232
Extra Data Flags = 10
Error: no key found. maybe the PID is incorrect
where PIIII\$ID is the PID I got by running mobipocket reader (v.62, again on wine), because I had no other clue where to find the PID.

Any ideas? Even I pointer to where to start would be appreciated.

/dr
Your AZW file will be saved in Calibre after you receive the error message with DRM still in it. calibre convert the AZW book to MOBI format, make a copy of the MOBI file where you can find it later, remove the MOBI file from calibre, and then add the MOBI file copy you saved to calibre and I believe you will have a DRM free MOBI file. You should not see any error message when you add the MOBI file this time. You may then convert it back to a DRM free AZW file if you wish. Make sure to first remove the original AZW file from calibre. For some reason this workaround seems to work in Kindle for PC files while the direct DRM removal for AZW does not.
Reply With Quote
  #8  
Old 05-09-2011, 04:08 PM
drsquash drsquash is offline
Junior Member
 
Join Date: May 2011
Posts: 9
drsquash is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


Thanks, I appreciate your help. However it does not seem to work.
I tried both with Kindle for PC 1 (it downloaded a prc and mbp file) and 1.1 (it downloaded azw and mbp file).
When I open them with Calibre, I get the error message, and then, it's true, the file is stored within a Calibre directory. However, the file is just copied. If I diff the Calibre-contained file and the original one, I get a binary match.

I am wondering what the mbp file is for. I tried deleting it, but I can still read it with K4PC, that after a while regenerates it. Is it just a bookmark index or something like that?

/dr
Reply With Quote
  #9  
Old 05-11-2011, 08:40 AM
waryde waryde is offline
Junior Member
 
Join Date: May 2011
Posts: 3
waryde is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


You still need a PID, the plugin just reads it from somewhere on Windows.
Wine just emulates Windows, so the plugin cannot find it!
Maybe you can install the Windows Version of Calibre in Wine and it works. If not, you have to use Windows or modify the plugin yourself so it can find the PID on a virtualized Kindle for PC in Wine too.
Reply With Quote
  #10  
Old 05-11-2011, 04:51 PM
drsquash drsquash is offline
Junior Member
 
Join Date: May 2011
Posts: 9
drsquash is on a distinguished road
Default

Re: Remove Kindle DRM in Linux: FindPID to read Amazon .PRC/.AZW book on Sony Reader


Yes, it seems that it cannot work on linux easily. The tools rely on windows and its libraries. k4pcutils.py seems to need

ctypes.windll.crypt32.CryptUnprotectData

and I do not think there is a linux equivalent. I managed to hardcode into the code the kindle.info file, but I can't find the crypt32 module for linux.

but i do not give up (yet).
Reply With Quote
Reply Post New Thread
Tags: , , , , , , , , , , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:58 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons