View Single Post
  #1  
Old 05-01-2011, 10: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