apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.49k stars 1.5k forks source link

Book still has DRM after loading into Calibre #479

Closed dybal closed 6 years ago

dybal commented 6 years ago

Purchased the the book from Amazon.

calibre Debug log calibre 2.55 embedded-python: False is64bit: True Linux-4.10.0-38-generic-x86_64-with-LinuxMint-18.3-sylvia Linux ('64bit', 'ELF') ('Linux', '4.10.0-38-generic', '#42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017') Python 2.7.12 Linux: ('LinuxMint', '18.3', 'sylvia') Successfully initialized third party plugins: DeDRM Starting up... DeDRM v6.6.0: Trying to decrypt B01N25M5YP_EBOK.prc Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 6 ebook: The GR10 Trail: Through the French Pyrenees: Le Sentier des Pyrénées (Cicerone Trekking Guides) Found 0 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.6.0: Failed to decrypt with error: No key found in 0 keys tried. DeDRM v6.6.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.6.0: Running kindlekey.py under Wine DeDRM v6.6.0: Command line: 'WINEPREFIX="/home/dybal" wine python.exe "/home/dybal/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/dybal/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.6.0: Found and decrypted 0 key files DeDRM v6.6.0: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 154, in _run_filetype_plugins nfp = plugin.run(path_to_file) File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.0: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Started up in 20.65 seconds with 3 books Added The GR10 Trail: Through the French Pyrenees: Le Sentier des Pyrénées (Cicerone Trekking Guides) to db in: 0.2 Added 1 books in 1.1 seconds

riseon commented 6 years ago

Was user error for me, removed.

j-howell commented 6 years ago

Found 0 keys to try after 0.0 seconds

It looks like that book is from a Kindle device. You need to configure the plugin with the serial number of that Kindle.

ElleKayEm commented 6 years ago

I see a PRC extension. Was it downloaded with Kindle for Android? At this time, these tools work with Kindle books from E-ink Kindles or Kindle for PC/Mac.

dybal commented 6 years ago

It was downloaded with Kindle for PC (an older version)

ElleKayEm commented 6 years ago

There's an issue for some Linux systems that keeps DeDRM from finding Python. (You do need to have Python and PyCrypto installed under Wine.) Try manually running the key retrieval script under Wine, and import the key into calibre. For example:

wine python.exe "/home/dybal/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/dybal/winekeysdir"

(You may need to create /home/dybal/winekeysdir first, and then the retrieved key(s) should be put there.)

There's some discussion of the problem in this old issue #53.

dybal commented 6 years ago

Downloaded with Kindle for PC 1.0 Beta 1 running under wine. DDRM worked fine with about 50 other books downloaded with this version of Kindle for PC... would that happen if it didn't find python?

dybal commented 6 years ago

Run: wine python.exe "/home/dybal/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/dybal/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir/"

Output:

fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 180, std (d/m/y): 18/02/2018, dlt (d/m/y): 21/10/2018 fixme:msvcrt:MSVCRT__wsopen_s : pmode 0x81b6 ignored kindlekey.py v2.5 Copyright ? 2010-2016 by some_updates, Apprentice Alf and Apprentice Harper searching for kinfoFiles in C:\users\dybal\Local Settings\Application Data Found K4PC kindle.info file: C:\users\dybal\Local Settings\Application Data\Amazon\Kindle For PC{AMAwzsaPaaZAzmZzZQzgZCAkZ3AjA_AY}\kindle.info Couldn't decrypt file. Could not retrieve Kindle for Mac/PC key. fixme:msvcrt:clean_type_info_names_internal (0x1d1b7210) stub fixme:msvcrt:clean_type_info_names_internal (0x10101670) stub fixme:msvcrt:__clean_type_info_names_internal (0x1e2719e0) stub

ElleKayEm commented 6 years ago

In answer to your question "DeDRM worked fine with about 50 other books downloaded with this version of Kindle for PC... would that happen if it didn't find python?"

Well, the previous log first says "Found 0 keys to try after 0.1 seconds" which means DeDRM hasn't ever found any working keys to save. Then further down it says "wine: cannot find L"C:\windows\system32\python.exe"".

Were those 50 other books downloaded with a different installation of Kindle for PC and calibre/DeDRM?

I don't know why your key couldn't be decrypted when you ran the key retrieval script. You're able to read the book in Kindle for PC?

apprenticeharper commented 6 years ago

Kindle for PC 1.0 beta is ancient. I'm astonished it will still connect to the Amazon servers. You really should use 1.17. I'm pretty sure 1.0 beta isn't supported by these tools any more.

apprenticeharper commented 6 years ago

Please raise a new issue if you still need help.

otabbicca commented 5 years ago

Hello, I get the error below when I try to convert my ebook in calibre on mac, any assistance is appreciated.

Convert book 1 of 1 (First Sight: A Novel) Conversion options changed from defaults: read_metadata_from_opf: u'/var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/1LE7b0.opf' verbose: 2 output_profile: 'generic_eink' cover: u'/var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/lN8Zld.jpeg' Resolved conversion options calibre version: 3.38.1 {'allow_conversion_with_errors': False, 'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 0.0, 'book_producer': None, 'change_justification': u'original', 'chapter': u"//[((name()='h1' or name()='h2') and re:test(., '\s((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))', 'i')) or @class = 'chapter']", 'chapter_mark': u'pagebreak', 'comments': None, 'cover': u'/var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/lN8Zld.jpeg', 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_split_on_page_breaks': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'epub_flatten': False, 'epub_inline_toc': False, 'epub_toc_at_end': False, 'epub_version': u'2', 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'flow_size': 260, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x112e4d290>, 'insert_blank_line': False, 'insert_blank_line_size': 0.5, '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_line_height': 120.0, 'no_chapters_in_toc': False, 'no_default_epub_cover': False, 'no_inline_navbars': False, 'no_svg_cover': False, 'output_profile': <calibre.customize.profiles.GenericEink object at 0x112e4d690>, 'page_breaks_before': u'/', 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/1LE7b0.opf', 'remove_fake_margins': True, 'remove_first_image': False, 'remove_paragraph_spacing': False, 'remove_paragraph_spacing_indent_size': 1.5, 'renumber_headings': True, 'replace_scene_breaks': u'', 'search_replace': '[]', 'series': None, 'series_index': None, 'smarten_punctuation': False, 'sr1_replace': None, 'sr1_search': None, 'sr2_replace': None, 'sr2_search': None, 'sr3_replace': None, 'sr3_search': None, 'start_reading_at': None, 'subset_embedded_fonts': False, 'tags': None, 'timestamp': None, 'title': None, 'title_sort': None, 'toc_filter': None, 'toc_threshold': 6, 'toc_title': None, 'transform_css_rules': '[]', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 102, in convert File "calibre_plugins.kfx_input.init", line 204, in convert_from_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 96, in convert_to_epub File "calibre_plugins.kfx_input.kfxlib.yj_book", line 150, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 261, in get_container KFXDRMError: Book container B00B3GMGZ2_EBOK.azw has DRM and cannot be converted Python function terminated unexpectedly: This book has DRM! InputFormatPlugin: KFX Input running on /var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/_Tqn01.kfx-zip Software versions: KFX Input 1.12.1, calibre 3.38.1, Darwin-16.7.0-x86_64-i386-64bit KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting /var/folders/c3/89ffwz2563jf9vqcp07mktch0000gn/C/calibre_3.38.1_tmp_dPzLWJ/_Tqn01.kfx-zip Processing container: B00B3GMGZ2_EBOK.azw Traceback (most recent call last): File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 154, in main return run_entry_point() File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 114, in run_entry_point return getattr(pmod, func)() File "site-packages/calibre/utils/ipc/worker.py", line 199, in main File "site-packages/calibre/gui2/convert/gui_conversion.py", line 42, in gui_convert_override File "site-packages/calibre/gui2/convert/gui_conversion.py", line 27, in gui_convert File "site-packages/calibre/ebooks/conversion/plumber.py", line 1106, in run File "site-packages/calibre/customize/conversion.py", line 244, in call File "calibre_plugins.kfx_input.init", line 105, in convert calibre.ebooks.DRMError: This book has DRM!

ElleKayEm commented 5 years ago

Here's how to get the log we need to see:

https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md#i-cannot-solve-my-problem-with-the-dedrm-plugin-and-now-i-need-to-post-a-log-how-do-i-do-that