From 0a1991d8ad6b30026924993b9488afc2441cee9d Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 13 Mar 2023 18:59:52 +0800 Subject: [PATCH] Fix library of crypto for current Windows (#159) * Fix library of crypto for current Windows * Modify obok import statement Only import this module when necessary --------- Co-authored-by: Hsieh Chin Fan --- book_maker/cli.py | 3 ++- book_maker/obok.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/book_maker/cli.py b/book_maker/cli.py index 8314a09..4af379f 100644 --- a/book_maker/cli.py +++ b/book_maker/cli.py @@ -3,7 +3,6 @@ import json import os from os import environ as env -import book_maker.obok as obok from book_maker.loader import BOOK_LOADER_DICT from book_maker.translator import MODEL_DICT from book_maker.utils import LANGUAGES, TO_LANGUAGE_CODE @@ -190,6 +189,8 @@ def main(): OPENAI_API_KEY = "" if options.book_from == "kobo": + import book_maker.obok as obok + device_path = options.device_path if device_path is None: raise Exception( diff --git a/book_maker/obok.py b/book_maker/obok.py index 350def0..dd4eeb9 100644 --- a/book_maker/obok.py +++ b/book_maker/obok.py @@ -1,6 +1,9 @@ # The original code comes from: # https://github.com/apprenticeharper/DeDRM_tools +# Version 4.1.2 March 2023 +# Update library for crypto for current Windows + # Version 4.1.1 March 2023 # Make obok.py works as file selector @@ -161,7 +164,7 @@ """Manage all Kobo books, either encrypted or DRM-free.""" from __future__ import print_function -__version__ = "4.0.0" +__version__ = "4.1.2" __about__ = "Obok v{0}\nCopyright © 2012-2020 Physisticated et al.".format(__version__) import base64 @@ -211,7 +214,7 @@ def _load_crypto_libcrypto(): from ctypes.util import find_library if sys.platform.startswith("win"): - libcrypto = find_library("libeay32") + libcrypto = find_library("libcrypto") else: libcrypto = find_library("crypto")