![]() |
#1 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
![]()
Hello together,
shortly I created a Calibre plugin for myself. You can see its name in the title. Its purpose is to extract content information from ebooks (actually PDF and EPUB), to be more precise from the bookmarks, and to write it to a user defined "#content" field. This field is then displayed in the details view of Calibre just before Comments (configurable). If you are interrested, you can visit my web page to get more information. Also I append this plugin in this post. It would be nice, if someone found it useful. ![]() |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Bug fix and additional features
In the mean time I detected an error: an intermediate file was not overwritten - so the #content field was not updated after the first invocation of the command for an epub ebook.
So I provide this update. Additional content is better logging, exception handling an a dialog to check the requirements. I apologize for any problems. Last edited by theducks; 10-04-2019 at 05:22 AM. Reason: moved new ver PI here |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Progress in the work on the plugin
Hi, I want to post some news about the progress in the work on the plugin.
The following points seem remarkable to me:
|
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,619
Karma: 134254544
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
from the description of the plugin on your website, this sounds like you want to extract the eBook from the eBook file and place it in a custom field in Calibre. Do I have this correct?
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,253
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
FYI I ust added a function to extract the outline from PDF files to calibre itself, so no need to use pdftk.
Code:
from calibre.utils.podofo import get_outline |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Hint for outline
Many thanks for Your hint. I just gave it a try. It works and I could see the generated list / dict structure.
One problem: during extraction the UI is blocked, although my code run in a ThreadedJob. With the pdftk this is not the case. Any additional hints? Thanks! |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Reply to JSWolf
I do not extract the ebook from the ebook but the ebook's outline or bookmarks as it is called by Adobe reader.
The rest is correct. |
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
New version with bug fixes
Just after my yesterday's post I detected some bugs:
That's why this new bug fix post. Moderator Notice
Moved latest version to post #1 (a convention for releases) Last edited by theducks; 10-04-2019 at 05:20 AM. |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
But, I have to say your description of the plugin is terrible. When you first posted it, my reaction was similar to @JSWolf's. And I was only sure of what it did by reading the code. When I first saw it, I couldn't decide if "content information" was the metadata in the book, or text from the book. And the use of "bookmarks" added to the confusion as then I assumed you were extracting the user added bookmarks. |
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Looking at the code, you are assuming the NCX file is called "toc.ncx" and will either be in the OEPBS or root directory of the book. I have plenty of books where this would fail. You should be finding the file using the OPF.
Alternatively, calibre has methods to do this. Look at: Code:
from calibre.ebooks.oeb.polish.container import EpubContainer from calibre.ebooks.oeb.polish.toc import get_toc |
![]() |
![]() |
![]() |
#11 | |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
How to change name of plugin
Quote:
What's about:
|
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
New name, new features, bug fixes
Hello,
in the mean time I decided to rename the plugin to "TOC View Generator". Hopefully people can better imagine what the plugin does seeing this name. Also I added a few new features:
How can I add attachments to previous posts? I could not find any button or link for it! |
![]() |
![]() |
![]() |
#13 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 979
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
You can click on 'edit' on the bottom right corner of the first post. Then, click on 'Go advanced' and 'Manage Attachments'. |
|
![]() |
![]() |
![]() |
#14 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,250
Karma: 57979022
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Moderator Notice Name changed. I will let the OP manage the attachment. It (releases) must be in the first post IF Calibre notifications are to work. Betas should NOT be in post 1 ![]() |
![]() |
![]() |
![]() |
#15 |
Member
![]() Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Edit not found
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] APNX Generator | user_none | Plugins | 93 | 06-12-2024 07:26 AM |
[GUI Plugin] View Manager | kiwidude | Plugins | 415 | 05-11-2024 03:28 AM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |
[GUI Plugin] Auto Datestamp and View | eater | Plugins | 3 | 04-08-2020 06:08 PM |
Bug or feature of the TOC generator? | Artha | Sigil | 10 | 11-26-2011 11:03 PM |