apprenticeharper / DeDRM_tools

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

DeDRM not working #884

Open vineeth-konavoor opened 5 years ago

vineeth-konavoor commented 5 years ago

Gather KFX-ZIP (from KFX Input) 1.18.0: Importing /home/vineeth/serious men/Serious Men_B00B4AI2LY.kfx Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import. Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as /tmp/calibre_3.46.0_tmp_7HY5Od/KZZwzH.kfx-zip DeDRM v6.6.3: Trying to decrypt KZZwzH.kfx-zip Using Library AlfCrypto DLL/DYLIB/SO Decrypting KFX-ZIP ebook: KZZwzH Found 1 keys to try after 0.0 seconds DeDRM v6.6.3: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher DeDRM v6.6.3: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.6.3: Running kindlekey.py under Wine DeDRM v6.6.3: Command line: 'WINEPREFIX="/home/vineeth" wine python.exe "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' 0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} 0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} 0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002 0012:err:ole:get_local_server_stream Failed: 80004002 0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} 0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} 0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002 0014:err:ole:get_local_server_stream Failed: 80004002 Could not load wine-gecko. HTML rendering will be disabled. Could not load wine-gecko. HTML rendering will be disabled. wine: configuration in '/home/vineeth' has been updated. wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.6.3: Found and decrypted 0 key files DeDRM v6.6.3: Ultimately failed to decrypt after 35.1 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 "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 624, in run File "calibre_plugins.dedrm.init", line 574, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.3: Ultimately failed to decrypt after 35.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Package KFX (from KFX Input) 1.18.0: Packaging /tmp/calibre_3.46.0_tmp_7HY5Od/KZZwzH.kfx-zip Processing container: Serious Men_B00B4AI2LY.kfx Running file type plugin Package KFX (from KFX Input) failed with traceback: Traceback (most recent call last): File "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.kfx_input.package_filetype", line 21, in run File "calibre_plugins.kfx_input.package_filetype", line 33, in run_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 87, in convert_to_single_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted KFX metadata reader (from KFX Input) activated for /tmp/calibre_3.46.0_tmp_7HY5Od/8dHaEm_add_books/0/Serious Men_B00B4AI2LY.kfx-zip Traceback (most recent call last): File "site-packages/calibre/customize/ui.py", line 428, in get_file_type_metadata File "calibre_plugins.kfx_input.metadata_reader", line 28, in get_metadata File "calibre_plugins.kfx_input.kfxlib.yj_book", line 132, in get_metadata Exception: Failed to locate a KFX container with metadata DeDRM v6.6.3: Trying to decrypt Serious Men B00B4AI2LY - Unknown.kfx-zip Using Library AlfCrypto DLL/DYLIB/SO Decrypting KFX-ZIP ebook: Serious Men B00B4AI2LY - Unknown Found 1 keys to try after 0.0 seconds DeDRM v6.6.3: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher DeDRM v6.6.3: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.6.3: Running kindlekey.py under Wine DeDRM v6.6.3: Command line: 'WINEPREFIX="/home/vineeth" wine python.exe "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.6.3: Found and decrypted 0 key files DeDRM v6.6.3: Ultimately failed to decrypt after 0.9 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 "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 624, in run File "calibre_plugins.dedrm.init", line 574, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.3: Ultimately failed to decrypt after 0.9 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Package KFX (from KFX Input) 1.18.0: Packaging /home/vineeth/serious men/Serious Men B00B4AI2LY - Unknown.kfx-zip Processing container: Serious Men_B00B4AI2LY.kfx Running file type plugin Package KFX (from KFX Input) failed with traceback: Traceback (most recent call last): File "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.kfx_input.package_filetype", line 21, in run File "calibre_plugins.kfx_input.package_filetype", line 33, in run_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 87, in convert_to_single_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted KFX metadata reader (from KFX Input) activated for /home/vineeth/serious men/Serious Men B00B4AI2LY - Unknown.kfx-zip Traceback (most recent call last): File "site-packages/calibre/customize/ui.py", line 428, in get_file_type_metadata File "calibre_plugins.kfx_input.metadata_reader", line 28, in get_metadata File "calibre_plugins.kfx_input.kfxlib.yj_book", line 132, in get_metadata Exception: Failed to locate a KFX container with metadata Convert book 1 of 1 (Serious Men B00B4AI2LY) Conversion options changed from defaults: verbose: 2 output_profile: u'kindle_pw3' read_metadata_from_opf: u'/tmp/calibre_3.46.0_tmp_7HY5Od/B1NzGW.opf' allow_conversion_with_errors: True Resolved conversion options calibre version: 3.46.0 {'allow_conversion_with_errors': True, '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': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_compress': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f7e8fd741d0>, '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, 'mobi_file_type': u'old', 'mobi_ignore_margins': False, 'mobi_keep_original_images': False, 'mobi_toc_at_start': False, 'no_chapters_in_toc': False, 'no_inline_navbars': True, 'no_inline_toc': False, 'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x7f7e8fd749d0>, 'page_breaks_before': u'/', 'personal_doc': u'[PDOC]', 'prefer_author_sort': False, 'prefer_metadata_cover': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/tmp/calibre_3.46.0_tmp_7HY5Od/B1NzGW.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, 'share_not_sync': False, '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} InputFormatPlugin: KFX Input running on /tmp/calibre_3.46.0_tmp_7HY5Od/Lzjlah.kfx-zip Software versions: KFX Input 1.18.0, calibre 3.46, Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting /tmp/calibre_3.46.0_tmp_7HY5Od/Lzjlah.kfx-zip Processing container: Serious Men_B00B4AI2LY.kfx Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 100, in convert File "calibre_plugins.kfx_input.init", line 195, in convert_from_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 106, in convert_to_epub File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted Traceback (most recent call last): File "site.py", line 77, in main File "site-packages/calibre/utils/ipc/worker.py", line 200, 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 1110, in run File "site-packages/calibre/customize/conversion.py", line 246, in call File "calibre_plugins.kfx_input.init", line 103, in convert DRMError: This book has DRM!

vineeth-konavoor commented 5 years ago

I have tried to follow everything and tried reading the FAQ. But cant seem to know why it doesn;t remove DRM. When I add a book, it simply says reading metadata and goes quickly to 100. I have used DeDRM in the pas t and had no issue !!

j-howell commented 5 years ago

From the beginning of the log:

Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import.

It appears that you copied the KFX file from somewhere else before importing it. That won't work because a book in KFX format is composed of multiple files.

vineeth-konavoor commented 5 years ago

I have tried to follow everything and tried reading the FAQ. But cant seem to know why it doesn;t remove DRM. When I add a book, it simply says reading metadata and goes quickly to 100. I have used DeDRM in the pas t and had no issue !!

From the beginning of the log:

Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import.

It appears that you copied the KFX file from somewhere else before importing it. That won't work because a book in KFX format is composed of multiple files.

How can I Get all the files from My E-ink Amazon kindle paperwhite?

I tried "import book" from device using calibre itself. That just copies the single kfx file.

Can you walk me through the exact steps?

vineeth-konavoor commented 5 years ago

Since you said that copied KFX won't work, I plugged in my kindle, selected the KFX file from documents folder directly from my kindle. Still The same error.

Here is the log:

calibre Debug log calibre 3.46 embedded-python: True is64bit: True Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid Linux ('64bit', 'ELF') ('Linux', '4.15.0-58-generic', '#64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019') Python 2.7.15 Linux: ('debian', 'buster/sid', '') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 18, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 18, 0) && Obok DeDRM (6, 5, 4) && KFX metadata reader (from KFX Input) (1, 18, 0) && KFX Input (1, 18, 0) calibre 3.46 embedded-python: True is64bit: True Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid Linux ('64bit', 'ELF') ('Linux', '4.15.0-58-generic', '#64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019') Python 2.7.15 Linux: ('debian', 'buster/sid', '') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 18, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 18, 0) && Obok DeDRM (6, 5, 4) && KFX metadata reader (from KFX Input) (1, 18, 0) && KFX Input (1, 18, 0) Turning on automatic hidpi scaling QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries. devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 84.6253658537 x 84.8139130435 Using calibre Qt style: True QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries. [0.00] Starting up... [0.01] Showing splash screen... [0.15] splash screen shown [0.15] Initializing db... [0.18] db initialized [0.18] Constructing main UI... DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations Looking for desktop notifier support from: org.freedesktop.Notifications org.freedesktop.Notifications found in 0.0 seconds [1.08] main UI initialized... [1.08] Hiding splash screen [3.36] splash screen hidden [3.36] Started up in 3.36 seconds with 9 books ['zenity', '--modal', '--file-selection', '--title=Select books', '--separator=\n', '--attach=56623118', '--filename=/media/vineeth/Kindle/documents/.fgdfg.gdfhjdhf&^839', '--file-filter=Books | .lrf .rar .zip .rtf .lit .txt .txtz .text .htm .xhtm .html .htmlz .xhtml .pdf .pdb .updb .pdr .prc .mobi .azw .doc .epub .fb2 .fbz .djv .djvu .lrx .cbr .cbz .cbc .oebzip .rb .imp .odt .chm .tpz .azw1 .pml .pmlz .mbp .tan .snb .xps .oxps .azw4 .book .zbf .pobi .docx .docm .md .textile .markdown .ibook .ibooks .iba .azw3 .ps .kepub .kfx .kpf .azw8 .kfx-zip', '--file-filter=EPUB books | .epub .kepub', '--file-filter=Kindle books | .mobi .prc .azw .azw3 .kfx .tpz .azw1 .azw4', '--file-filter=PDF books | .pdf .azw4', '--file-filter=HTML books | .htm .html .xhtm .xhtml', '--file-filter=LIT books | .lit', '--file-filter=Text books | .txt .text .rtf .md .markdown .textile .txtz', '--file-filter=Comics | .cbz .cbr .cbc', '--file-filter=Archives | .zip .rar', '--file-filter=Wordprocessor files | .odt .doc .docx', '--file-filter=All files | *', '--multiple']

Found device nodes: /dev/sdb1 None None Job: 0 Get device information started DeviceJob: 0 Get device information done, calling callback DeviceJob: 0 Get device information callback returned Job: 1 Set library information started DeviceJob: 1 Set library information done, calling callback DeviceJob: 1 Set library information callback returned Job: 2 Get list of books on device started DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None DEBUG: 0.0 USBMS: dirs are: /media/vineeth/Kindle/ documents DEBUG: 0.0 USBMS: scan from root False /media/vineeth/Kindle/documents DEBUG: 0.1 USBMS: count found in cache: 27, count of files in metadata: 27, need_sync: False DEBUG: 0.1 USBMS: Finished fetching list of books from device. oncard= None DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb DeviceJob: 2 Get list of books on device done, calling callback DeviceJob: metadata_downloaded: Starting set_books_in_library DeviceJob: set_books_in_library: books to process= 27 DeviceJob: set_books_in_library finished: time= 0.00720000267029 DeviceJob: metadata_downloaded: updating views DeviceJob: metadata_downloaded: syncing DeviceJob: metadata_downloaded: refreshing ondevice DeviceJob: metadata_downloaded: sending metadata_available signal DeviceJob: 2 Get list of books on device callback returned Job: 0 Get device information finished No details available. Job: 1 Set library information finished No details available. Job: 2 Get list of books on device finished No details available. Gather KFX-ZIP (from KFX Input) 1.18.0: Importing /media/vineeth/Kindle/documents/Serious Men_B00B4AI2LY.kfx Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as /tmp/calibre_3.46.0_tmp_Dyk6NR/gDEwSr.kfx-zip DeDRM v6.6.3: Trying to decrypt gDEwSr.kfx-zip Using Library AlfCrypto DLL/DYLIB/SO Decrypting KFX-ZIP ebook: gDEwSr Found 1 keys to try after 0.0 seconds Decrypting KFX DRM voucher: voucher DeDRM v6.6.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key DeDRM v6.6.3: Looking for new default Kindle Key after 0.0 seconds DeDRM v6.6.3: Running kindlekey.py under Wine DeDRM v6.6.3: Command line: 'WINEPREFIX="/home/vineeth" wine python.exe "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/vineeth/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.6.3: Found and decrypted 0 key files DeDRM v6.6.3: Ultimately failed to decrypt after 0.9 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 "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 624, in run File "calibre_plugins.dedrm.init", line 574, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.3: Ultimately failed to decrypt after 0.9 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Package KFX (from KFX Input) 1.18.0: Packaging /tmp/calibre_3.46.0_tmp_Dyk6NR/gDEwSr.kfx-zip Processing container: CR!A6ZNS1QA9X32KDGFEB7T2JZ4DTM1.kfx Processing container: Serious Men_B00B4AI2LY.kfx Running file type plugin Package KFX (from KFX Input) failed with traceback: Traceback (most recent call last): File "site-packages/calibre/customize/ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.kfx_input.package_filetype", line 21, in run File "calibre_plugins.kfx_input.package_filetype", line 33, in run_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 87, in convert_to_single_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted KFX metadata reader (from KFX Input) activated for /tmp/calibre_3.46.0_tmp_Dyk6NR/4Ks12v_add_books/0/Serious Men_B00B4AI2LY.kfx-zip Added Serious Men to db in: 0.8 Added 1 books in 2.5 seconds Worker Launch took: 0.0883979797363 Job: 3 Convert book 1 of 1 (Serious Men) finished Convert book 1 of 1 (Serious Men) Conversion options changed from defaults: allow_conversion_with_errors: True read_metadata_from_opf: u'/tmp/calibre_3.46.0_tmp_Dyk6NR/8PEfHj.opf' verbose: 2 output_profile: u'kindle_pw3' Resolved conversion options calibre version: 3.46.0 {'allow_conversion_with_errors': True, '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': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_compress': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f15fe2c90d0>, '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, 'mobi_file_type': u'old', 'mobi_ignore_margins': False, 'mobi_keep_original_images': False, 'mobi_toc_at_start': False, 'no_chapters_in_toc': False, 'no_inline_navbars': True, 'no_inline_toc': False, 'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x7f15fe2c98d0>, 'page_breaks_before': u'/', 'personal_doc': u'[PDOC]', 'prefer_author_sort': False, 'prefer_metadata_cover': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/tmp/calibre_3.46.0_tmp_Dyk6NR/8PEfHj.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, 'share_not_sync': False, '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} InputFormatPlugin: KFX Input running on /tmp/calibre_3.46.0_tmp_Dyk6NR/WuDlFh.kfx-zip Software versions: KFX Input 1.18.0, calibre 3.46, Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting /tmp/calibre_3.46.0_tmp_Dyk6NR/WuDlFh.kfx-zip Processing container: CR!A6ZNS1QA9X32KDGFEB7T2JZ4DTM1.kfx Processing container: Serious Men_B00B4AI2LY.kfx Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 100, in convert File "calibre_plugins.kfx_input.init", line 195, in convert_from_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 106, in convert_to_epub File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted Traceback (most recent call last): File "site.py", line 77, in main File "site-packages/calibre/utils/ipc/worker.py", line 200, 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 1110, in run File "site-packages/calibre/customize/conversion.py", line 246, in call File "calibre_plugins.kfx_input.init", line 103, in convert DRMError: This book has DRM!

Convert book 1 of 1 (Serious Men) Conversion options changed from defaults: allow_conversion_with_errors: True read_metadata_from_opf: u'/tmp/calibre_3.46.0_tmp_Dyk6NR/8PEfHj.opf' verbose: 2 output_profile: u'kindle_pw3' Resolved conversion options calibre version: 3.46.0 {'allow_conversion_with_errors': True, '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': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_compress': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f15fe2c90d0>, '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, 'mobi_file_type': u'old', 'mobi_ignore_margins': False, 'mobi_keep_original_images': False, 'mobi_toc_at_start': False, 'no_chapters_in_toc': False, 'no_inline_navbars': True, 'no_inline_toc': False, 'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x7f15fe2c98d0>, 'page_breaks_before': u'/', 'personal_doc': u'[PDOC]', 'prefer_author_sort': False, 'prefer_metadata_cover': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/tmp/calibre_3.46.0_tmp_Dyk6NR/8PEfHj.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, 'share_not_sync': False, '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} InputFormatPlugin: KFX Input running on /tmp/calibre_3.46.0_tmp_Dyk6NR/WuDlFh.kfx-zip Software versions: KFX Input 1.18.0, calibre 3.46, Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting /tmp/calibre_3.46.0_tmp_Dyk6NR/WuDlFh.kfx-zip Processing container: CR!A6ZNS1QA9X32KDGFEB7T2JZ4DTM1.kfx Processing container: Serious Men_B00B4AI2LY.kfx Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 100, in convert File "calibre_plugins.kfx_input.init", line 195, in convert_from_kfx File "calibre_plugins.kfx_input.kfxlib.yj_book", line 106, in convert_to_epub File "calibre_plugins.kfx_input.kfxlib.yj_book", line 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container Serious Men_B00B4AI2LY.kfx has DRM and cannot be converted Traceback (most recent call last): File "site.py", line 77, in main File "site-packages/calibre/utils/ipc/worker.py", line 200, 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 1110, in run File "site-packages/calibre/customize/conversion.py", line 246, in call File "calibre_plugins.kfx_input.init", line 103, in convert DRMError: This book has DRM!

j-howell commented 5 years ago

That is the correct import procedure. The new log shows a different error:

DeDRM v6.6.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key

The most likely reasons for this are you have not configured the DeDRM plugin with your Kindle serial number or your Kindle is running an unsupported firmware version (5.10.2 or higher).

doc-rsn commented 5 years ago

hi trying to convert my purchased ebook to pdf but its not working details as below , thanks you your help in advance calibre 3.46 embedded-python: True is64bit: False Windows-10-10.0.17134-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.17134') Python 2.7.15+ Windows: ('10', '10.0.17134', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 3) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 49.5662857143 x 50.0184615385 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.11] splash screen shown [0.11] Initializing db... [0.12] db initialized [0.12] Constructing main UI... [1.08] main UI initialized... [1.08] Hiding splash screen [2.27] splash screen hidden [2.27] Started up in 2.27 seconds with 1 books Storage number map: {(7L, 0L): [(3L, 'C')], (7L, 1L): [(1L, 'D')]} Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0401\G00102098421064T&0: StorageDeviceNumber(type=7L, number=1L, partition_number=0L) Drive letters for USBDevice(vendor_id=0x1949 product_id=0x324 bcd=0x401 devid=usb\vid_1949&pid_0324&rev_0401 devinst=6) {u'drive_letters': ['D'], u'pnp_id_map': {'D': u'\\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0401#g00102098421064t&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'}, u'readonly_drives': set([]), u'sort_map': {'D': (1L, 1L)}} Job: 0 Get device information started DeviceJob: 0 Get device information done, calling callback DeviceJob: 0 Get device information callback returned Job: 1 Set library information started DeviceJob: 1 Set library information done, calling callback DeviceJob: 1 Set library information callback returned Job: 2 Get list of books on device started DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None DEBUG: 0.0 USBMS: dirs are: D:\ documents DEBUG: 0.0 USBMS: scan from root False D:\documents DEBUG: 0.1 USBMS: count found in cache: 30, count of files in metadata: 30, need_sync: False DEBUG: 0.1 USBMS: Finished fetching list of books from device. oncard= None DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb DeviceJob: 2 Get list of books on device done, calling callback DeviceJob: metadata_downloaded: Starting set_books_in_library DeviceJob: set_books_in_library: books to process= 30 DeviceJob: set_books_in_library finished: time= 0.0019998550415 DeviceJob: metadata_downloaded: updating views DeviceJob: metadata_downloaded: syncing DeviceJob: metadata_downloaded: refreshing ondevice DeviceJob: metadata_downloaded: sending metadata_available signal DeviceJob: 2 Get list of books on device callback returned Job: 0 Get device information finished No details available. Job: 1 Set library information finished No details available. Job: 2 Get list of books on device finished No details available. stdout+stderr from file dialog helper: ['', ''] piped data from file dialog helper: ['hb\xd5\x81i\xf1\xda?\xea\x1b85_U\xeb\x9c\xc3g\xeb\xde\x8e\x08\xa9\x9fgL\x02\x1a\xf9\xd8\x0b\xae', 'C:\Users\Saravanan R\Documents\My Kindle Content\B078C6C7QS_EBOK\B078C6C7QS_EBOK.azw'] DeDRM v6.6.3: Trying to decrypt B078C6C7QS_EBOK.azw Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: 12 Rules for Life: An Antidote to Chaos Found 2 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.6.3: Failed to decrypt with error: No key found in 2 keys tried. DeDRM v6.6.3: Looking for new default Kindle Key after 0.1 seconds searching for kinfoFiles in C:\Users\Saravanan R\AppData\Local Found K4PC 2.25+ kinf2018 file: C:\Users\Saravanan R\AppData\Local\Amazon\Kindle\storage.kinf2018 Decrypted key file using IDString '113376116' and UserName '5361726176616e616e2052' DeDRM v6.6.3: Found 1 new key MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: 12 Rules for Life: An Antidote to Chaos Got DSN key from database default_key_1 Found 3 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.6.3: Ultimately failed to decrypt after 0.1 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 "site-packages\calibre\customize\ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 624, in run File "calibre_plugins.dedrm.init", line 574, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.3: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Added 12 Rules for Life: An Antidote to Chaos to db in: 0.2 Added 1 books in 1.1 seconds Worker Launch took: 0.153000116348 Job: 3 Convert book 1 of 1 (12 Rules for Life: An Antidote to Chaos) finished Convert book 1 of 1 (12 Rules for Life: An Antidote to Chaos) Conversion options changed from defaults: output_profile: u'kindle_pw3' cover: u'C:\Users\SARAVA~1\AppData\Local\Temp\calibre_nc5ujk\0gnnkd.jpeg' verbose: 2 read_metadata_from_opf: u'C:\Users\SARAVA~1\AppData\Local\Temp\calibre_nc5ujk\flyf6a.opf' Resolved conversion options calibre version: 3.46.0 {'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'C:\Users\SARAVA~1\AppData\Local\Temp\calibre_nc5ujk\0gnnkd.jpeg', 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'filter_css': u'', 'fix_indents': True, 'font_size_mapping': None, 'format': u'doc', 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'inline_toc': False, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x07686430>, '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_inline_navbars': False, 'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x07686830>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'pdb_output_encoding': u'cp1252', 'prefer_metadata_cover': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\SARAVA~1\AppData\Local\Temp\calibre_nc5ujk\flyf6a.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, 'transform_css_rules': '[]', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: MOBI Input running on C:\Users\SARAVA~1\AppData\Local\Temp\calibre_nc5ujk\xhtka0.azw Found KF8 MOBI of type u'standalone' Python function terminated unexpectedly 12 Rules for Life: An Antidote to Chaos (Error Code: 1) Traceback (most recent call last): File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "site-packages\calibre\utils\ipc\worker.py", line 200, 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 1110, in run File "site-packages\calibre\customize\conversion.py", line 246, in call File "site-packages\calibre\ebooks\conversion\plugins\mobi_input.py", line 47, in convert File "site-packages\calibre\ebooks\mobi\reader\mobi8.py", line 86, in call File "site-packages\calibre\ebooks\mobi\reader\mobi6.py", line 158, in check_for_drm calibre.ebooks.DRMError: 12 Rules for Life: An Antidote to Chaos

ElleKayEm commented 5 years ago

@doc-rsn You need to use Kindle for PC version 1.24 or earlier. If you're using one of the versions from 1.19 to 1.24, you'll need to disable downloads of the KFX format or add the KFX Input plugin. See this post for info:

https://www.mobileread.com/forums/showthread.php?t=283371

tenxt commented 4 years ago

Try this

Steps for DeDRM and KFX plugins with Kindle Book for Windows 10 PC:

  1. Download Kindle version 1.24.3 or less.
  2. Register/Login to your Amazon account.
  3. Buy the Kindle book you want on Amazon. Do not buy the rented version because it won't work.
  4. Wait for book to download on Kindle Window PC Program
  5. Download calibre
  6. Download DeDRM from apprenticeharper
  7. Unzip file
  8. Go in to calibre to add plugins under "Preferences". Click the unzipped DeDRM folder. Choose folder "DeDRM_calibre_plugin" and then click the zip file name "DeDRM_plugin" to add the plugin.
  9. Click ok on all and then "apply"
  10. Exit calibre and open again.
  11. Download the KFX plugin
  12. Go in to calibre to add plugins under "Preferences". Click the zip file "KFX Input" to add the plugin.
  13. Click ok on all and then "apply"
  14. Exit calibre and open again.
  15. Now click add books. Click folder "My Kindle Content." Then click the book you want to add.
  16. After the book is added, check the side of calibre to see if there was any change to "Format: azw." If the format changed anything like "Format: azw4" etc. then you have been successful.
  17. Now you can convert the book in to any other format you wish.
  18. Happy reading.
way2github commented 3 years ago

@doc-rsn You need to use Kindle for PC version 1.24 or earlier. If you're using one of the versions from 1.19 to 1.24, you'll need to disable downloads of the KFX format or add the KFX Input plugin. See this post for info:

https://www.mobileread.com/forums/showthread.php?t=283371

This solved my problem. Thanks for saving my day!

ElleKayEm commented 3 years ago

@way2github Just an update to that old comment: For KFX format, you can go up to version 1.26 of the Kindle app. And otherwise, there's a way disable KFX downloads on even the current version now. The info at that link has been kept up-to-date on this.