apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.53k stars 1.51k forks source link

DeDRM_Plugin.zip doesn't work with Calibre 5.01 #1253

Open noversioncontrol opened 4 years ago

noversioncontrol commented 4 years ago

DeDRM_Plugin.zip doesn't load/work with Calibre 5.01. Calibre Library 5.x switched to using python 3 and the plugin no longer shows up. If I roll back to Calibre 4.23 then the plugin shows up and loads fine.

https://calibre-ebook.com/whats-new

ElleKayEm commented 3 years ago

@fubar66 Go to the main page of this repo. Click the green Code button. Choose download zip. Unzip that and either run make_release.py or zip up the contents of the DeDRM_Plugin folder. But I strongly suggest just using DeDRM 6.8 (with calibre 4.23) until 7 is officially released.

ableeker commented 3 years ago

If somebody would like to try to decrypt ePubs, you can get the current master. However, before you create the plugin, you'll have to change 1 line in file ineptepub.py to make it work with Calibre 5, and Python 3.

Open file ineptepub.py in folder DeDRM_plugin in a text editor and find line 314. Change it from: return long(total) To: return total Zip the files in the folder DeDRM_plugin, making sure all files are in the root of the zip, NOT in a sub folder. Load the zip in Calibre.

SkyyKorat commented 3 years ago

I apologize in advance, ‘cause I have absolutely NO idea what I'm doing at this point...

I’m using Calibre 5.6 on Windows 10 Pro. I WAS (I think) using DeDRM 6.6.1 or 6.7. It has ALWAYS WORKED PERFECTLY. I’m pretty sure I’ve added at LEAST one book I bought to Calibre since September, and had no problem removing the DRM so I could put it on the tablet and read it.

Today I bought a book, put it in Calibre and Got an error. Went out and downloaded 6.8.1 and tried to install it exactly the way I always have and got: calibre, version 5.6.0 ERROR: Unhandled exception: SyntaxError:invalid syntax (calibre_plugins.dedrm.init, line 169)

calibre 5.6 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: None Successfully initialized third party plugins: Traceback (most recent call last): File "calibre\gui2\preferences\plugins.py", line 317, in add_plugin File "calibre\customize\ui.py", line 472, in add_plugin File "calibre\customize\ui.py", line 61, in load_plugin File "calibre\customize\zipplugin.py", line 293, in load 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 185, in exec_module File "calibre\customize\zipplugin.py", line 181, in get_code File "calibre_plugins.dedrm.init", line 169 print u"{0} v{1}: Copying needed library files from plugin's zip".format(PLUGIN_NAME, PLUGIN_VERSION) ^ SyntaxError: invalid syntax

I found this discussion and looked through the whole thing, but it may as well be hieroglyphics. I found a bunch of “it works this way”, “no it doesn’t” and “now it works this way”…

I ran Calibre in debug mode and got a whole FILE of gibberish that didn’t tell me anything.

I’m not sure at this point how badly I’ve got everything screwed up. Whatever is in Calibre at the moment doesn’t work. All I want to do is get whatever I need in Calibre so I can get the DRM off the book and read it. Can someone provide simple, idiot-proof instructions?

ElleKayEm commented 3 years ago

@SkyyKorat Use calibre 4.23 and DeDRM 6.8.1.

SkyyKorat commented 3 years ago

Thanks... I'm still confused... I've been using 5.6 since it came out. And whatever version of the plugin - 6.6.1 maybe? And it worked FINE... What changed that it STOPPED working?

I can certainly go back to 4.23 as long as it doesn't do anything bad to the database, but why did the whole Calibre/plug-in I had quit?

ElleKayEm commented 3 years ago

DeDRM is still in the process of being re-written to Python 3 which is required for calibre 5.x. DeDRM 6.8.1 is in Python 2 and calibre 4.23 is the last version it works on. For calibre 5.x, you can try the beta DeDRM 7.0.0b4. But it is still a work in progress.

SkyyKorat commented 3 years ago

OK. I didn't have a copy of 4.23 handy but I had 4.3 so I put that on. It worked, and the book I added is now readable...
Thanks a lot...

But, I already had the new book in Calibre and when I tried to remove it, I got this: calibre, version 4.3.0 ERROR: Unhandled exception: SQLError:SQLError: no such module: fts5

calibre 4.3 embedded-python: True is64bit: False Windows-10-10.0.19041-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '10', '10.0.19041') Python 2.7.16+ Windows: ('10', '10.0.19041', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 8, 0) Traceback (most recent call last): File "site-packages\calibre\gui2\actions\delete.py", line 404, in delete_books File "site-packages\calibre\gui2\actions\delete.py", line 378, in do_library_delete File "site-packages\calibre\gui2\library\models.py", line 416, in delete_books_by_id File "site-packages\calibre\db\cache.py", line 62, in call_func_with_lock File "site-packages\calibre\db\cache.py", line 1647, in remove_books File "site-packages\calibre\db\backend.py", line 1676, in remove_books File "site-packages\calibre\db\backend.py", line 886, in executemany File "c:\t\t\apsw-nhrdandw\src\cursor.c", line 1136, in APSWCursor_executemany.sqlite3_prepare File "c:\t\t\apsw-nhrdandw\src\statementcache.c", line 386, in sqlite3_prepare SQLError: SQLError: no such module: fts5

I renamed the old book, created an empty book and put the book back in so that part is working. But how do I get rid of the earlier copy? fts5?

ElleKayEm commented 3 years ago

Your database from calibre 5 is probably not compatible with that much older of a version of calibre. Here is calibre 4.23.

JSWolf commented 3 years ago

You can stick with Calibre 5.x as DeDRM 7.0.0b4 is working with Mobi, KF8, and ePub. It does not work with PDF and I do not know what else doesn't work. But given that I only remove the DRM from ePub, KF8, and Mobi, I'm OK. If you are on Windows, you can install the Calibre 4.23 portable version and run that when you need to use DeDRM 6.8.1.

Give that you've used Calibre 5.x, if you do want to use an older Calibre, you have to use 4.23 as that's the only pre-5 version that is compatible with the changed database from version 5.

lnxme commented 3 years ago

OK. I didn't have a copy of 4.23 handy but I had 4.3 so I put that on. It worked, and the book I added is now readable... Thanks a lot...

You can find all the variants of Calibre 4.23 at https://download.calibre-ebook.com/4.23.0/

SkyyKorat commented 3 years ago

I know y'all are helping and I appreciate it, but I'm getting whiplash......... I put 4.3 on, 'cause I didn't have a handy 4.23 (I know where they are, I was just too lazy to go get 4.23 since I had 4.3 sitting here)... If the error is due to the V5 database and 4.3 gets the error, isn't 4.23 ALSO going to get it? And as far as "sticking with 5.X, I STARTED with 5.X - I was running 5.6 and using plugin 6.6.1 or 6.7 and it WORKED PERFECTLY as recently as 11/29/2020. Nothing on the box related to Calibre changed between then and 12/20 when it DIDN'T work. I tried to SWITCH to 6.8.1 at that point and things continued NOT to work... So I went BACK to 4.3.
If I go out and get 4.23.0 is THAT version going to work with the database I have and the plugin - which though it came from a zip file that says 6.8.1 insists that it's 6.8.0 when I look at it. Which version of which thing do I need so everything works normally if that's possible at this point? If not, I can live without being able to remove books for a while I think. I'll just rename them to something that I'll know should be removed when I CAN remove them, whenever that is.

ElleKayEm commented 3 years ago

Calibre 4.23 is the last version before 5. Its database is reportedly compatible with calibre 5. Calibre 5 does not work with any version of DeDRM except the beta DeDRM 7 pre-releases (latest version is 7.0.0b4). If you had updated calibre past 4.23 and still had DeDRM 6.x, the only way it could have "worked" was if the book was already DRM-free.

Either use calibre 5.x and DeDRM 7.0.0b4. Or calibre 4.23 and DeDRM 6.8.1. Just be aware that not everything is working properly yet with DeDRM 7. I don't know if both or neither will resolve the problem of being unable to delete books after using calibre 4.3. If not, ask over at the calibre forum at MobileRead. That is not a DeDRM issue.

SkyyKorat commented 3 years ago

That was MY mistake... I got so fixated on the Calibre/DRM version weirdness that I completely lost sight of the fact that the error I got when deleting had NOTHING to do with DRM... I presume it's a Calibre version vs database version thing... I'll have to try again to find the DRM topic over there. When I looked before coming here I couldn't find it in the Calibre section.

So if I'm understanding you, I can put 5.X on. In my case it'll be 5.6 since that's what I had working previously. And I'll put DeDRM 7.0.0b4 on and see...

SkyyKorat commented 3 years ago

OK! Everybody has been happily working for the last week... Calibre 5.6, the version of DRM stuff that works with it. Books go in, books are readable, DRM sits there quietly and doesn't annoy the horses, all is normal, quiet, and BORING... I LIKE boring. I'm planning on never doing another update!

Thanks for the help.