Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-19-2024, 05:27 PM   #1771
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 479
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by theducks View Post
It is a Calibre Tweak
ID: save_original_format

When calibre does a conversion from the same format to the same format, for example, from EPUB to EPUB, the original file is saved, so that in case the conversion is poor, you can tweak the settings and run it again. By setting this to False you can prevent calibre from saving the original file. Similarly, by setting save_original_format_when_polishing to False you can prevent calibre from saving the original file when polishing.
Setting both to False worked.

foosion is offline   Reply With Quote
Old 03-23-2025, 09:49 PM   #1772
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I think I've complained about the before but when Remove non-DC metadata elements is checked, the DC Modified item is removed. It is the only mandatory for ePub3 property that does not start with <dc: but it's an annoyance having to restore it.

Code:
<meta property="dcterms:modified">2025-03-23T18:40:12Z</meta>
DNSB is offline   Reply With Quote
Old 03-24-2025, 12:30 AM   #1773
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by DNSB View Post
I think I've complained about the before but when Remove non-DC metadata elements is checked, the DC Modified item is removed. It is the only mandatory for ePub3 property that does not start with <dc: but it's an annoyance having to restore it.

Code:
<meta property="dcterms:modified">2025-03-23T18:40:12Z</meta>
This isn't a plugin I use personally beyond a couple of most basic features once in a blue moon, and certainly not a niche feature intended for book publishers like this one.

Obviously ePub3 didn't exist back in 2011 when this plugin feature was written. To change this will require not just a change in this plugin, but also a change to the Quality Check plugin to make it skip this attribute.

It shouldn't be a majorly difficult change (I hope), will put it on the list.
kiwidude is offline   Reply With Quote
Old 03-24-2025, 01:17 AM   #1774
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Modify ePub v1.8.6

Release Notes
https://github.com/kiwidude68/calibr...fy_epub-v1.8.6

I still need to make the matching change to Quality Check later...
kiwidude is offline   Reply With Quote
Old 03-24-2025, 06:04 PM   #1775
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by kiwidude View Post
This isn't a plugin I use personally beyond a couple of most basic features once in a blue moon, and certainly not a niche feature intended for book publishers like this one.

Obviously ePub3 didn't exist back in 2011 when this plugin feature was written. To change this will require not just a change in this plugin, but also a change to the Quality Check plugin to make it skip this attribute.

It shouldn't be a majorly difficult change (I hope), will put it on the list.
I've been using that feature to remove the mass of useless information that some self-published epubs seem to have—an .opf file that runs over 3000 lines is ridiculous. Sigil and calibre's ebook-editor will fix that issue automatically by inserting a line with the current modified date but I would prefer to maintain the original modified date.

Thanks for the change!
DNSB is offline   Reply With Quote
Old 03-24-2025, 07:58 PM   #1776
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Got around to doing more testing with the updated plugin and it spits out an error message when I attempt to modify more that one file at a time. My test was with 3 files and got the error message after clicking Yes to replace the versions in the library (the log file prior to clicking yes did not show any errors). Doing those 3 files one at a time did not generate the error message.

Code:
calibre, version 8.0.1
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'update_last_modified'
...
Traceback (most recent call last):
  File "calibre_plugins.modify_epub.dialogs", line 291, in do_book_check
  File "calibre_plugins.modify_epub.dialogs", line 310, in do_close
AttributeError: 'NoneType' object has no attribute 'update_last_modified'
DNSB is offline   Reply With Quote
Old 03-24-2025, 11:44 PM   #1777
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@DNSB - that isn't something I have been able to replicate, nor does it look in any way related to the change I made. That error message looks like somehow the plugin dialog has been unable to find the current database object. TBH I haven't even seen the prompt for so long (I have it turned off in configuration options for that plugin), but I selected 3 books, did an add/replace cover, and it all worked fine.

Is it only on specific Modify ePub options being ticked? In which case there must be more error messages or log somewhere, PM me the full log.
kiwidude is offline   Reply With Quote
Old 03-25-2025, 07:47 PM   #1778
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Getting rather weird. It only happened on my Intake library. So I created a new library copying the structure of the Intake library and copied the contents of my Intake library there. After the copy, I could happily Modify ePub the contents of Intake2 without getting the error message after clicking on yes. I then deleted the original Intake library, created a new one after deleting the contents of the Intake directory, copied everything back from the Intake2 library and no issues running Modify ePub.

When I was playing with my original Intake library after moving the contents to Intake2, I copied 5 files from my Main library and they came up with the same error message. So something in the library or it's structure caused the issue but, as the old sign I had above my desk at work said, We don't believe in miracles, we just depend on them.

I've attached my Modify ePub configuratin screen and the calibre debug error logs. Once again, thanks for your help and feedback.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-03-25 160621.png
Views:	125
Size:	60.7 KB
ID:	214651  
Attached Files
File Type: zip Modify_epub_error_log.zip (3.0 KB, 80 views)
DNSB is offline   Reply With Quote
Old Yesterday, 03:35 AM   #1779
VapidRapidReader
Junior Member
VapidRapidReader began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2010
Device: Boox Leaf
I had this error since upgrading to Calibre 8.12:

Failed to modify ePubs: Failed: Modify ePubs version (1, 8, 6)

The error seems to come from:

ImportError: cannot import name 'RECOVER_PARSER' from 'calibre.ebooks.oeb.parse_utils' (C:\Program Files\Calibre2\app\bin\python-lib.bypy.frozen\calibre\ebooks\oeb\parse_utils.pyc )

I tried both jointly and separately to replace a cover and update metadata. This occurs if I try a single book or a group.
Attached Files
File Type: zip Debug.zip (1.6 KB, 5 views)
VapidRapidReader is offline   Reply With Quote
Old Yesterday, 03:42 AM   #1780
VapidRapidReader
Junior Member
VapidRapidReader began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2010
Device: Boox Leaf
From another thread:
Quote:
Originally Posted by kovidgoyal View Post
RECOVER_PARSER is gone because of bugs in lxml in windows, https://bugs.launchpad.net/lxml/+bug/2125756. I dont know why any plugins would have been using it, the correct way to parse html is to use the parse_html function from calibre.oeb.parse_utils. But if plugins want to parse html or xml using lxml directly, the relevant functions are safe_xml_fromstring and safe_html_fromstring from the calibre.utils.xml_parse module. And if they really, really want to use RECOVER_PARSER then can simply define it themselves as

Code:
from lxml import etree
RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True, resolve_entities=False)
Note that I strongly recommend against using RECOVER_PARSER as it is fundamentally broken thanks to the bug in lxml linked to above.
VapidRapidReader is offline   Reply With Quote
Old Yesterday, 03:45 AM   #1781
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 124
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
Yes, on upgrading to 8.12 from 8.11.1, I now get the same error.
Capricorn is offline   Reply With Quote
Old Yesterday, 04:55 AM   #1782
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,415
Karma: 150231975
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've modified Modify ePub to work with calibre 8.12. I've upped the version to 1.8.7. This is a beta version. Please report any errors.
Attached Files
File Type: zip Modify ePub.zip (302.7 KB, 14 views)

Last edited by JSWolf; Yesterday at 05:51 PM.
JSWolf is online now   Reply With Quote
Old Yesterday, 05:03 PM   #1783
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Please note the @JSWolf's modification to Modify Epub and Quality Check are iffy since they continue the use of lxml. A proper rewrite to use parse_html function is quite a bit more work.
DNSB is offline   Reply With Quote
Old Yesterday, 05:47 PM   #1784
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,415
Karma: 150231975
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
Please note the @JSWolf's modification to Modify Epub and Quality Check are iffy since they continue the use of lxml. A proper rewrite to use parse_html function is quite a bit more work.
My fixes are using the code that Kovid pasted. It gets the plugins working under 8.12. I have no idea if it's the best way to do it. At least they can be posted as working and then fixed the better way.
JSWolf is online now   Reply With Quote
Old Yesterday, 06:08 PM   #1785
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,616
Karma: 172313954
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
My fixes are using the code that Kovid pasted. It gets the plugins working under 8.12. I have no idea if it's the best way to do it. At least they can be posted as working and then fixed the better way.
The problem is that the same issues with lxml as mentioned in Kovid's bug report are still present in your modification that simply adds the direct RECOVER_PARSER definition (and adds a second instance of the "from lxml import etree" line. I looked at the parse_html documentation and examples and it's a lot more work than I am able or willing to do. Not to mention the need to test those changes.

Last edited by DNSB; Yesterday at 06:15 PM.
DNSB is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1267 Today 06:52 AM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 05:42 AM
[GUI Plugin] Manage Series kiwidude Plugins 167 07-28-2024 03:07 PM
Modify ePub plugin dev thread kiwidude Development 346 09-02-2013 05:14 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 07:00 AM.


MobileRead.com is a privately owned, operated and funded community.