Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error while adding the plugin DEDRM #986

Closed
giblim opened this issue Jan 24, 2020 · 11 comments
Closed

Syntax error while adding the plugin DEDRM #986

giblim opened this issue Jan 24, 2020 · 11 comments

Comments

@giblim
Copy link

giblim commented Jan 24, 2020

Hello
I tried to load the plugin V6.6.3


Screenshot from 2020-01-24 18-37-49

calibre, version 4.8.0
ERROR: Unhandled exception: SyntaxError:invalid syntax (calibre_plugins.dedrm.init, line 167)

calibre 4.8 embedded-python: False is64bit: True
Linux-5.4.12-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One Linux ('64bit', 'ELF')
('Linux', '5.4.12-200.fc31.x86_64', '#1 SMP Tue Jan 14 20:07:04 UTC 2020')
Python 3.7.6
Linux: ('Fedora', '31', 'Thirty One')
Interface language: en_GB
Traceback (most recent call last):
File "/usr/lib64/calibre/calibre/gui2/preferences/plugins.py", line 318, in add_plugin
plugin = add_plugin(path)
File "/usr/lib64/calibre/calibre/customize/ui.py", line 472, in add_plugin
plugin = load_plugin(path_to_zip_file)
File "/usr/lib64/calibre/calibre/customize/ui.py", line 61, in load_plugin
return loader.load(path_to_zip_file)
File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 202, in load
m = importlib.import_module(plugin_module)
File "/usr/lib64/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 180, in load_module
import_name), 'exec', dont_inherit=True)
File "calibre_plugins.dedrm.init", line 167
print u"{0} v{1}: Copying needed library files from plugin's zip".format(PLUGIN_NAME, PLUGIN_VERSION)
^
SyntaxError: invalid syntax

I don know what happened here...

@ElleKayEm
Copy link

What is the actual file you're trying to load? Should be DeDRM_plugin.zip.

@j-howell
Copy link

j-howell commented Jan 24, 2020

The DeDRM plugin is not currently compatible with Python 3.

The official Linux release of calibre is available here: https://calibre-ebook.com/download_linux

@giblim
Copy link
Author

giblim commented Jan 24, 2020

Okay, I installed calibre from the link above and I could install the plugin.
Well, I am getting another error when I convert I Amazon ebook to PDF but that's another issue I guess...

@ElleKayEm
Copy link

DRM error or something else? If the book is AZW4 format, try the KindleUnpack plugin.

@giblim
Copy link
Author

giblim commented Jan 25, 2020

It's AZW3 format...
Here the output from the log:

calibre, version 4.9.1 (linux2, embedded-python: True)
Conversion error: Failed: Convert book 1 of 1 (Lenormand Symbols: Exploring the Origins of the Images on the Cards)

Convert book 1 of 1 (Lenormand Symbols: Exploring the Origins of the Images on the Cards)
Conversion options changed from defaults:
pdf_sans_family: u'Nimbus Sans [UKWN]'
pdf_mono_family: u'Nimbus Mono PS [UKWN]'
verbose: 2
output_profile: u'generic_eink'
cover: u'/tmp/calibre_4.9.1_tmp_x6WMy3/pD_It8.jpeg'
pdf_serif_family: u'Nimbus Roman [UKWN]'
read_metadata_from_opf: u'/tmp/calibre_4.9.1_tmp_x6WMy3/rrkBJH.opf'
Resolved conversion options
calibre version: 4.9.1
{'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'/tmp/calibre_4.9.1_tmp_x6WMy3/pD_It8.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 0x7f43e3905dd0>,
'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.GenericEink object at 0x7f43e390d210>,
'page_breaks_before': u"//*[name()='h1' or name()='h2']",
'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'Nimbus Mono PS [UKWN]',
'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'Nimbus Sans [UKWN]',
'pdf_serif_family': u'Nimbus Roman [UKWN]',
'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'/tmp/calibre_4.9.1_tmp_x6WMy3/rrkBJH.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: MOBI Input running
on /tmp/calibre_4.9.1_tmp_x6WMy3/OGMZuc.azw3
Found KF8 MOBI of type u'standalone'
Traceback (most recent call last):
File "site.py", line 77, in main
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 "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
DRMError: Lenormand Symbols: Exploring the Origins of the Images on the Cards

Any idea?

@ElleKayEm
Copy link

DRM not removed. If it's from or for an E-ink Kindle, enter the Kindle's serial number into the DeDRM plugin's customization. If that's not it, we'll need to see an import 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

@giblim
Copy link
Author

giblim commented Jan 26, 2020

I entered
G000PP12928702C7
and the same error is showing up...
Just to say I copied the file from my Kindle Library on the server and not from the Kindle device...

@ElleKayEm
Copy link

It's an E-ink Kindle (not a Fire)? And are you sure that's the device you selected when downloading? Try copy & pasting the serial number (removing spaces) from the website.

@giblim
Copy link
Author

giblim commented Jan 26, 2020

It's a Paper White

Type
Kindle Paperwhite (10e génération)
Numéro de série
G000PP12928702C7
I copied/pasted it into the plugin - same result

@ElleKayEm
Copy link

Are you re-adding the book to calibre? DRM removal happens when you add the book, not during conversion. If it's still not working, post an import log.

@giblim
Copy link
Author

giblim commented Jan 26, 2020

Okay, I wasn't aware of the procedure. I removed and loaded the book again.
It worked and I have a working pdf file now !
Thanks a lot for your support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants