apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.44k stars 1.49k forks source link

Unable to Remove DRM with Obok #1476

Open fmdmf opened 3 years ago

fmdmf commented 3 years ago

Hello. I'm a bit new to this plugin, so my apologies if I miss anything obvious. I am trying to remove the DRM from books that I purchased on the Kobo store. I downloaded them using the Kobo Desktop App and tried to import them via Calibre's Obok plugin (using Calibre 4.23 and Obok v6.7). The pop up said that there were no issues, but of the 79 books I imported, only one had had its DRM removed. The rest did not, and the majority of them showed a short sequence of letters for their titles and 'Author Unknown' for their authors. Only four had the correct titles and author name, but they too could not be opened in Calibre.

I would greatly appreciate any help with this.

I am using Windows 10.

Here is the log from one of the books:

calibre Debug log calibre 4.23 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 2.7.16+ Windows: ('10', '10.0.19041', 'SP0', u'Multiprocessor Free') Interface language: en_GB Failed to initialize plugin: u'C:\Users\name\AppData\Roaming\calibre\plugins\DeDRM.zip' Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 703, in initialize_plugins File "site-packages\calibre\customize\ui.py", line 61, in load_plugin File "site-packages\calibre\customize\zipplugin.py", line 221, in load InvalidPlugin: The plugin at C:\Users\name\AppData\Roaming\calibre\plugins\DeDRM.zip needs a version of calibre >= 5.0.0 Successfully initialized third party plugins: FanFicFare (3, 27, 0) && KePub Metadata Writer (3, 2, 12) && KePub Metadata Reader (3, 4, 3) && Obok DeDRM (6, 7, 0) calibre 4.23 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 2.7.16+ Windows: ('10', '10.0.19041', 'SP0', u'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: FanFicFare (3, 27, 0) && KePub Metadata Writer (3, 2, 12) && KePub Metadata Reader (3, 4, 3) && Obok DeDRM (6, 7, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 120.0 x 120.0 physicalDpi: 117.584086799 x 117.607717042 Using calibre Qt style: True [0.00] Starting up... [0.02] Showing splash screen... [0.53] splash screen shown [0.53] Initializing db... [0.53] db initialized [0.53] Constructing main UI... DEPRECATION: The OpenSSL being used by this python install (OpenSSL 1.0.2s 28 May 2019) does not meet the minimum supported version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare, You may encounter an unexpected Captcha or cloudflare 1020 blocks. 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 Loaded cached store plugin for: Amazon Kindle at version: 19 Loaded cached store plugin for: Amazon FR Kindle at version: 16 Loaded cached store plugin for: Project Gutenberg at version: 7 Loaded cached store plugin for: Google Books at version: 7 Loaded cached store plugin for: Nexto at version: 6 Loaded cached store plugin for: ebook.de at version: 6 FFF: INFO: 2021-01-12 00:59:39,729: calibre_plugins.fanficfare_plugin.prefs(215): Attempting to read settings from predecessor--FFDL FFF: INFO: 2021-01-12 00:59:39,729: calibre_plugins.fanficfare_plugin.prefs(220): Using default settings FFF: DEBUG: 2021-01-12 00:59:39,742: calibre_plugins.fanficfare_plugin.fff_plugin(221): Plugin FanFicFare macmenuhack file_path:C:\Users\name\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt [3.28] main UI initialized... [3.28] Hiding splash screen [17.98] splash screen hidden [17.98] Started up in 17.98 seconds with 34 books Running Obok DeDRM v6.7.0 DEBUG: 315.4 didn't find device Obok v3.2.4 Copyright © 2012-2016 Physisticated et al. c:\users\name\appdata\local\temp\tmpvvd87j DEBUG: 315.4 got kobodir C:\Users\name\AppData\Local\Kobo\Kobo Desktop Edition Found 24 possible keys to try. DEBUG: 534.9 BookListTableWidget:get_books - book_num: 1 DEBUG: 534.9 BookListTableWidget:get_books - book: 銀魂 モノクロ版 1 DEBUG: 534.9 InterfacePluginAction::launchObok - number of books to decrypt: 1 Obok DeDRM v6.7.0 - Decrypting 銀魂 モノクロ版 1 Trying key: f5c3f23f6431ee08da5e738974b871f5 Success! Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 428, in get_file_type_metadata File "site-packages\calibre\customize\builtins.py", line 195, in get_metadata File "site-packages\calibre\ebooks\metadata\epub.py", line 218, in get_metadata File "site-packages\calibre\ebooks\metadata\epub.py", line 156, in read_bytes File "site-packages\calibre\utils\zipfile.py", line 999, in read File "site-packages\calibre\utils\zipfile.py", line 1027, in open File "site-packages\calibre\utils\zipfile.py", line 989, in getinfo KeyError: u"There is no item named 'OPS/advanced.opf' in the archive" DEBUG: 536.8 DecryptAddProgressDialog::do_book_action - decrypted book: '銀魂 モノクロ版 1' Obok DeDRM v6.7.0 - Added ekwno4 Obok DeDRM v6.7.0 - wrapping up results.

ElleKayEm commented 3 years ago

Obok seems to mistakenly think this book is successfully decrypted. I've been seeing other issues with Obok lately, but this is the first I've seen this one. At the same time, things are still working for me with Windows 10, calibre 4.23, and Obok 6.7.0.

Just to double-check, this is a version of Obok which was included with the DeDRM tools archive 6.7.0 or 6.8.x and not from the current master file? Because Obok's version number hasn't been updated.

Obviously this needs to be looked at, but as a workaround in the meantime, have you tried downloading via Adobe Digital Editions and using DeDRM 6.8.1 on these books?

fmdmf commented 3 years ago

When I click on the Obok icon in Caliber, it says v6.7.0, so that should be the one I installed. To check I removed the plug-in and reinstalled it from the DeDRM_tools_6.8.1 pack, but the issue remains. (The plug-in in this pack also shows up as Obok 6.7.0)

I tried installing Adobe Digital Editions like you asked (Version 2, correct?) but am not able to sign in. It says that my login details are incorrect (which shouldn't be the case, since they're the details I use to sign in on the Kobo Desktop App).

ElleKayEm commented 3 years ago

With Adobe Digital Editions, you need to create an Adobe ID. Then once you have logged into to ADE with that, go to the My Books page at Kobo. Click the 3 dot menu for a book and choose download. You'll receive an .acsm file which you open with ADE. The epub will download to the My Digital Editions folder inside your Documents folder. Add the epub to calibre.

fmdmf commented 3 years ago

Thanks for your advice. I created an Adobe ID and logged into ADE with it. I downloaded one of the books from Kobo and opened it with ADE, then tried to put that epub file into Calibre (I assume that adding it to Calibre triggers the deDRM plugin?). Just like with Obok, the file loads, but I cannot open it. It does have the title now though (no author or book cover).

ElleKayEm commented 3 years ago

Let's see a 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

fmdmf commented 3 years ago

Here it is:

calibre Debug log calibre 4.23 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 2.7.16+ Windows: ('10', '10.0.19041', 'SP0', u'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: DeDRM (6, 8, 0) && KePub Metadata Writer (3, 2, 12) && KePub Metadata Reader (3, 4, 3) && Obok DeDRM (6, 7, 0) && FanFicFare (3, 27, 0) calibre 4.23 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 2.7.16+ Windows: ('10', '10.0.19041', 'SP0', u'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: DeDRM (6, 8, 0) && KePub Metadata Writer (3, 2, 12) && KePub Metadata Reader (3, 4, 3) && Obok DeDRM (6, 7, 0) && FanFicFare (3, 27, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 120.0 x 120.0 physicalDpi: 117.584086799 x 117.607717042 Using calibre Qt style: True [0.00] Starting up... [0.02] Showing splash screen... [0.55] splash screen shown [0.55] Initializing db... [0.55] db initialized [0.55] 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 DEPRECATION: The OpenSSL being used by this python install (OpenSSL 1.0.2s 28 May 2019) does not meet the minimum supported version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare, You may encounter an unexpected Captcha or cloudflare 1020 blocks. Loaded cached store plugin for: Amazon FR Kindle at version: 16 Loaded cached store plugin for: Nexto at version: 6 FFF: INFO: 2021-01-13 02:09:45,943: calibre_plugins.fanficfare_plugin.prefs(215): Attempting to read settings from predecessor--FFDL FFF: INFO: 2021-01-13 02:09:45,943: calibre_plugins.fanficfare_plugin.prefs(220): Using default settings FFF: DEBUG: 2021-01-13 02:09:45,959: calibre_plugins.fanficfare_plugin.fff_plugin(221): Plugin FanFicFare macmenuhack file_path:C:\Users\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt [3.44] main UI initialized... [3.45] Hiding splash screen [12.41] splash screen hidden [12.41] Started up in 12.41 seconds with 34 books

Debugging DND event application/x-qt-windows-mime;value="Shell IDList Array" 274 '\x01\x00\x00\x00\x0c\x00\x00\x00\xa6\x00\x00\x00\x14\x00\x1fP\xe0O\xd0 \xea:i\x10\xa2\xd8\x08\x00+00\x9d\x14\x00.\x80\x92+\x16\xd3e\x93zF\x95k\x92p:\xca\x08\xafp\x001\x00\x00\x00\x00\x00,R\x8f]\x10\x08MYDIGI~1\x00\x00X\x00\t\x00\x04\x00\xef\xbe*RB\x99,R\x8f].\x00\x00\x00M\x16\x00\x00\x00\x00\xbe\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}-\x0e\x00M\x00y\x00 \x00D\x00i\x00g\x00i\x00t\x00a\x00l\x00 \x00E\x00d\x00i\x00t\x00i\x00o\x00n\x00s\x00\x00\x00\x18\x00\x00\x00j\x002\x00\xcag\x90\x02,Rey \x081BD10~1.EPU\x00P\x00\t\x00\x04\x00\xef\xbe,Rey,Rey.\x00\x00\x00\xf27\x00\x00\x00\x00u\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfap\xc4\x00\x80\x92B\x9b \x00\xe20\xce0\xaf0\xed0Hr \x001\x00.\x00e\x00p\x00u\x00b\x00\x00\x00\x1a\x00\x00\x00'

application/x-qt-windows-mime;value="UsingDefaultDragImage" 4 '\x01\x00\x00\x00'

application/x-qt-windows-mime;value="DragImageBits" 57624 'x\x00\x00\x00x\x00\x00\x00<\x00\x00\x00o\x00\x00\x00Y\x15\x05\x1f\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

application/x-qt-windows-mime;value="DragContext" 16 '\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

application/x-qt-windows-mime;value="DragSourceHelperFlags" 4 '\x01\x00\x00\x00'

application/x-qt-windows-mime;value="InShellDragLoop" 4 '\x01\x00\x00\x00'

text/uri-list 133 'file:///C:/Users/Documents/My%20Digital%20Editions/%E9%8A%80%E9%AD%82%20%E3%83%A2%E3%83%8E%E3%82%AF%E3%83%AD%E7%89%88%201.epub\r\n'

application/x-qt-windows-mime;value="FileName" 44 'C:\Users\DOCUME~1\MYDIGI~1\1BD10~1.EPU\x00'

application/x-qt-windows-mime;value="FileContents" 0 ''

application/x-qt-windows-mime;value="FileNameW" 120 'C\x00:\x00\\x00U\x00s\x00e\x00r\x00s\x00\\x00S\x00t\x00e\x00f\x00\\x00D\x00o\x00c\x00u\x00m\x00e\x00n\x00t\x00s\x00\\x00M\x00y\x00 \x00D\x00i\x00g\x00i\x00t\x00a\x00l\x00 \x00E\x00d\x00i\x00t\x00i\x00o\x00n\x00s\x00\\x00\x80\x92B\x9b \x00\xe20\xce0\xaf0\xed0Hr \x001\x00.\x00e\x00p\x00u\x00b\x00\x00\x00'

application/x-qt-windows-mime;value="FileGroupDescriptorW" 596 "\x01\x00\x00\x00l\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x08\x00\x00\x00\xbb\x9c(\xf5\xe8\xd6\x01\x00\x00\x00\x00\x00\x00\x00\x00\x06J\xd8'\xf5\xe8\xd6\x01\x00\x00\x00\x00\xcag\x90\x02\x80\x92B\x9b \x00\xe20\xce0\xaf0\xed0Hr \x001\x00.\x00e\x00p\x00u\x00b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

Firefox rurl: None None URLS: [u'file:///C:/Users/Documents/My%20Digital%20Editions/%E9%8A%80%E9%AD%82%20%E3%83%A2%E3%83%8E%E3%82%AF%E3%83%AD%E7%89%88%201.epub'] Paths: [u'C:/Users/Documents/My Digital Editions/\u9280\u9b42 \u30e2\u30ce\u30af\u30ed\u7248 1.epub'] Extensions: frozenset([u'epub']) DeDRM v6.8.0: Trying to decrypt 銀魂 モノクロ版 1.epub DeDRM v6.8.0: Verifying zip archive integrity DeDRM v6.8.0: 銀魂 モノクロ版 1.epub is a secure Adobe Adept ePub DeDRM v6.8.0: Trying Encryption key default_key DeDRM v6.8.0: Decrypted with key default_key after 2.3 seconds DeDRM v6.8.0: Finished after 2.3 seconds Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 428, in get_file_type_metadata File "site-packages\calibre\customize\builtins.py", line 195, in get_metadata File "site-packages\calibre\ebooks\metadata\epub.py", line 218, in get_metadata File "site-packages\calibre\ebooks\metadata\epub.py", line 156, in read_bytes File "site-packages\calibre\utils\zipfile.py", line 999, in read File "site-packages\calibre\utils\zipfile.py", line 1027, in open File "site-packages\calibre\utils\zipfile.py", line 989, in getinfo KeyError: u"There is no item named 'OPS/advanced.opf' in the archive" Added 銀魂 モノクロ版 1 to db in: 1.5 Added 1 books in 5.2 seconds

ElleKayEm commented 3 years ago

Hmm, similar to Obok. The log says it's decrypted, but then the same error:

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

I think @apprenticeharper or someone else who knows more about this than me will need to take a look at it.

fmdmf commented 3 years ago

Okay. Thank you for your help. Should I send them a message?

ElleKayEm commented 3 years ago

You can reach Apprentice Harper at apprenticeharper@gmail.com.

fmdmf commented 3 years ago

Thanks. I'll send them an e-mail.

ElleKayEm commented 3 years ago

@fmdmf Did you ever get in touch with Harper on this?

fmdmf commented 3 years ago

@ElleKayEm Hi. Yes, I did, though unfortunately we only got so far as the steps we've already tried here. I haven't received a reply since then.

ElleKayEm commented 3 years ago

Ok, thanks. It looks like someone else has run into the same problem now.

fmdmf commented 3 years ago

Do you mean #1531 ?

Yes, it does look like a similar problem. I wonder if 'OPS/advanced.opf' is a file we're supposed to be getting from the Kobo desktop app, but for some reason we're not getting it. Perhaps there's a newer version of the app that withholds it?

ElleKayEm commented 3 years ago

The same file was missing from your Adobe DRM version of the book. Is this any sort of enhanced ebook - with embedded audio or something?

I'm still not having any issues with either Obok or decrypting the Adobe DRM epubs from Kobo myself.

fmdmf commented 3 years ago

No, there's no embedded audio. They do have a lot of images though, instead of pure text. But I don't think it would explain why it works for a few of the ebooks I got from Kobo but not others, since they're the same image-heavy wise. If it was the type of ebook that was the problem, it should have consistently failed to work on all of them, right?

ElleKayEm commented 3 years ago

I just don't know what 'OPS/advanced.opf' is. I haven't seen it before.

fmdmf commented 3 years ago

I'm not in any way knowledgeable about coding, but if this link is right, perhaps Kobo has changed the directory of their OPF file for some of their epubs or something?

ElleKayEm commented 3 years ago

I don't know. The .opf file I see in my recent Kobo purchases (or epubs from other sources) is content.opf in the OEBPS folder, and it contains what is described at that link. I'm able to decrypt these epubs without issue. What do see in the ones you can't decrypt? An epub is just a zip file. Make a copy and change the extension to zip to take a look.

fmdmf commented 3 years ago

Opening one of the books as a .zip file shows me a 'standard.opf' file in the OPS folder. There doesn't seem to be any other .opf file in there.

fmdmf commented 3 years ago

I'm comparing the Zip file contents of an ebook that Obok worked with and one it didn't:

The one that worked also has 'standard.opf', but it's located in an OEBPS folder. There is also an additional folder called 'text', with what seems to be xHTML files. The 'standard.opf' file for the one that couldn't be decrypted is in an OPS folder.

I'm not sure why one would have an additional folder full of xhtml files, when both are from Kobo and downloaded via ADE 2.0...?

ElleKayEm commented 3 years ago

For me, it's OEBPS/content.opf and the xhtml files are all in the OEBPS folder too.

fmdmf commented 3 years ago

Would it matter if it was OPS rather than OEBPS, do you think?

ElleKayEm commented 3 years ago

They seem to be interchangeable. So I don't know why OPS/advance.opf specifically is expected to be in these books that are having the issue.

fmdmf commented 3 years ago

I see. Hm. I'm not sure where we could find advanced.opf in the files. It could be that this .opf file is supposed to indicate the path to the xhtml files that must surely be somewhere in there, since they're not in a separate folder.

ElleKayEm commented 3 years ago

I just see xhtml files directly in the OEBPS folder in the couple books that I checked. But mine are mostly text, pretty ordinary epubs, as far as I can tell.

fmdmf commented 3 years ago

Yeah, it might be the image-heavy-ness of the books means that the directories are organized differently. In which case the plugin would need to account for the alternative pathway, perhaps. I don't think it's that the xhtml files are missing, because the books open just fine in Kobo and ADE, with contents menus and everything. I'm not sure where I would find the advanced.opf though.

ElleKayEm commented 3 years ago

Looking at another epub (not from Kobo) and it has text, images, and styles folders inside OEBPS. But searching for *.opf only turns up content.opf.

I just don't know enough about epub structure to know why this advance.opf is expected and apparently needed to complete decryption but doesn't seem to be there in the book that isn't working.

j-howell commented 3 years ago

I don't know about Kobo specifically, but in general there is no set directory structure or fixed OPF file name required in EPUB.

What is required is a folder named META-INF containing a file named container.xml. That file has a link to the OPF file. The OPF file in turn links to all of the other files that make up the content and resources of the book.

ElleKayEm commented 3 years ago

Ah, yes, that's what I see in my books. So if you edit the container.xml file, replace "OPS/advanced.opf" with the correct path for the OPF file, zip it back up, change the extension back to EPUB, then maybe you'll be able to decrypt it.

If that works, perhaps some fall back could be put in DeDRM and Obok to find the OPF file if the path in container.xml is wrong.

fmdmf commented 3 years ago

Opening up the container.xml file shows this:

<rootfile full-path="OPS/standard.opf" media-type="application/oebps-package+xml"/> <rootfile full-path="OPS/advanced.opf" media-type="application/oebps-package+xml"/>

So... is advanced.opf supposed to be in the OPS folder as well?

fmdmf commented 3 years ago

It would seem that simply deleting the code for "OPS/advanced.opf" results in not being able to open the book in Calibre. It gives the error "KeyError: "There is no item named 'META-INF/container.xml' in the archive""

j-howell commented 3 years ago

It would seem that simply deleting the code for "OPS/advanced.opf" results in not being able to open the book in Calibre. It gives the error "KeyError: "There is no item named 'META-INF/container.xml' in the archive""

As I wrote previously, the container.xml file is required. You can't just remove it.

<rootfile full-path="OPS/standard.opf" media-type="application/oebps-package+xml"/> <rootfile full-path="OPS/advanced.opf" media-type="application/oebps-package+xml"/>

In this case the path to the OPF file is "OPS/advanced.opf". So the file "advanced.opf" needs to be in the "OPF" folder for it to work.

ElleKayEm commented 3 years ago

The only OPF file in the book is standard.opf? What if you remove the second rootfile tag that points to the non-existent advance.opf and leave only the first? Or is that what you did?

fmdmf commented 3 years ago

Yes, the only OPF file is standard.opf.

And yes, I tried to remove the second rootfile tag that's pointing to advanced.opf, leaving only the one pointing to standard.opf, but that gave the resulting error. I only edited the container.xml file, I did not delete it, so I'm not sure why I got 'there is no item named container.xml' as an error.

ElleKayEm commented 3 years ago

Ok, I'm stumped.

fmdmf commented 3 years ago

:(

Thanks for trying to help though.

mikebond7583 commented 3 years ago

The obok plugin 7.1.0 is not working for me, either. I'm using calibre 5.12.0. This is the log I got with my KOBO e-reader plugged in. I never had any issues with the obok plugin until calibre 4.23 and the 6.8 version of the plugin. Thank you for any help.

DEBUG: 11.8 _store_completed - dialog cancelled Running Obok DeDRM v7.1.0 DEBUG: 12.8 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmpqm3wbhn8 DEBUG: 13.0 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in __getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte DEBUG: 255.5 Have a Kobo device connected connected DEBUG: 255.5 BEGIN Get Device Path DEBUG: 255.5 Root path of device: F:\ DEBUG: 255.5 END Get Device Path DEBUG: 255.5 KoboUtilities:get_device - self.device_path="F:\" DEBUG: 255.5 KoboUtilities:get_device - drive_info: {'main': {'location_code': 'main', 'last_library_uuid': None, 'calibre_version': '5.12.0', 'date_last_connected': '2021-03-01T17:36:01.297298+00:00', 'device_name': 'Kobo Aura H2O Edition 2', 'device_store_uuid': 'c7e20592-f2c8-4842-a5cf-664400feaf22', 'prefix': 'F:/'}} DEBUG: 255.5 migrate_library_config_if_required - start DEBUG: 255.5 get_library_config - library_config: {'SchemaVersion': 0.1, 'profiles': {'Default': {'customColumnOptions': {'currentReadingLocationColumn': '#pages', 'lastReadColumn': '', 'percentReadColumn': '', 'ratingColumn': 'rating'}, 'forDevice': 'c7e20592-f2c8-4842-a5cf-664400feaf22', 'profileName': 'Default', 'storeOptionsStore': {'storeOnConnect': True, 'promptToStore': True, 'storeIfMoreRecent': True, 'doNotStoreIfReopened': False}, 'updateOptionsStore': {'doEarlyFirmwareUpdate': False, 'doFirmwareUpdateCheck': False, 'firmwareUpdateCheckLastTime': 0}}}, 'readingPositionChangesStore': {'selectBooksInLibrary': True, 'updeateGoodreadsProgress': False}} DEBUG: 255.5 get_prefs - start - store_name='storeOptionsStore' DEBUG: 255.5 get_plugin_pref - start - store_name='commonOptionsStore', option='individualDeviceOptions' DEBUG: 255.5 get_prefs - start - store_name='backupOptionsStore' DEBUG: 255.5 get_prefs - start - store_name='updateOptionsStore' DEBUG: 255.5 rebuild_menus - self.supports_ratings=True, self.supports_tiles=True DEBUG: 255.5 KoboUtilities:set_toolbar_button_tooltip - start: text='None' DEBUG: 255.5 KoboUtilities:set_toolbar_button_tooltip - device connected. self.device.fwversion= (4, 26, 16704) DEBUG: 255.5 KoboUtilities:set_toolbar_button_tooltip - setting to text='Utilities to use with Kobo ereaders

Connected Device: Kobo Aura H2O Edition 2 Firmware version: 4.26.16704 Driver: KoboTouchExtended' DEBUG: 255.5 rebuild_menus - have device. Key 'A' for shortcut Apri la cartella contenente is already used by Aggiungi libri, ignoring DEBUG: 255.5 Have a Kobo device connected connected DEBUG: 255.5 BEGIN Get Device Path DEBUG: 255.5 Root path of device: F:\ DEBUG: 255.5 END Get Device Path DEBUG: 255.5 KoboUtilities:get_device - self.device_path="F:\" DEBUG: 255.5 KoboUtilities:get_device - drive_info: {'main': {'location_code': 'main', 'last_library_uuid': None, 'calibre_version': '5.12.0', 'date_last_connected': '2021-03-01T17:36:01.297298+00:00', 'device_name': 'Kobo Aura H2O Edition 2', 'device_store_uuid': 'c7e20592-f2c8-4842-a5cf-664400feaf22', 'prefix': 'F:/'}} DEBUG: 255.5 migrate_library_config_if_required - start DEBUG: 255.5 get_library_config - library_config: {'SchemaVersion': 0.1, 'profiles': {'Default': {'customColumnOptions': {'currentReadingLocationColumn': '#pages', 'lastReadColumn': '', 'percentReadColumn': '', 'ratingColumn': 'rating'}, 'forDevice': 'c7e20592-f2c8-4842-a5cf-664400feaf22', 'profileName': 'Default', 'storeOptionsStore': {'storeOnConnect': True, 'promptToStore': True, 'storeIfMoreRecent': True, 'doNotStoreIfReopened': False}, 'updateOptionsStore': {'doEarlyFirmwareUpdate': False, 'doFirmwareUpdateCheck': False, 'firmwareUpdateCheckLastTime': 0}}}, 'readingPositionChangesStore': {'selectBooksInLibrary': True, 'updeateGoodreadsProgress': False}} DEBUG: 255.5 get_prefs - start - store_name='storeOptionsStore' DEBUG: 255.5 get_plugin_pref - start - store_name='commonOptionsStore', option='individualDeviceOptions' DEBUG: 255.5 get_prefs - start - store_name='backupOptionsStore' DEBUG: 255.5 get_prefs - start - store_name='updateOptionsStore' DEBUG: 255.5 get_plugin_pref - start - store_name='commonOptionsStore', option='buttonActionLibrary' DEBUG: 255.5 toolbar_button_clicked - self.no_device_actions_map= ['Configure Driver', 'Switch between main and extended driver', 'Customize plugin', 'About KoboUtilities'] DEBUG: 255.5 menu_firmware_update_check - start DEBUG: 255.5 Delta since last update check: 1022 Running Obok DeDRM v7.1.0 DEBUG: 258.6 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmpa8ov28_x DEBUG: 258.8 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte Running Obok DeDRM v7.1.0 DEBUG: 328.1 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmpcggusdu6 DEBUG: 328.3 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in __getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte Running Obok DeDRM v7.1.0 DEBUG: 549.2 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmpf0x47v85 DEBUG: 549.4 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte Traceback (most recent call last): File "calibre\gui2\ui.py", line 173, in load_store_plugins File "calibre\gui2\ui.py", line 185, in init_istore File "calibre\customize__init.py", line 713, in load_actual_plugin File "importlib__init.py", line 127, in import_module File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.bokus", line 23, in File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.lib.init__", line 11, in ModuleNotFoundError: No module named 'urlparse' Running Obok DeDRM v7.1.0 DEBUG: 577.9 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmp2h0u2y47 DEBUG: 578.2 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte Traceback (most recent call last): File "calibre\gui2\ui.py", line 173, in load_store_plugins File "calibre\gui2\ui.py", line 185, in init_istore File "calibre\customize__init.py", line 713, in load_actual_plugin File "importlib__init.py", line 127, in import_module File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.bokus", line 23, in File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.lib.init__", line 11, in ModuleNotFoundError: No module named 'urlparse' Running Obok DeDRM v7.1.0 DEBUG: 616.5 get_device_settings - device_path= F:\ Obok v4.0.0 Copyright © 2012-2020 Physisticated et al. C:\Users\mbond\AppData\Local\Temp\tmp3fe15wv3 DEBUG: 616.7 got kobodir F:.kobo Trouble retrieving keys with newer obok method. Traceback (most recent call last): File "calibre_plugins.obok_dedrm.action", line 121, in launchObok File "calibre_plugins.obok_dedrm.obok.obok", line 440, in userkeys File "calibre_plugins.obok_dedrm.obok.obok", line 475, in getmacaddrs File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 44: invalid start byte Traceback (most recent call last): File "calibre\gui2\ui.py", line 173, in load_store_plugins File "calibre\gui2\ui.py", line 185, in init_istore File "calibre\customize__init.py", line 713, in load_actual_plugin File "importlib\init.py", line 127, in import_module File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.bokus", line 23, in File "calibre\customize\zipplugin.py", line 192, in exec_module File "calibre_plugins.lbschenkel_store_bokus_se.lib.init__", line 11, in ModuleNotFoundError: No module named 'urlparse'

ElleKayEm commented 3 years ago

@mikebond7583 This looks like a different issue. I'm seeing this in the log:

Trouble retrieving keys with newer obok method.

Looks like a fix might be here: https://github.com/apprenticeharper/DeDRM_tools/issues/840#issuecomment-784353941

As a workaround, you could use Adobe Digital Editions and DeDRM.

mikebond7583 commented 3 years ago

@ElleKayEm thank you for your reply. I have followed the advice given on the page you provided, but the plugin is still not working. I now get this message: calibre, version 5.12.0 ERRORE: Obok DeDRM v7.1.0:

Could not find Kobo Library

Windows/Mac: do you have Kobo Desktop installed?

Windows/Mac/Linux: In case you have an Kobo eInk device, connect the device. I have Kobo Desktop installed and running, and I have also connected my Kobo e-reader. Right now, after clicking on "Ok" in the error window above, I have got another error message: calibre, version 5.12.0 ERRORE: Errore: Errore di comunicazione col dispositivo ("Failed to communicate with the device") BusyError: database is locked Traceback (most recent call last): File "calibre\gui2\device.py", line 89, in run File "calibre\gui2\device.py", line 512, in _books File "calibre\devices\kobo\driver.py", line 1872, in books File "calibre\devices\kobo\driver.py", line 192, in get_database_version apsw.BusyError: BusyError: database is locked I think I will wait until an updated version is released that will hopefully fix this issue, I know I can use Adobe Digital Editions and the DeDRM plugin. That's what I'll have to do...

ElleKayEm commented 3 years ago

@mikebond7583 Ugh, sorry about that. There is a pull request for an Obok fix so maybe if that gets merged into the next release.

Meanwhile I just checked with calibre 5.12 and Obok 7.1.0 on Windows 10. Things worked for me with a book from Kobo Desktop and then with another one from my Kobo Forma. I usually just download the ADE epubs, but I wasn't having any issues with calibre 4.23 and the Obok included with the 6.8 tools last I checked either. I know that there have been a few reports of various problems with Kobo/Obok lately though.

fmdmf commented 3 years ago

Hello! I'm back because I see there's a new release. Has anyone managed to get it to work with Kobo books?

I tried importing one of the epubs you get from ADE into Calibre (with the new 7.2 plugin) but got a 'your book is not an Adobe Adept book' error.

fmdmf commented 3 years ago

Trying to use the new Obok plugin still seems to give me the

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

error that I got before.

ElleKayEm commented 3 years ago

DeDRM 7.2.1 works for me with Kobo's ADE epubs. Obok 7.2.1 did not work for me with Kobo Desktop on Windows 10. I went back to Obok 7.1.0.

Sonny-Bonds commented 3 years ago

Ok, I've run into this one now as well - I've always been able to use ADE, but ran in to a few instances where that no longer works. I think the way recent Kobo Desktop versions populates data has changed - it no longer seems to populate the table content_keys which the obok plugin relies heavily on and why the plugin is no longer working.

Kobo Desktop version: 4.26.14705

fmdmf commented 3 years ago

Yes, I still have no luck. I am noticing now that Kobo Desktop App is requiring me to update it (which I haven't yet done) - perhaps they've changed something?

ElleKayEm commented 3 years ago

Obok 7.1.0 still working for me with Kobo Desktop 4.26.14705.

fmdmf commented 3 years ago

This might be a dumb question, but how are you confirming the version of your Kobo Desktop app?

ElleKayEm commented 3 years ago

Click the gear in the upper right and then "About Kobo Desktop".

fmdmf commented 3 years ago

Huh. The app doesn't actually allow me to click anything except 'update' when it starts up. :(