apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.56k stars 1.52k forks source link

Obok DeDRM could not find kobo library #2164

Open fly2summer opened 2 years ago

fly2summer commented 2 years ago

when i use calibre4.23.0 and obok6.5.4, everthing is ok. but when i use calibre6.7.1 and obok10.0.3, it said

"calibre, version 6.7.1 错误: Obok DeDRM v10.0.3:

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." ApplicationPaletteChange event ignored Using calibre Qt style: True ApplicationPaletteChange event received calibre 调试日志 calibre 6.7.1 embedded-python: True Windows-10-10.0.19044-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19044') Python 3.10.1 Windows: ('10', '10.0.19044', 'SP0', 'Multiprocessor Free') Interface language: zh_CN Successfully initialized third party plugins: DeDRM (10, 0, 3) && Kobo Books (1, 9, 2) && KoboTouchExtended (3, 6, 3) && Obok DeDRM (10, 0, 3) calibre 6.7.1 embedded-python: True Windows-10-10.0.19044-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19044') Python 3.10.1 Windows: ('10', '10.0.19044', 'SP0', 'Multiprocessor Free') Interface language: zh_CN Successfully initialized third party plugins: DeDRM (10, 0, 3) && Kobo Books (1, 9, 2) && KoboTouchExtended (3, 6, 3) && Obok DeDRM (10, 0, 3) QPA platform: windows devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 112.28608414239481 x 112.75838150289016 [0.00] Starting up... [0.00] Showing splash screen... [0.73] splash screen shown [0.73] Initializing db... [0.73] db initialized [0.73] 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 Key '' for shortcut Book list header menu is already used by Manage categories, ignoring [1.52] main UI initialized... [1.52] Hiding splash screen Starting QuickView

ElleKayEm commented 2 years ago

Were they all on the same machine and user? If so, I don't know why it wouldn't find it automatically. But you can set Kobo's directory in Obok. Preferences > Plugins > select Obok DeDRM (under User interface action) > Kobo directory

In Windows, it should be here: C:\Users\USERNAME\AppData\Local\Kobo\Kobo Desktop Edition\kepub

fly2summer commented 2 years ago

yes, they all on the same machine and user. i set Kobo's directory in Obok ,but it still said can't find kobo library. so weird... so i back to calibre4.23.0 and obok6.5.4 .......... anyway, thank u!!

ElleKayEm commented 2 years ago

Very odd. I'm able to use Obok 10.0.3 with calibre 6.7.1 on Windows 10 without issue.

odu14ick commented 1 week ago

Hey, just a hunch, since I have this same message appear. What do you set your Kobo directory to?

I used to have it set to /Users/{my_user}/Library/Application Support/Kobo/Kobo Desktop Edition/kepub on my Mac. This is the directory where the actual books are stored.

It's probably documented, but I only figured it out after reading the code: https://github.com/apprenticeharper/DeDRM_tools/blob/776f146ca00d11b24575f4fd6e8202df30a2b7ea/Other_Tools/Kobo/obok.py#L365-L367

this part here searches your set Kobo directory for the presense of Kobo.sqlite database, in my case it's located one level above, at /Users/{my_user}/Library/Application Support/Kobo/Kobo Desktop Edition. After setting that as a directory my issue was resolved.

Furthermore looking at the debug you've provided, I think you need to make it slightly more precise. Can I suggest you run Calibre in debug mode? In my case (M1 Mac) it's possible by running a Terminal commad: /Applications/calibre.app/Contents/MacOS/calibre-debug -g. This then opens Calibre and also outputs whatever is configured to be output in the code to the Terminal. In my case it used to output: got kobodir whith no dir listed, this is how I got a hunch on where exactly in the code I need to look to get what went wrong.

Hope it helps.