-
Notifications
You must be signed in to change notification settings - Fork 420
Activity
I've seen some people report that Obok included with DeDRM 6.8.1 installed in calibre 4.23 will work when the current versions fail.
I've seen some people report that Obok included with DeDRM 6.8.1 installed in calibre 4.23 will work when the current versions fail.
can you explain in more detail the required setup for that optional fix? Assume I'm totally new to this topic.
I personally have no trouble with the current versions. But you would install calibre 4.23.
https://download.calibre-ebook.com/4.23.0/
And the Obok which works with that is in DeDRM release 6.8.1.
https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.8.1
Then you would use Obok to import from Kobo Desktop (or a Kobo ereader) as usual.
If you have the current versions of calibre and regular DeDRM setup and working for another type of DRM, then do this in a different user. Or you could try calibre portable to have two versions of calibre in the same Windows user.
I make no promises of this working. I find it very odd that older versions work for some and the current versions are fine for others.
I personally have no trouble with the current versions. But you would install calibre 4.23. https://download.calibre-ebook.com/4.23.0/ And the Obok which works with that is in DeDRM release 6.8.1. https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.8.1 Then you would use Obok to import from Kobo Desktop (or a Kobo ereader) as usual.
If you have the current versions of calibre and regular DeDRM setup and working for another type of DRM, then do this in a different user. Or you could try calibre portable to have two versions of calibre in the same Windows user.
I make no promises of this working. I find it very odd that older versions work for some and the current versions are fine for others.
It worked.Thank you
I personally have no trouble with the current versions. But you would install calibre 4.23. https://download.calibre-ebook.com/4.23.0/ And the Obok which works with that is in DeDRM release 6.8.1. https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.8.1 Then you would use Obok to import from Kobo Desktop (or a Kobo ereader) as usual.
If you have the current versions of calibre and regular DeDRM setup and working for another type of DRM, then do this in a different user. Or you could try calibre portable to have two versions of calibre in the same Windows user.
I make no promises of this working. I find it very odd that older versions work for some and the current versions are fine for others.
that setup worked for me too
Thanks to both of you for reporting back. Seems like some bug may have gotten into later versions. Maybe the current versions still work for me because I updated from the older versions.
It seems that obok may fail to decrypt on non-English Windows systems. Getting the MAC address via ipconfig can fail due to encoding differences, and the fallback using wmic does not return virtual adapters. As a result, decryption will fail if a virtual adapter’s address was used.
This can be fixed by adding errors='ignore' when decoding the command output. To apply this fix when using the latest version of calibre with obok, the obok.py file included in the plugin can be updated as follows:
def __getmacaddrs (self):
"""The list of all MAC addresses on this machine."""
macaddrs = []
if sys.platform.startswith('win'):
c = re.compile(r'\s?(' + '[0-9a-f]{2}[:-]' * 5 + r'[0-9a-f]{2})(\s|$)', re.IGNORECASE)
output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True, errors='ignore').stdout
for line in output:
m = c.search(line)
if m:
macaddrs.append(re.sub("-", ":", m.group(1)).upper())
elif sys.platform.startswith('darwin'):It seems that obok may fail to decrypt on non-English Windows systems. Getting the MAC address via ipconfig can fail due to encoding differences, and the fallback using wmic does not return virtual adapters. As a result, decryption will fail if a virtual adapter’s address was used.
This can be fixed by adding errors='ignore' when decoding the command output. To apply this fix when using the latest version of calibre with obok, the obok.py file included in the plugin can be updated as follows:
def __getmacaddrs (self): """The list of all MAC addresses on this machine.""" macaddrs = [] if sys.platform.startswith('win'): c = re.compile(r'\s?(' + '[0-9a-f]{2}[:-]' * 5 + r'[0-9a-f]{2})(\s|$)', re.IGNORECASE) output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True, errors='ignore').stdout for line in output: m = c.search(line) if m: macaddrs.append(re.sub("-", ":", m.group(1)).upper()) elif sys.platform.startswith('darwin'):
So, basically, it gets solved just by removing the try except part?
@MrYod No, the necessary fix is this single line:
- output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True).stdout
+ output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True, errors='ignore').stdoutThe fallback in the except block doesn’t affect the behavior, so it doesn’t need to be removed. However, since wmic is deprecated in recent versions of Windows, I would recommend removing it.
@poolboie Great: works perfectly. \^o^/🎉
Question / bug report
Hi
When I tried to remove drm,it said couldn‘t be decrypted
Which version of Calibre are you running?
8.16.2
Which version of the DeDRM plugin are you running?
v10.0.9
If applicable, which version of the Kindle software are you running?
No response
Log output