xxyzz / WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.
https://xxyzz.github.io/WordDumb/
GNU General Public License v3.0
386 stars 19 forks source link

Constant error when generating files for any book #66

Closed Astryyn closed 2 years ago

Astryyn commented 2 years ago

Describe the bug

Whenever I try to generate word-wise and x-ray files for any book, this error appears

System Information

OS: Windows 11 Calibre: 6.3 Python: 3.8 Plugin: 3.25

Error message

calibre, version 6.3.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Rime Chronicles 01 - Onyx & Ivory 
Job: "Generating Word Wise and X-Ray for Rime Chronicles 01 - Onyx & Ivory" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 144, in do_job
  File "calibre_plugins.worddumb.parse_job", line 200, in create_files
  File "calibre_plugins.worddumb.mediawiki", line 102, in __init__
  File "calibre_plugins.worddumb.mediawiki", line 56, in __init__
  File "json\__init__.py", line 293, in load
  File "json\__init__.py", line 346, in loads
  File "json\decoder.py", line 337, in decode
  File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 2797220 (char 2797219)

Called with args: ((578, 'KFX', 'C:\\Users\\Astryyn\\Documents\\For Kindle\\Mindee Arnett\\Rime Chronicles 01 - Onyx & Ivory (578)\\Rime Chronicles 01 - Onyx & Ivo - Mindee Arnett.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001CB4384BE20>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x000001CB438A00A0>, 'abort': <threading.Event object at 0x000001CB4384B5B0>, 'log': <calibre.utils.logging.GUILog object at 0x000001CB4384B4F0>} 

Reproduce steps

  1. Select books
  2. Run plugin

Screenshots or videos

No response

xxyzz commented 2 years ago

The Wikipedia or Fandom cache file is corrupt. Please upload the "en.json" file in the "\~/AppData/Roaming/calibre/plugins/worddumb-wikipedia" folder and the json file in "\~/AppData/Roaming/calibre/plugins/worddumb-fandom" folder. Then you could delete these files to solve the error.

Astryyn commented 2 years ago

Hi! I'm not entirely sure if I'm supposed to upload it here but here are the mentioned files! Deleting them has solved the issue as well, thank you so much for your help! en.zip

xxyzz commented 2 years ago

The Wikipedia summary cache file "en.json" contains incomplete JSON data at the end. Maybe the program was interrupted while writing to the file.