apprenticeharper / DeDRM_tools

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

Suggestion: add "on_preprocess=True" in its __init__.py to make plugin usable in conversion #519

Closed fireattack closed 4 years ago

fireattack commented 6 years ago

This is just suggestion, but I was wondering if it's possible to add on_preprocess=True in __init__.py of the calibre plugin (per API documentation), so it will also be called when users are converting a book (instead only when adding book to calibre DB).

It will help with the Calibre's CLI tool ebook-convert.exe, make it be able to convert encrypted book directly to other formats. I have tried to modify __init__.py myself and it does work. It doesn't appear to have side effect (such as when converting a no-DRM azw3 book) either.

You can see previous discussion about it here (on MobileRead).

Thanks!

ElleKayEm commented 6 years ago

So does it leave the original format with DRM?

fireattack commented 6 years ago

If you mean the CLI tool ebook-convert.exe, it won't modify your input file in anyway.

apprenticeharper commented 6 years ago

Support is hard enough without allowing people to import DRMed ebooks into calibre and then removing DRM on the fly when converting.

If you're happy doing command-line stuff, then feel free to keep tweaking things. But I'd need some really strong arguments to include this change in the release.

fireattack commented 6 years ago

Just some clarification: I think that scenario will still be the same as now: assuming the plugin would be able to deDRM during both importing and converting, books will still be deDRMed when importing. So, "import DRMed ebooks into calibre" isn't really going to happen under normal usage.

But besides that, I have no strong argument, as I said it's just a suggestion for consideration. I understand supporting additional features will always be troublesome (and I appreciate your hard work either way).

fireattack commented 4 years ago

Fixed by #1241 :+1: