apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.52k stars 1.51k forks source link

Having trouble converting KFX-ZIP file! #1169

Closed alloschexy closed 4 years ago

alloschexy commented 4 years ago

calibre Debug log calibre 3.48 [64bit] embedded-python: True is64bit: True Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE') ('Windows', '7', '6.1.7601') Python 2.7.15+ Windows: ('7', '6.1.7601', 'SP1', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 33, 0) && DeDRM (6, 8, 0) && Kindle and Mobipocket DeDRM (0, 4, 13) && Package KFX (from KFX Input) (1, 33, 0) && Obok DeDRM (6, 5, 4) && KFX metadata reader (from KFX Input) (1, 33, 0) && KFX Input (1, 33, 0) calibre 3.48 [64bit] embedded-python: True is64bit: True Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE') ('Windows', '7', '6.1.7601') Python 2.7.15+ Windows: ('7', '6.1.7601', 'SP1', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 33, 0) && DeDRM (6, 8, 0) && Kindle and Mobipocket DeDRM (0, 4, 13) && Package KFX (from KFX Input) (1, 33, 0) && Obok DeDRM (6, 5, 4) && KFX metadata reader (from KFX Input) (1, 33, 0) && KFX Input (1, 33, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 72.0567375887 x 71.8867924528 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.09] splash screen shown [0.09] Initializing db... [0.09] db initialized [0.09] 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 [1.72] main UI initialized... [1.72] Hiding splash screen [14.29] splash screen hidden [14.29] Started up in 14.29 seconds with 3 books Worker Launch took: 0.123000144958 Job: 0 Convert book 1 of 1 (Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections) finished Convert book 1 of 1 (Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections) Conversion options changed from defaults: verbose: 2 output_profile: u'ipad3' allow_conversion_with_errors: True read_metadata_from_opf: u'C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\e0cbcq.opf' cover: u'C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\pow_wz.jpeg' Resolved conversion options calibre version: 3.48.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': u'C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\pow_wz.jpeg', 'custom_size': None, '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_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000000003D52CF8>, '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.iPad3Output object at 0x0000000003D5F240>, 'page_breaks_before': u'/', 'paper_size': u'letter', 'pdf_add_toc': False, 'pdf_default_font_size': 20, 'pdf_footer_template': None, 'pdf_header_template': None, 'pdf_hyphenate': False, 'pdf_mark_links': False, 'pdf_mono_family': u'Liberation Mono', 'pdf_mono_font_size': 16, 'pdf_page_margin_bottom': 72.0, 'pdf_page_margin_left': 72.0, 'pdf_page_margin_right': 72.0, 'pdf_page_margin_top': 72.0, 'pdf_page_number_map': None, 'pdf_page_numbers': False, 'pdf_sans_family': u'Liberation Sans', 'pdf_serif_family': u'Liberation Serif', 'pdf_standard_font': u'serif', 'pdf_use_document_margins': False, 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\e0cbcq.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': '[]', 'uncompressed_pdf': False, 'unit': u'inch', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'use_profile_size': False, 'verbose': 2} InputFormatPlugin: KFX Input running on C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\fyil6u.kfx-zip Software versions: KFX Input 1.33.0, calibre 3.48 [64bit], Windows-7-6.1.7601-SP1 KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting C:\Users\Bob\AppData\Local\Temp\calibre_hpre7j\fyil6u.kfx-zip Processing container: B00B6FLH1O_EBOK.azw Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 99, in convert File "calibre_plugins.kfx_input.init", line 198, 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 184, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 291, in get_container KFXDRMError: Book container B00B6FLH1O_EBOK.azw has DRM and cannot be converted Python function terminated unexpectedly This book has DRM! (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 199, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 43, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 28, 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 104, in convert calibre.ebooks.DRMError: This book has DRM!

ElleKayEm commented 4 years ago

DRM removal happens when you first add the book to calibre, not during conversion. First take a look here for info about dealing with or avoiding the KFX format:

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

If that doesn't solve it, then here's how to get a log:

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

alloschexy commented 4 years ago

Ohhh so should I put the book in Calibre again?

ElleKayEm commented 4 years ago

Yes, after following the instructions for one of the Methods at the MobileRead link.

alloschexy commented 4 years ago

Thanks!! Although I reverted to the older version of Kindle and received this error:

calibre, version 3.48.0 (win32, embedded-python: True) Conversion error: Failed: Convert book 1 of 1 (Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections)

Convert book 1 of 1 (Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections) Conversion options changed from defaults: output_profile: u'ipad3' read_metadata_from_opf: u'C:\Users\Bob\AppData\Local\Temp\calibre_q5kx7o\sjawcm.opf' cover: u'C:\Users\Bob\AppData\Local\Temp\calibre_q5kx7o\zz5w10.jpeg' verbose: 2 Resolved conversion options calibre version: 3.48.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\Bob\AppData\Local\Temp\calibre_q5kx7o\zz5w10.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 0x0000000003C88E48>, '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.iPad3Output object at 0x0000000003DCC390>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\Bob\AppData\Local\Temp\calibre_q5kx7o\sjawcm.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} InputFormatPlugin: AZW4 Input running on C:\Users\Bob\AppData\Local\Temp\calibre_q5kx7o\kibxzx.azw4 Extracting PDF from AZW4 Container... Converting file to html... Python function terminated unexpectedly pdftohtml failed with return code: 1 Syntax Warning: May not be a PDF file (continuing anyway) Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't read xref table (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 199, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 43, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 28, 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\azw4_input.py", line 27, in convert File "site-packages\calibre\ebooks\azw4\reader.py", line 59, in extract_content File "site-packages\calibre\ebooks\conversion\plugins\pdf_input.py", line 54, in convert File "site-packages\calibre\ebooks\pdf\pdftohtml.py", line 89, in pdftohtml calibre.ebooks.ConversionError: pdftohtml failed with return code: 1 Syntax Warning: May not be a PDF file (continuing anyway) Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't read xref table

alloschexy commented 4 years ago

Ah I should mention, I reverted to version 1.17 but I will try with version 1.26 and see how that goes :)

ElleKayEm commented 4 years ago

We'll need an import log to see what's happening with DRM removal.

alloschexy commented 4 years ago

stdout+stderr from file dialog helper: ['', ''] piped data from file dialog helper: ['BfC\xc1P\xf9Pq\xdbC\xa0\x85\xbfy;~i\xd2\xa1\xf8\xf8i\xdb\n\xa3\x8e\x16\xa4\xe7{\x80<', 'C:\Users\Bob\Documents\My Kindle Content\Update Laboratory Exercises in - Robert Amitrano.azw4'] DeDRM v6.8.0: Trying to decrypt Update Laboratory Exercises in - Robert Amitrano.azw4 Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 4 ebook: Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections Got DSN key from database default_key Found 4 keys to try after 0.3 seconds Crypto Type is: 2 DeDRM v6.8.0: Failed to decrypt with error: Cannot decode library or rented ebooks. DeDRM v6.8.0: Looking for new default Kindle Key after 0.3 seconds searching for kinfoFiles in C:\Users\Bob\AppData\Local Found K4PC 1.25+ kinf2018 file: C:\Users\Bob\AppData\Local\Amazon\Kindle\storage.kinf2018 Found K4PC 1.9+ kinf2011 file: C:\Users\Bob\AppData\Local\Amazon\Kindle\storage.kinf2011 Decrypted key file using IDString '1988118905' and UserName '426f62' Decrypted key file using IDString '1988118905' and UserName '426f62' DeDRM v6.8.0: Found 2 new keys MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 4 ebook: Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections Got DSN key from database default_key_1 Got DSN key from database default_key_2 Found 4 keys to try after 12.2 seconds Crypto Type is: 2 DeDRM v6.8.0: Ultimately failed to decrypt after 12.2 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 625, in run File "calibre_plugins.dedrm.init", line 575, in KindleMobiDecrypt DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 12.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Kindle and Mobipocket DeDRM v0.4.13: Trying to decrypt Update_ Laboratory Exercises in - Robert Amitrano.azw4. Using Library AlfCrypto DLL/DYLIB/SO Running file type plugin Kindle and Mobipocket 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.k4mobidedrm.init", line 116, in run File "calibre_plugins.k4mobidedrm.init", line 249, in config File "site-packages\calibre\customize\zipplugin.py", line 185, in load_module File "calibre_plugins.k4mobidedrm.config", line 4, in ImportError: No module named PyQt4.Qt Added Update: Laboratory Exercises in Anatomy and Physiology with Cat Dissections to db in: 2.8 Added 1 books in 16.4 seconds

alloschexy commented 4 years ago

So I assume the problem is that this book is rented?

ElleKayEm commented 4 years ago

Yes, DeDRM is intended for purchased books.

alloschexy commented 4 years ago

Great, thanks so much! I went ahead and purchased the book, I'll let you know how this goes:)

alloschexy commented 4 years ago

Yesss it worked great! Thank you so much again I appreciate it so so much