apprenticeharper / DeDRM_tools

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

No DRM is stripped. DeDRM 6.8.0 on Calibre 4.23.0 on Mac #1319

Open billhilly2005 opened 4 years ago

billhilly2005 commented 4 years ago

Started with latest version of Calibre, downgraded to v4.23 as suggested and downgraded again to v4.20. I am receiving the following error when I try to install the plugin from .zip:

calibre, version 4.20.0 ERROR: Unhandled exception: InvalidPlugin:The plugin in u'/home/richard/Downloads/DeDRM_tools_6.8.0(1).zip' is invalid. It does not contain a top-level init.py file

calibre 4.20 embedded-python: True is64bit: True Linux-5.8.11-1-MANJARO-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF') ('Linux', '5.8.11-1-MANJARO', '#1 SMP PREEMPT Wed Sep 23 14:35:40 UTC 2020') Python 2.7.16 Linux: ('', '', '') Interface language: None Traceback (most recent call last): File "site-packages/calibre/gui2/preferences/plugins.py", line 319, in add_plugin File "site-packages/calibre/customize/ui.py", line 472, in add_plugin File "site-packages/calibre/customize/ui.py", line 61, in load_plugin File "site-packages/calibre/customize/zipplugin.py", line 194, in load File "site-packages/calibre/customize/zipplugin.py", line 292, in _locate_code InvalidPlugin: The plugin in u'/home/richard/Downloads/DeDRM_tools_6.8.0(1).zip' is invalid. It does not contain a top-level init.py file

null-cipher commented 4 years ago

It looks like you are trying to install the whole zip file.

You need to extract DeDRM_Plugin.zip from the main DeDRM_tools_6.8.0(1).zip file you downloaded and install that.

CodeMonkey80s commented 4 years ago

I have exactly the same issue

Linux-5.8.14-050814-lowlatency-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.8.14-050814-lowlatency', '#202010070730 SMP PREEMPT Wed Oct 7 07:42:04 UTC 2020')
Python 3.8.5
Interface language: None
Traceback (most recent call last):
  File "calibre/gui2/preferences/plugins.py", line 317, in add_plugin
  File "calibre/customize/ui.py", line 472, in add_plugin
  File "calibre/customize/ui.py", line 61, in load_plugin
  File "calibre/customize/zipplugin.py", line 282, in load
  File "importlib/__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "calibre/customize/zipplugin.py", line 174, in exec_module
  File "calibre/customize/zipplugin.py", line 170, in get_code
  File "calibre_plugins.dedrm.__init__", line 168
    print u"{0} v{1}: Copying needed library files from plugin's zip".format(PLUGIN_NAME, PLUGIN_VERSION)
          ^
SyntaxError: invalid syntax

I am selecting the file DeDRM_Plugin.zip.

shish commented 4 years ago

You need to install a version of calibre which uses Python 2.7 (not 3.8) - ie, Calibre 4.X from the official website

billhilly2005 commented 4 years ago

Doh! The plugin installed successfully after I loaded the correct .zip. Anyone have any pointers for importing ebooks from the library on my MacBook? I copied the "My Kindle Content" directory from my MacBook to my desktop. When I try to import the files in to Calibre, the files copy, but remain "as is" and unreadable. From looking at the plugin, I guess I need to import a key from somewhere to decrypt the files?

l-l-l-l-l-l commented 4 years ago

Should be from the MacBook. I don't know if importing them directly from the MacBook (as oppossed to the 2-step approach you are using) will work, but otherwise go to the icon with the screwdriver and the wrench in your calibre, from the menu window that comes out, choose the green puzzle piece in the bottom left corner, search for "DeDRM (6.8.0)" in the bar, click on the middle button from the top row at the bottom and then on "eInk Kindle ebooks". In the window that ops out, click on the green + sign, then write your MacBook's serial number. Once done, import the books again.

ElleKayEm commented 4 years ago

@billhilly2005 When importing books from Kindle for Mac (or PC), it needs to be installed on the same machine and user as calibre with DeDRM to automatically retrieve the key. Each app installation has a unique key.

billhilly2005 commented 4 years ago

@billhilly2005 When importing books from Kindle for Mac (or PC), it needs to be installed on the same machine and user as calibre with DeDRM to automatically retrieve the key. Each app installation has a unique key.

I installed Calibre 4.23.0 on my Mac, installed the latest version of DeDRM 6.8.0, and imported the directory containing my Kindle eBooks. The strange thing is, I have about 80 eBooks on my Mac Kindle App but only about 6 files were loaded in to Calibre and the plugin did not strip the DRM from any of the files. DeDRM is automatic correct? After the plugin is installed and enabled, it will automatically detect and remove DRM? Or is there some other step that has to be taken?

ElleKayEm commented 4 years ago

Let's see a log of adding one book: 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

tartley commented 4 years ago

@xPrzybyLx Hi there. Your comment is about a different issue, the logging output is very different. There are already many issues filed with the same problem as yours. No current DeDRM releases work on Calibre 5.x. To use DeDRM, you must downgrade Calibre to the latest v4.x version.

If you need further help, please search the existing issues for lots of discussion of your situation. Thanks!

tartley commented 4 years ago

@billhilly2005 After the plugin is installed, you have to re-import your books to Calibre. Removing DRM happens during this import step, not when the plugin is installed, nor when converting to other formats.

Give it a try and let let me know whether I can close this issue. Many thanks.

gaslantern commented 3 years ago

Similar to @billhilly2005, I installed Calibre 4.23.0 on my Mac, installed the latest version of DeDRM 6.8.0, and re-imported a book to Calibre - but the conversion is not removing DRM.

ElleKayEm commented 3 years ago

@gaslantern If you're on Big Sur, give 6.8.1 a try.

gaslantern commented 3 years ago

Just tried 6.8.1 with negative results:

calibre, version 4.23.0 (darwin, embedded-python: True) Conversion error: Failed: Convert book 1 of 1 (Colloquial Amharic (Colloquial Series))

Convert book 1 of 1 (Colloquial Amharic (Colloquial Series)) Conversion options changed from defaults: output_profile: u'kindle' verbose: 2 read_metadata_from_opf: u'/var/folders/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/IMvzB0.opf' cover: u'/var/folders/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/rqboRP.jpeg' Resolved conversion options calibre version: 4.23.0 {'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/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/rqboRP.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 0x1168e0450>, '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.KindleOutput object at 0x1168e0b10>, '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'Courier', 'pdf_mono_font_size': 16, 'pdf_odd_even_offset': 0.0, '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'Helvetica', 'pdf_serif_family': u'Times', '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'/var/folders/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/IMvzB0.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 /var/folders/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/97zm2S.kfx-zip Software versions: KFX Input 1.36.0, calibre 4.23, Darwin-20.2.0-x86_64-i386-64bit KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290 Converting /var/folders/c8/dfgj_ypd2x5274s2d3p10rkr0000gn/C/calibre_4.23.0_tmp_dnkiBl/97zm2S.kfx-zip Processing container: B01416X2IK_EBOK.azw Traceback (most recent call last): File "calibre_plugins.kfx_input.init", line 105, in convert File "calibre_plugins.kfx_input.kfxlib.yj_book", line 208, in decode_book File "calibre_plugins.kfx_input.kfxlib.yj_book", line 315, in get_container KFXDRMError: Book container B01416X2IK_EBOK.azw has DRM and cannot be converted Python function terminated unexpectedly: This book has DRM! Traceback (most recent call last): File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 187, in main return run_entry_point() File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 121, in run_entry_point return getattr(pmod, func)() File "site-packages/calibre/utils/ipc/worker.py", line 209, 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 123, in convert DRMError: This book has DRM!

ElleKayEm commented 3 years ago

Either use Kindle for Mac 1.26 or disable KFX downloads. See this post for detailed info: https://www.mobileread.com/forums/showpost.php?p=3819708&postcount=508