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

Unable to Remove DRM with Obok #1476

Open
fmdmf opened this issue Jan 11, 2021 · 70 comments
Open

Unable to Remove DRM with Obok #1476

fmdmf opened this issue Jan 11, 2021 · 70 comments

Comments

@fmdmf
Copy link

fmdmf commented Jan 11, 2021

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
Copy link

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
Copy link
Author

fmdmf commented Jan 11, 2021

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
Copy link

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
Copy link
Author

fmdmf commented Jan 12, 2021

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).

@fmdmf
Copy link
Author

fmdmf commented Jan 12, 2021

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\x08MYDIGI1\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 \x081BD101.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\DOCUME1\MYDIGI1\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
Copy link

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
Copy link
Author

fmdmf commented Jan 12, 2021

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

@ElleKayEm
Copy link

You can reach Apprentice Harper at [email protected].

@fmdmf
Copy link
Author

fmdmf commented Jan 12, 2021

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

@ElleKayEm
Copy link

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

@fmdmf
Copy link
Author

fmdmf commented Feb 16, 2021

@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
Copy link

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

@fmdmf
Copy link
Author

fmdmf commented Feb 17, 2021

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
Copy link

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
Copy link
Author

fmdmf commented Feb 17, 2021

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
Copy link

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

@fmdmf
Copy link
Author

fmdmf commented Feb 17, 2021

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
Copy link

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
Copy link
Author

fmdmf commented Feb 17, 2021

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
Copy link
Author

fmdmf commented Feb 17, 2021

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
Copy link

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

@fmdmf
Copy link
Author

fmdmf commented Feb 18, 2021

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

@ElleKayEm
Copy link

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
Copy link
Author

fmdmf commented Feb 18, 2021

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
Copy link

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
Copy link
Author

fmdmf commented Feb 19, 2021

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
Copy link

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
Copy link

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.

@fmdmf
Copy link
Author

fmdmf commented May 17, 2021

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
Copy link
Author

fmdmf commented May 17, 2021

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
Copy link

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
Copy link

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
Copy link
Author

fmdmf commented Jun 16, 2021

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
Copy link

Obok 7.1.0 still working for me with Kobo Desktop 4.26.14705.

@fmdmf
Copy link
Author

fmdmf commented Jun 16, 2021

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

@ElleKayEm
Copy link

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

@fmdmf
Copy link
Author

fmdmf commented Jun 17, 2021

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

@ElleKayEm
Copy link

Yeah, I don't know anyway to not update. So 4.26.14705 must be the latest. The "about" gives a date of 10 Feb 2021 for it.

@fmdmf
Copy link
Author

fmdmf commented Jun 17, 2021

I see. I suppose I will have to update it then. I'll try doing that and running the plugin again, to see if it works.

@caifara
Copy link

caifara commented Jun 19, 2021

No luck here with the following error:

calibre, version 5.21.0
ERROR: Unhandled exception: OperationalError:no such table: content_keys

calibre 5.21 embedded-python: True is64bit: True
macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '20.3.0', 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.16', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
Traceback (most recent call last):
File "calibre_plugins.obok_dedrm.action", line 108, in launchObok
books = self.build_book_list()
File "calibre_plugins.obok_dedrm.action", line 211, in build_book_list
return self.library.books
File "calibre_plugins.obok_dedrm.obok.obok", line 450, in books
for row in self.__cursor.execute('SELECT DISTINCT volumeid, Title, Attribution, Series FROM content_keys, content WHERE contentid = volumeid'):
sqlite3.OperationalError: no such table: content_keys

Also:

Kobo Desktop Edition 4.26.12741

@ElleKayEm
Copy link

Obok 7.2.1 wouldn't work for me. I had to go back to 7.1.0. I'm on Windows though.

@fmdmf
Copy link
Author

fmdmf commented Jul 11, 2021

Updated the Kobo Desktop App, but it seems Obok still doesn't work. It loads into Calibre's library, but the name of the book is gibberish and opening it gives an error.

Though there is a new development - if I try to run Obok on 64-bit Calibre 4.23.0, I get:

calibre, version 4.23.0
ERROR: Unhandled exception: ImportError:No module named winreg

Windows 10
Kobo Desktop Edition 4.28.15727

@ElleKayEm
Copy link

For calibre 4.23, you need the Obok from 6.8.1. If you update to calibre 5.x and the current Obok 7.2.1 doesn't work, give the one in this comment a try: #1718 (comment)

@fmdmf
Copy link
Author

fmdmf commented Jul 12, 2021

Ah, I see, so the new version still doesn't work with 4.23? I'll reinstall 6.8.1 then. Thanks for letting me know.

I uninstalled Obok 7.2.1 on Caliber 5.5 and installed the fix you linked. Unfortunately I'm getting the same results.

The error given when I try to open the file imported into Calibre (which still has no cover image or an intelligible name):

calibre, version 5.5.0
ERROR: Loading book failed: Failed to open the book at D:\CALIBRE\Unknown\4qt3wivk (714)\4qt3wivk - Unknown.epub. Click "Show details" for more info.

Failed to convert book: D:\CALIBRE\Unknown\4qt3wivk (714)\4qt3wivk - Unknown.epub with error:
DeDRM v7.2.1: Trying to decrypt 4qt3wivk - Unknown.epub
DeDRM v7.2.1: Verifying zip archive integrity
DeDRM v7.2.1: “4qt3wivk - Unknown.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub
InputFormatPlugin: EPUB Input running
on D:\CALIBRE\Unknown\4qt3wivk (714)\4qt3wivk - Unknown.epub
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Traceback (most recent call last):
File "calibre\customize\ui.py", line 428, in get_file_type_metadata
File "calibre\customize\builtins.py", line 194, in get_metadata
File "calibre\ebooks\metadata\epub.py", line 238, in get_quick_metadata
File "calibre\ebooks\metadata\epub.py", line 218, in get_metadata
File "calibre\ebooks\metadata\epub.py", line 156, in read_bytes
File "calibre\utils\zipfile.py", line 1006, in read
File "calibre\utils\zipfile.py", line 1034, in open
File "calibre\utils\zipfile.py", line 995, in getinfo
KeyError: "There is no item named 'OPS/advanced.opf' in the archive"
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
File "calibre\customize\ui.py", line 172, in _run_filetype_plugins
File "calibre_plugins.dedrm.init", line 644, in run
File "calibre_plugins.dedrm.init", line 420, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Couldn't decrypt after 7.7 seconds. DRM free perhaps?
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "site.py", line 82, in
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\utils\ipc\worker.py", line 195, in main
File "", line 1, in
File "calibre\srv\render_book.py", line 865, in viewer_main
File "calibre\srv\render_book.py", line 856, in render_for_viewer
File "calibre\srv\render_book.py", line 834, in render
File "calibre\srv\render_book.py", line 649, in process_exploded_book
File "calibre\srv\render_book.py", line 333, in create_cover_page
File "calibre\srv\render_book.py", line 286, in find_epub_cover
File "calibre\ebooks\oeb\polish\cover.py", line 287, in find_cover_image_in_page
File "src/lxml/xpath.pxi", line 430, in lxml.etree.XPath.call
File "src/lxml/apihelpers.pxi", line 41, in lxml.etree._documentOrRaise
TypeError: Invalid input object: bytes

@ElleKayEm
Copy link

The current version of Obok is Python 3 and isn't going to work with calibre 4.23 which is Python 2.

Let's see a log of importing the book with Obok.

All we see here is DeDRM which is for Adobe DRM, not Kobo's.

@fmdmf
Copy link
Author

fmdmf commented Jul 13, 2021

Odd. I used the Obok icon when I imported it.

Here is the log, using Calibre 5 and the Obok plugin:

FFF: INFO: 2021-07-14 03:50:07,890: calibre_plugins.fanficfare_plugin.prefs(215): Attempting to read settings from predecessor--FFDL
FFF: INFO: 2021-07-14 03:50:07,890: calibre_plugins.fanficfare_plugin.prefs(220): Using default settings
FFF: DEBUG: 2021-07-14 03:50:07,902: calibre_plugins.fanficfare_plugin.fff_plugin(221): Plugin FanFicFare macmenuhack file_path:C:\Users\user\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt
calibre Debug log
calibre 5.5 embedded-python: True is64bit: False
Windows-10-10.0.19041 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: DeDRM (7, 2, 1) && FanFicFare (3, 27, 0) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 2, 12) && Obok DeDRM (7, 2, 1)
calibre 5.5 embedded-python: True is64bit: False
Windows-10-10.0.19041 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: DeDRM (7, 2, 1) && FanFicFare (3, 27, 0) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 2, 12) && Obok DeDRM (7, 2, 1)
Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 120.0 x 120.0
physicalDpi: 117.58408679927668 x 117.60771704180064
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.66] splash screen shown
[0.66] Initializing db...
[0.66] db initialized
[0.66] 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
Loaded cached store plugin for: Amazon FR Kindle at version: 16
Loaded cached store plugin for: Nexto at version: 6
[2.38] main UI initialized...
[2.38] Hiding splash screen
Starting QuickView
Traceback (most recent call last):
File "calibre\customize\ui.py", line 428, in get_file_type_metadata
File "calibre\customize\builtins.py", line 195, in get_metadata
File "calibre\ebooks\metadata\epub.py", line 218, in get_metadata
File "calibre\ebooks\metadata\epub.py", line 156, in read_bytes
File "calibre\utils\zipfile.py", line 1006, in read
File "calibre\utils\zipfile.py", line 1034, in open
File "calibre\utils\zipfile.py", line 995, in getinfo
KeyError: "There is no item named 'OPS/advanced.opf' in the archive"
[9.78] splash screen hidden
[9.78] Started up in 9.78 seconds with 37 books
Running Obok DeDRM v7.2.1
DEBUG: 9.2 didn't find device
Obok v4.0.0
Copyright © 2012-2020 Physisticated et al.
C:\Users\user\AppData\Local\Temp\tmp2gwfh0c7
DEBUG: 9.3 got kobodir C:\Users\user\AppData\Local\Kobo\Kobo Desktop Edition
Found 24 possible keys to try.
DEBUG: 15.5 BookListTableWidget:get_books - book_num: 80
DEBUG: 15.5 BookListTableWidget:get_books - book: 銀魂公式ファンブック 広侍苑
DEBUG: 15.5 InterfacePluginAction::launchObok - number of books to decrypt: 1
Obok DeDRM v7.2.1 - Decrypting 銀魂公式ファンブック 広侍苑
Trying key: b'f5c3f23f6431ee08da5e738974b871f5'
Success!
DEBUG: 22.6 DecryptAddProgressDialog::do_book_action - decrypted book: '銀魂公式ファンブック 広侍苑'
Obok DeDRM v7.2.1 - Added 1m ufgxk
Obok DeDRM v7.2.1 - wrapping up results.

@ElleKayEm
Copy link

Is this regular Obok 7.2.1?

@fmdmf
Copy link
Author

fmdmf commented Jul 13, 2021

It should be the fix that you linked me in your earlier post.

@ElleKayEm
Copy link

Ok, here's another one. This was in response to someone whose book was also saying it was decrypted but wasn't. From the same thread, but different comment: #1718 (comment)

@fmdmf
Copy link
Author

fmdmf commented Jul 14, 2021

Thank you for the link. But it seems to be the same comment? (1718)

@ElleKayEm
Copy link

No, same thread (1718), earlier comment.

@fmdmf
Copy link
Author

fmdmf commented Jul 14, 2021

The one by ableeker?

@ElleKayEm
Copy link

I'll attach it here.
Obok_plugin.zip

@fmdmf
Copy link
Author

fmdmf commented Jul 14, 2021

Thank you. I uninstalled the plugin I had and installed this one. The problem persists.

@build6
Copy link

build6 commented Dec 9, 2021

I would like to report that Obok in the latest DeDRM 7.2.1 (with Calibre 5.3.2) is unable to remove DRM (the .epub produced is gibberish/not properly decrypted) BUT when I try with an older Calibre (4.23) with older Obok (6.7) it works fine. Some kind of regression

@ElleKayEm
Copy link

See reply here: #1960 (comment)

@build6
Copy link

build6 commented Dec 11, 2021

See reply here: #1960 (comment)

can confirm the newer version fixes the problem, thank you

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

7 participants