apprenticeharper / DeDRM_tools

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

Problem converting AZW3 to mobi #417

Closed mitch1945 closed 6 years ago

mitch1945 commented 6 years ago

Have been using Apprentice Alf's plug-ins for years and no problems. Most of my conversions are for books purchased ex Amazon to put them in Calibre in mobi format. Never had any problems but just struck 2 books that are AZW3 (not kfx) and they will not remove DRM. I attach one of them. They were purchased from Amazon (not cheap). Both from the same author - they are old books that have been updated for Kindle. Bradshaw's Handbook - George Bradshaw.DOCX

Could not upload the AZW3 file so renamed it DOCX - hopefully if you rename it to AZW3 it will be OK? The other that will not convert is also a Bradshaw book Regards

John mitchells257@gmail.com

ElleKayEm commented 6 years ago

Post a log of adding the book to calibre.

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

mitch1945 commented 6 years ago

Hi ElleKayEm

Attached is log requested and thanks for the very prompt reply.

Regards

John

On 29 December 2017 at 21:37, ElleKayEm notifications@github.com wrote:

Post a log of adding the book to calibre.

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apprenticeharper/DeDRM_tools/issues/417#issuecomment-354435241, or mute the thread https://github.com/notifications/unsubscribe-auth/AhT4ghU09-WrEGCAmejL6_6SsgV0aKarks5tFM8DgaJpZM4RO4Ar .

calibre Debug log calibre 3.14 Portable embedded-python: True is64bit: False Windows-10-10.0.16299-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.16299') Python 2.7.12+ Windows: ('10', '10.0.16299', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 5, 5) && Find Duplicates (1, 6, 3) && MultiColumnSearch (1, 0, 74) && DOC Input (1, 0, 1) && Prince PDF (1, 4, 2) && Quality Check (1, 9, 11) && Prettify Cover 0.9.12 && Fantastic Fiction (1, 2, 0) && Generate Cover (1, 5, 21) && X-Ray Creator (3, 1, 2) && Read MP3 AudioBook metadata (1, 0, 79) && Wiki Reader (2, 1, 0) calibre 3.14 Portable embedded-python: True is64bit: False Windows-10-10.0.16299-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.16299') Python 2.7.12+ Windows: ('10', '10.0.16299', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 5, 5) && Find Duplicates (1, 6, 3) && MultiColumnSearch (1, 0, 74) && DOC Input (1, 0, 1) && Prince PDF (1, 4, 2) && Quality Check (1, 9, 11) && Prettify Cover 0.9.12 && Fantastic Fiction (1, 2, 0) && Generate Cover (1, 5, 21) && X-Ray Creator (3, 1, 2) && Read MP3 AudioBook metadata (1, 0, 79) && Wiki Reader (2, 1, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 103.10359408 x 92.6756756757 Using calibre Qt style: True Starting up... Storage number map: {(7L, 0L): [(4L, 'C'), (6L, 'D')], (7L, 1L): [(1L, 'L')], (7L, 2L): [(1L, 'I')], (7L, 3L): [(1L, 'J')], (7L, 4L): [(1L, 'K')], (7L, 5L): [(1L, 'G')]} Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0100\90602201436702U1&0: StorageDeviceNumber(type=7L, number=1L, partition_number=0L) Drive letters for USBDevice(vendor_id=0x1949 product_id=0x4 bcd=0x100 devid=usb\vid_1949&pid_0004&rev_0100 devinst=10) {u'drive_letters': ['L'], u'pnp_id_map': {'L': u'\\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0100#90602201436702u1&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'}, u'readonly_drives': set([]), u'sort_map': {'L': (1L, 1L)}} MCS has finished initialization... G:\Downloads\XXXCalibre Library is not a valid directory to watch for new ebooks, ignoring Job: 1 Set library information started DeviceJob: 1 Set library information done, calling callback DeviceJob: 1 Set library information callback returned Job: 2 Get device information started Job: 1 Set library information finished No details available. DeviceJob: 2 Get device information done, calling callback DeviceJob: 2 Get device information callback returned Job: 3 Set library information started DeviceJob: 3 Set library information done, calling callback DeviceJob: 3 Set library information callback returned Job: 4 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: L:\ documents DEBUG: 0.4 USBMS: scan from root False L:\documents DEBUG: 0.7 USBMS: count found in cache: 395, count of files in metadata: 395, need_sync: False DEBUG: 0.7 USBMS: Finished fetching list of books from device. oncard= None DEBUG: 0.7 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda DEBUG: 0.7 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb DeviceJob: 4 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= 395 Job: 4 Get list of books on device finished No details available. Job: 3 Set library information finished No details available. Job: 2 Get device information finished No details available. DeviceJob: set_books_in_library finished: time= 0.0759999752045 DeviceJob: metadata_downloaded: updating views DeviceJob: metadata_downloaded: syncing DeviceJob: metadata_downloaded: refreshing ondevice DeviceJob: metadata_downloaded: sending metadata_available signal DeviceJob: 4 Get list of books on device callback returned Job: 4 Get list of books on device finished No details available. Started up in 33.71 seconds with 56760 books stdout+stderr from file dialog helper: ['', ''] piped data from file dialog helper: ['\xa3\xbf\xac\xdc6\x88O\x8fq\x91\xb3\xc3xM\xb4x\xd8\xa9\xa3\x1c\t\x84\x9b\x81\x80\r\xe5X~\x1bc\x84', "C:\Temp\Bradshaw, George\Bradshaw's Handbook\Bradshaw's Handbook - George Bradshaw.AZW3"] DeDRM v6.5.5: Trying to decrypt Bradshaw's Handbook - George Bradshaw.AZW3 Using Library AlfCrypto Python MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Bradshaw’s Handbook Found 16 keys to try after 0.3 seconds Crypto Type is: 2 DeDRM v6.5.5: Failed to decrypt with error: No key found in 16 keys tried. DeDRM v6.5.5: Looking for new default Kindle Key after 0.3 seconds searching for kinfoFiles in C:\Users\John\AppData\Local Found K4PC 1.9+ kinf2011 file: C:\Users\John\AppData\Local\Amazon\Kindle\storage.kinf2011 Decrypted key file using IDString '3295327815' and UserName '4a6f686e' DeDRM v6.5.5: Found 1 new key MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Bradshaw’s Handbook Got DSN key from database default_key_1 Found 4 keys to try after 0.6 seconds Crypto Type is: 2 DeDRM v6.5.5: Ultimately failed to decrypt after 0.6 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 171, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 618, in run File "calibre_plugins.dedrm.init", line 568, in KindleMobiDecrypt DeDRMError: DeDRM v6.5.5: Ultimately failed to decrypt after 0.6 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Added Bradshaw�s Handbook to db in: 0.5 Added 1 books in 2.8 seconds Worker Launch took: 0.151999950409 Job: 5 Convert book 1 of 1 (Bradshaw�s Handbook) finished Convert book 1 of 1 (Bradshaw�s Handbook) Conversion options changed from defaults: read_metadata_from_opf: u'C:\Users\John\AppData\Local\Temp\calibre_sdino4\7mxi5t.opf' cover: u'C:\Users\John\AppData\Local\Temp\calibre_sdino4\2gimfj.jpeg' insert_metadata: True verbose: 2 output_profile: 'kindle_pw' Resolved conversion options calibre version: 3.14.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\John\AppData\Local\Temp\calibre_sdino4\2gimfj.jpeg', '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 0x07452650>, 'insert_blank_line': False, 'insert_blank_line_size': 0.5, 'insert_metadata': True, '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.KindlePaperWhiteOutput object at 0x07452A10>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", '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'C:\Users\John\AppData\Local\Temp\calibre_sdino4\7mxi5t.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: MOBI Input running on C:\Users\John\AppData\Local\Temp\calibre_sdino4\azkjm3.azw3 Found KF8 MOBI of type 'standalone' Python function terminated unexpectedly Bradshaw�s Handbook (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 195, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 33, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 26, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1088, in run File "site-packages\calibre\customize\conversion.py", line 245, in call File "site-packages\calibre\ebooks\conversion\plugins\mobi_input.py", line 44, 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 157, in check_for_drm calibre.ebooks.DRMError: Bradshaw�s Handbook

ElleKayEm commented 6 years ago

Did you download it from the website? Did you choose an E-ink Kindle for the device (not a Fire)? If so, it looks like you don't have the correct serial number in the plugin customization.

mitch1945 commented 6 years ago

Hi,

Yes, downloaded from Amazon USA through my account.

Loaded to Paperwhite, not Fire.

Serial number is in Calibre correctly ie 90602201436702U1

What else can be wrong?

Been converting AZW3 books for long time including tonight and all OK apart from the 2 Bradshaw books!

Cheers

John

On 29 December 2017 at 23:04, ElleKayEm notifications@github.com wrote:

Did you download it from the website? Did you choose an E-ink Kindle for the device (not a Fire)? If so, it looks like you don't have the correct serial number in the plugin customization.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apprenticeharper/DeDRM_tools/issues/417#issuecomment-354443600, or mute the thread https://github.com/notifications/unsubscribe-auth/AhT4gn26_J7joV3os33NgoR0i1ZVdEbaks5tFONkgaJpZM4RO4Ar .

ElleKayEm commented 6 years ago

Double check the serial number. Try copy & paste from the website (removing spaces). Or re-download to make sure of the device selected. Because the log says the correct key is not in there:

"DeDRM v6.5.5: Failed to decrypt with error: No key found in 16 keys tried."

(Don't post the serial number here. That would allow anyone to pirate the book from the previous post. Go ahead and remove the book from that post if possible.)

mitch1945 commented 6 years ago

Hi again,

The correct Kindle key is listed twice in around the first 30 lines of the log. I am not having any problems with other AZW3 conversions.

Any other ideas.

A clue might be that I loaded the book (in AZW3 format) to my Kindle Paperwhite and it cannot be read!

Cheers

John

On 30 December 2017 at 00:06, ElleKayEm notifications@github.com wrote:

Double check the serial number. Try copy & paste from the website (removing spaces). Or re-download to make sure of the device selected. Because the log says the correct key is not in there:

"DeDRM v6.5.5: Failed to decrypt with error: No key found in 16 keys tried."

(Don't post the serial number here. That would allow anyone to pirate the book from the previous post. Go ahead and remove the book from that post if possible.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apprenticeharper/DeDRM_tools/issues/417#issuecomment-354450162, or mute the thread https://github.com/notifications/unsubscribe-auth/AhT4ghki6gPpMT378kwEYaAscdPEv8m3ks5tFPHzgaJpZM4RO4Ar .

ElleKayEm commented 6 years ago

A clue might be that I loaded the book (in AZW3 format) to my Kindle Paperwhite and it cannot be read!

Then clearly the book is not keyed for that device. If the Paperwhite can't read it, then DeDRM won't be able to remove DRM with the key from the Paperwhite's serial number.

mitch1945 commented 6 years ago

Hi for last time!

Finally I managed to sort it. For some unknown reason when downloading it from Amazon it needs my Paperwhite name as the Kindle I am using. This may sound logical but I have never had this before. As long as it comes up with a registered unit I have all is usually OK.

Anyway, thanks for your time and patience. Both books converted OK.

Regards

John

On 31 December 2017 at 23:06, ElleKayEm notifications@github.com wrote:

A clue might be that I loaded the book (in AZW3 format) to my Kindle Paperwhite and it cannot be read!

Then clearly the book is not keyed for that device. If the Paperwhite can't read it, then DeDRM won't be able to remove DRM with the key from the Paperwhite's serial number.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apprenticeharper/DeDRM_tools/issues/417#issuecomment-354602813, or mute the thread https://github.com/notifications/unsubscribe-auth/AhT4glvGUbMaw621IFkSVY_W4p__bwJ2ks5tF4a4gaJpZM4RO4Ar .

ElleKayEm commented 6 years ago

Yes, each device has its own unique key even within the same Amazon account. If you're all set, you can close this issue.

mitch1945 commented 6 years ago

Many thanks for help and suggestions.