apprenticeharper / DeDRM_tools

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

Troubleshooting - DeDRM plugin doesn't seem to fire on KFX book #872

Closed CraigularB closed 5 years ago

CraigularB commented 5 years ago

Hi all, I've run into an issue with Calibre and KFX Input/DeDRM. I've got a book downloaded from Kindle for PC v1.26.0 (a book I own) in KFX-ZIP format. I added the book to the library directly from my Kindle content folder (the book was in AZW format with the .voucher file in the same directory). When I try to convert it, it recognizes the input as KFX-ZIP. I set the output to KFX and start the job, and I get the "locked by DRM" popup. I've saved a log, and it looks like the DeDRM plugin isn't being loaded, it doesn't appear in the logs.

I currently have Calibre, KFX Input/Output, and DeDRM at the latest versions. Log file is below. Thanks!

calibre Debug log calibre 3.46 [64bit] embedded-python: True is64bit: True Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.18362') Python 2.7.15+ Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 17, 1) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 17, 1) && Set KFX metadata (from KFX Output) (1, 30, 0) && KFX Output (1, 30, 0) && KFX metadata reader (from KFX Input) (1, 17, 1) && KFX Input (1, 17, 1) calibre 3.46 [64bit] embedded-python: True is64bit: True Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.18362') Python 2.7.15+ Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 17, 1) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 17, 1) && Set KFX metadata (from KFX Output) (1, 30, 0) && KFX Output (1, 30, 0) && KFX metadata reader (from KFX Input) (1, 17, 1) && KFX Input (1, 17, 1) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 96.0455580866 x 95.9957295374 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.06] splash screen shown [0.06] Initializing db... [0.08] db initialized [0.08] Constructing main UI... [1.02] main UI initialized... [1.02] Hiding splash screen Storage number map: {(7L, 0L): [(1L, 'E')], (7L, 1L): [(1L, 'F')], (7L, 2L): [(4L, 'C')], (7L, 3L): [(1L, 'D')], (7L, 4L): [(1L, 'G')]} Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0401\G000WN0392270FX5&0: StorageDeviceNumber(type=7L, number=4L, partition_number=0L) Drive letters for USBDevice(vendor_id=0x1949 product_id=0x4 bcd=0x401 devid=usb\vid_1949&pid_0004&rev_0401 devinst=3) {u'drive_letters': ['G'], u'pnp_id_map': {'G': u'\\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0401#g000wn0392270fx5&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'}, u'readonly_drives': set([]), u'sort_map': {'G': (4L, 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: G:\ documents DEBUG: 0.0 USBMS: scan from root False G:\documents DEBUG: 0.0 USBMS: count found in cache: 4, count of files in metadata: 4, need_sync: False DEBUG: 0.0 USBMS: Finished fetching list of books from device. oncard= None DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda DEBUG: 0.0 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= 4 DeviceJob: set_books_in_library finished: time= 0.00400018692017 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: 2 Get list of books on device finished No details available. Job: 1 Set library information finished No details available. [38.80] splash screen hidden [38.80] Started up in 38.80 seconds with 191 books Worker Launch took: 0.0899999141693 Job: 3 Convert book 1 of 1 (HALO: Envoy) finished Convert book 1 of 1 (HALO: Envoy) Conversion options changed from defaults: read_metadata_from_opf: u'C:\Users\Craig\AppData\Local\Temp\calibre_b3dfst\dbebb1.opf' cover: u'C:\Users\Craig\AppData\Local\Temp\calibre_b3dfst\goebw2.jpeg' output_profile: u'kindle_voyage' verbose: 2 Resolved conversion options calibre version: 3.46.0 {'allow_conversion_with_errors': False, 'approximate_pages': False, 'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 0.0, 'book_producer': None, 'cde_type_pdoc': False, '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\Craig\AppData\Local\Temp\calibre_b3dfst\goebw2.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_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x000001DA9850C400>, '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, 'number_of_pages_field': u'(auto)', 'output_profile': <calibre.customize.profiles.KindleVoyageOutput object at 0x000001DA9850CB38>, 'page_breaks_before': u'/', 'prefer_metadata_cover': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\Users\Craig\AppData\Local\Temp\calibre_b3dfst\dbebb1.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, 'show_kpr_logs': 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, 'transform_css_rules': '[]', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: KFX Input running on C:\Users\Craig\AppData\Local\Temp\calibre_b3dfst\lzyb7u.kfx-zip Software versions: KFX Input 1.17.1, calibre 3.46 [64bit], Windows-10-10.0.18362-SP0 KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting C:\Users\Craig\AppData\Local\Temp\calibre_b3dfst\lzyb7u.kfx-zip Processing container: B01M0680GI_EBOK.azw Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 98, 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 160, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 267, in get_container KFXDRMError: Book container B01M0680GI_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 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 101, in convert calibre.ebooks.DRMError: This book has DRM!

ElleKayEm commented 5 years ago

You'll need to go back to Kindle for PC 1.24 or earlier. See this post:

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

You're not seeing the DeDRM plugin in use here because DRM removal happens when you first add the book, not during conversion.

CraigularB commented 5 years ago

@ElleKayEm Thanks, I had misunderstood the post; I thought I saw someone with the latest version working but it looks like that was for macOS, not Win10.

I will try 1.24 and close if it works. Is there a similar issue for KFX books pulled off a Kindle device running the latest firmware? If there is I'll continue using KfPC 1.24.

ElleKayEm commented 5 years ago

No, DeDRM doesn't work with recent firmware for E-ink Kindles either. Info about that at the link I gave too.

CraigularB commented 5 years ago

@ElleKayEm Got it, thanks. I tried 1.24 and it worked just fine, I'll go ahead and close this and read the thread a bit more closely.