noDRM / DeDRM_tools

DeDRM tools for ebooks
7.32k stars 323 forks source link

KeyError: "There is no item named 'OPS/advanced.opf' in the archive #366

Open GitCantFricking opened 1 year ago

GitCantFricking commented 1 year ago

Question / bug report

Attempted to remove the DRM from a Japanese eBook/digital comic I bought from Kobo. I tried with the Obok plugin and with the DeDRM plugin but neither method worked, and I got a similar log output from both, with the same "KeyError".

Which version of Calibre are you running?

6.22

Which version of the DeDRM plugin are you running?

v10.0.3

If applicable, which version of the Kindle software are you running?

No response

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
calibre Debug log
calibre 6.22  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3) && Obok DeDRM (10, 0, 3)
calibre 6.22  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3) && Obok DeDRM (10, 0, 3)
QPA platform: windows
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 102.45378151260503 x 102.35820895522387
[0.00] Starting up...
[0.00] Showing splash screen...
[0.19] splash screen shown
[0.19] Initializing db...
[0.19] db initialized
[0.19] Constructing main UI...
DEBUG:    0.0 obok::utilities.py - loading translations
DEBUG:    0.0 obok::dialogs.py - loading translations
DEBUG:    0.0 obok::config.py - loading translations
DEBUG:    0.0 obok::action_err.py - loading translations
[0.94] main UI initialized...
[0.94] Hiding splash screen
Starting QuickView
DeDRM v10.0.3: Trying to decrypt DEATH NOTE カラー版 1.epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: DEATH NOTE カラー版 1.epub is a secure Adobe Adept ePub for UUID d03b8586-5ee5-43e9-aea6-6b649651d6f5
DeDRM v10.0.3: Trying Encryption key default_key
271ku78p.epub is a secure Adobe Adept ePub.
[4.45] splash screen hidden
[4.45] Started up in 4.45 seconds with 1 books
stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b't\x0c\xbf\xbaaiaM\xb3\x9d\x8d\xc9\x88\n\xc9TYq\xedd+HX\x10\xf6\x9e\xee\x13^\xad\xee\xe9', b'C:\\Users\\Kendall\\Documents\\My Digital Editions\\DEATH NOTE \xe3\x82\xab\xe3\x83\xa9\xe3\x83\xbc\xe7\x89\x88 1.epub']
DeDRM v10.0.3: Decrypted with key default_key after 1.8 seconds
DeDRM v10.0.3: Post-processing took 0.1 seconds
DeDRM v10.0.3: Finished after 1.9 seconds
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 469, in get_file_type_metadata
  File "calibre\customize\builtins.py", line 176, in get_metadata
  File "calibre\ebooks\metadata\epub.py", line 217, in get_metadata
  File "calibre\ebooks\metadata\epub.py", line 155, in read_bytes
  File "calibre\utils\zipfile.py", line 1005, in read
  File "calibre\utils\zipfile.py", line 1033, in open
  File "calibre\utils\zipfile.py", line 994, in getinfo
KeyError: "There is no item named 'OPS/advanced.opf' in the archive"
ElleKayEm commented 1 year ago

That's an issue with the book itself. I don't know how to resolve it.

KeyError: "There is no item named 'OPS/advanced.opf' in the archive"

GitCantFricking commented 1 year ago

That's an issue with the book itself. I don't know how to resolve it.

KeyError: "There is no item named 'OPS/advanced.opf' in the archive"

Okay, upon further investigation I think the DRM removal was successful, the problem is likely with a different part of calibre (I experienced issues with the file viewer and with the converter.) I say this because I used a different program called eCanCrusher to decompress the decrypted epub, which produced a folder containing all of the ebook's contents, including all of its images (when used with the encrypted ebook, ecancrusher produced jpg files that could not be viewed.)

ElleKayEm commented 1 year ago

Yeah, that does sound like the drm is removed. Can you read it in some other epub app?

GitCantFricking commented 1 year ago

Since you asked, I went ahead and tried a few online epub reader sites. None of them were able to load it, one of them crashed. Also, in case it's relevant, I went ahead and checked the directory, there is no advanced.opf but there is a standard.opf. Out of curiosity I actually tried renaming it to advanced.opf but that did not help. Not that it matters to me, since the main contents of the book are in the images I extracted.

ElleKayEm commented 1 year ago

Hmm, I'd guess there are other references to standard.opf in there. Thanks for trying though.