Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-25-2015, 09:56 PM   #1
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
[Metadata Writer Plugin] KePub Metadata Writer

This plugin allows calibre to write metadata to KePub files being sent to your device. This plugin is required for calibre to update KePub metadata using a metadata plugboard and provides no benefit if you are not using metadata plugboards with KePub files.

Usage:
There is no setup or special usage for this plugin. Once installed, restart calibre and the plugin will automatically be invoked when required.

Special Notes:
This plugin requires calibre 3.42.0 or later.

Installation Directions
Open Preferences -> Plugins -> Get new plugins and install the 'KePub Metadata Writer' plugin. You may also download the attached zip file and install the plugin manually, then restart calibre as described in the Introduction to Plugins thread.

Version History

Spoiler:

Version 3.4.2 - 2021-01-05
Fix for non-English locales on Windows failing to load or install the plugin
Version 3.2.12 - 2020-06-22
Fixes from NiLuJe for writing metadata
Version 3.2.11 - 2020-06-20
Stop stripping whitespace from the left of each text chunk.
Version 3.2.10 - 2020-06-17
Fix from NiLuJe for more Unicode processing and some misplaced KEPubContainer references.
Version 3.2.9 - 2020-06-17
Fix issue with the logger object not being callable and the conversion adding stray <br> tags
Version 3.2.7 - 2020-05-16
Fix Windows issues with Unicode strings.
Version 3.2.2 - 2020-05-10
Python 3 compatibility - Plugin loads in both calibre and Python 3 calibre beta
Version 3.0.3 - 2017-12-31
Fix format string error in logging code
Version 3.0.2 - 2017-12-24
Call load_translations where there are translated strings
Version 3.0.0 - 2017-10-30
Imported to BitBucket, made small bugfix and formatting changes, new translations
Version 2.7.1 - 2016-06-27
Spanish translation update
Version 2.7.0 - 2016-06-25
Code cleanup from new driver code, no-op functionally
Version 2.5.5 - 2016-02-07
No, seriously, fix missing imports
Version 2.5.4 - 2016-02-06
Fix missing import for debug_print()
Version 2.5.3 - 2015-09-30
Fix problem preventing the cover image from being set properly with unusually-set OPF IDs
Version 2.5.1 - 2015-08-05
Fix issues with file names not being handled properly
Version 2.5.0 - 2015-08-03
Updated to set the cover image property in KePub metadata
Version 2.4.2 - 2015-06-15
Fix plugin name
Version 2.4.0 - 2015-05-25
Initial release. Version set to remain in sync with KoboTouchExtended.
Attached Files
File Type: zip KePub Metadata Writer.zip (24.4 KB, 60502 views)

Last edited by jgoguen; 01-05-2021 at 11:38 PM.
jgoguen is offline   Reply With Quote
Old 06-15-2015, 02:57 PM   #2
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
Whoops. The name of the plugin as defined on the plugin index is different from the name set in the plugin itself. I've fixed the name of the plugin and uploaded a new version.

Instead of upgrading the plugin, please remove the plugin, wait for the update, and install the new version. You're looking for plugin version 2.4.2, calibre should pick it up within the next hour or so.
jgoguen is offline   Reply With Quote
Advert
Old 06-28-2015, 03:47 AM   #3
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
Thank you. Works great with H2O connected directly via USB to Calibre. However, it does not apply the plugboard to kepub files downloaded from the content server. Plugboard is applied from content server when downloading an epub rather than a KEPub. An attempt to replace a general content server plugboard with one for just KEPub generates a message that KEPub is not supported by the content server. However, the content server does offer a button for kepub and of course allows the download of KEPub. Just fails to apply the plugboard.

Would appreciate you having a look at this when you get the chance.
darryl is offline   Reply With Quote
Old 06-28-2015, 10:17 AM   #4
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
Restart calibre in debug mode, reproduce the problem, and post the debug log here.
jgoguen is offline   Reply With Quote
Old 06-28-2015, 12:43 PM   #5
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
Thanks for the quick response. Here is the debug log requested.


Spoiler:
calibre Debug log
calibre 2.31 isfrozen: True is64bit: True
Linux-4.0.0-sabayon-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.2 Linux ('64bit', 'ELF')
('Linux', '4.0.0-sabayon', '#1 SMP Tue Jun 9 15:57:12 UTC 2015')
Python 2.7.9
Linux: ('Gentoo Base System', '2.2', '')
Successfully initialized third party plugins: DeDRM && Modify ePub && Find Duplicates && KePub Metadata Reader && KEPUB Input && KindleUnpack - The Plugin && KoboTouchExtended && KePub Metadata Writer && Kindle Collections && KePub Output
Starting up...
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Started up in 15.99 seconds with 8868 books
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Xlib: extension "GLX" missing on display ":0".
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Device using plugboard epub content_server [[u'{series_index:0>2s|| - }{title}', u'title']]


Unfortunately it seems to be totally unhelpful as it does not log any of the relevant content server activity. Whilst in debug mode I actually started the content server, connected from the Kobo browser and downloaded a kepub, which did not have the plugboard applied, and an epub, which did. I also tried to create a new plugboard for KEPub with the content server, which generated an on screen error message that the content server did not support KEPub.

I'm not sure if it is possible to get a log of the actual content server activity. Please let me know what further information I can provide which may be of help.

Thanks.
darryl is offline   Reply With Quote
Advert
Old 06-28-2015, 04:06 PM   #6
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
What's your plugboard configuration? I don't use the feature myself, I'd like to test with something that I know is working for someone else.
jgoguen is offline   Reply With Quote
Old 06-28-2015, 10:52 PM   #7
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
any format:content_server [[u'{series_index:0>2s|| - }{title}', u'title']]
darryl is offline   Reply With Quote
Old 06-29-2015, 10:34 AM   #8
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
OK, so the problem is entirely that the content server doesn't support KePub files. It offers the download link as an "other format", but that's it. If you try with any other format that's also not supported by the content server, it's exactly the same thing.

Curious, what's your use case for using the content server to download KePub files?
jgoguen is offline   Reply With Quote
Old 06-29-2015, 11:18 AM   #9
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
Nothing to important. I simply appear to be one of the few people who actually like the default Kobo interface for reading KEPubs. I actually prefer it to the epub renderer. While I mostly use Calibre directly with USB, when away from the computer I do sometimes download a book or two from the content server. It would be nice to be able to actually download the KEPub and have the plugboard applied. As I said, not a big deal. Just simply convenience. I actually thought this was working about 6 weeks ago but am now thinking I probably imagined it. As the two plugins seemed to essentially make KEPub just another format supported by Calibre for the purposes I was using it, I had assumed this extended also to the content server. Would it be trivial to add such support to the content server or would a lot of work be required?
darryl is offline   Reply With Quote
Old 06-29-2015, 11:44 AM   #10
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
I have no idea right now. I think I'd need to look at the code in calibre a bit more to get a handle on it. I don't think it would be too bad from what I saw looking at this so far.
jgoguen is offline   Reply With Quote
Old 06-29-2015, 01:27 PM   #11
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,119
Karma: 73448614
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
For some reason I thought davidfor had done a patch for the content server to handle kepub format...
PeterT is offline   Reply With Quote
Old 06-29-2015, 01:33 PM   #12
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
I know he did a KePub conversion input plugin that I need to get merged into the main plugin code. I *think* handling a KePub in the content server is just adding the format to a list during the plugin initialization.
jgoguen is offline   Reply With Quote
Old 06-30-2015, 12:28 AM   #13
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
I think davidfor did change the content server to cownload kepub files as kepub.epub to Kobo devices.

In the meantime, I have had a look at the relevant source and applied my very limited Python knowledge with surprising success. Two minor changes to add the kepub format in content.py fix the problem. This means, of course, that the content server now supports not only epub, mobi and azw3 but also kepub. Sounds much more impressive than it is! I will have a look at submitting a patch according to the instructions in the manual. However, one consequent change will be necessary to metadata plugboards. Trying to add a plugboard for the content server specifying kepub as the format in the preferences gui still results in an error message that kepub is not supported by the content server. If I get a chance I will see if I can fix this before trying to submit any changes.

EDIT: Please see my further post below.

Last edited by darryl; 06-30-2015 at 02:20 AM.
darryl is offline   Reply With Quote
Old 06-30-2015, 01:36 AM   #14
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Yes, I supplied some code a while ago to have the content server to serve kepubs with the ".kepub.epub" extension. That was needed for them to be downloaded by the browser. But, I didn't think about the metadata update issue. At the time, this plugin didn't exist (well, I might have had a version), so calibre couldn't have done it.

I suppose what this needs is for the server to handle any format that calibre has a metadata writer plugin for. And the plugboards to recognise this as well. Kovid is in the process of rewriting the content server, but, apart from seeing lots of code updates, I haven't looked at it. Hopefully, the changes will include handling non-standard formats, but, I don't know. I'll try and have a look.
davidfor is offline   Reply With Quote
Old 06-30-2015, 02:35 AM   #15
darryl
Wizard
darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.darryl ought to be getting tired of karma fortunes by now.
 
darryl's Avatar
 
Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
I've now had a further look. Firstly, the changes to the content.py in the library/server directory to simply include kepub in the formats in two places do in fact solve the problem entirely, and, contrary to my last post, does in fact allow the creation of plugboards for the content server in kepub format. However, there is also a second content.py file under the directory srv which has one line showing formats without kepub. Logically I should change this file as well to include kepub, but I'm not yet sure of the function this file serves as opposed to the file under the library directory, particularly as the changes to the file under library seem to have solved the problem.

I intend to open a bug and attach my changes as suggested in the manual, but want to sort out whether I need to change the file under srv as well first.
darryl is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Reader Plugin] KePub Metadata Reader jgoguen Plugins 40 05-17-2020 10:24 AM
Regarding using metadata objects in identify method of metadata download plugin api aprekates Development 1 07-06-2014 03:35 AM
Correcting metadata for kepub books GeoffR Kobo Reader 9 03-25-2013 06:06 AM
Bug in epub metadata writer? Invalid attribute role="aut" Man Eating Duck Calibre 3 09-26-2012 09:55 AM
[Metadata Download Plugin] Goodreads Metadata **Deprecated** kiwidude Plugins 30 04-23-2011 02:10 PM


All times are GMT -4. The time now is 01:26 PM.


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