Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 06:06 AM   #1
KarlG
Enthusiast
KarlG began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Mar 2024
Device: none
Borkify Plugin - Possible limitation?

Hello,

I have an epub which causes Sigil to crash when I attempt to restructure it to Sigil Norm.

Normally I would use the borkify plugin on the epub to allow me to post it for further investigation, however the borkify plugin crashes with the following error message

..converting: cover.xhtml with manifest id: cover
Traceback (most recent call last):
File "/usr/local/share/sigil/plugin_launchers/python/launcher.py", line 142, in launch
self.exitcode = target_script.run(container)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/karl/.local/share/sigil-ebook/sigil/plugins/Borkify/plugin.py", line 113, in run
with open(fpath, "wb") as f:
^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmphk94al94/OEBPS/cover.xhtml'
Error: [Errno 2] No such file or directory: '/tmp/tmphk94al94/OEBPS/cover.xhtml'

I've manually unpacked the epub and there isn't an OEBPS directory, so I'm assuming the borkify plugin will only work on standard epubs which already have the correct directory structure.

Any suggestions as to how I could get round this?

Thanks

Karl
KarlG is offline   Reply With Quote
Old Today, 06:27 AM   #2
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 717
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Various
Borkify plugin is 7 years old, actually only accepts the standard folder structure (Sigil Norm) inside the EPUB file.

The solutions are two:
1. restructure first, then Borkify.
2. improve the Borkify plugin to take into account a different folder structure.

The change is relatively simple. If I'm looking correctly, all you need to do is replace the lines in the plugin.py file:

Code:
        if "/" in href:
            destdir, filename = unquote(filename).split("/")
        fpath = os.path.join(temp_dir, "OEBPS", destdir, filename)
On such:
Code:
        if bk.launcher_version() >= 20190927:
            fpath = os.path.join(bk._w.ebook_root, bk.get_opfbookpath())
        else:
            fpath = os.path.join(bk._w.ebook_root, 'OEBPS', opf_name)
BeckyEbook is offline   Reply With Quote
Advert
Old Today, 07:03 AM   #3
KarlG
Enthusiast
KarlG began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Mar 2024
Device: none
Hi Becky,

Thanks for the quick reply. Restructuring is not an option, as it's the restructuring that causes Sigil to crash! :-)

I replaced the code in plugin.py as you suggested. That certainly fixed the crash, but the output file isn't borkified at all.

Last time I had an issue with an epub, I shared it via Proton Drive. If you like I can do this again and then you can let me know after you've grabbed it and I can remove the share.
KarlG is offline   Reply With Quote
Old Today, 07:27 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,128
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I also get occasional failures of the restructuring algorithm but usually it’s due to malformed coding in the epub and is easily fixable. I would ignore the whole Borkify issue until you get it to pass the restructuring.

When you first open the epub in Sigil hit F7 to run a well-formed check. That should give you a list of problems to fix. When fixed you should be able to restructure, then Borkify (if you still need to).
Turtle91 is offline   Reply With Quote
Old Today, 07:33 AM   #5
KarlG
Enthusiast
KarlG began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Mar 2024
Device: none
Hi Dion,

Already tried that. No problems found, but Sigil still crashes when I attempt a restructure.

Karl
KarlG is offline   Reply With Quote
Advert
Old Today, 09:07 AM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,864
Karma: 5449552
Join Date: Nov 2009
Device: many
You could just pm a private link to DiapDealer or myself here on MR. We can then use it to track down and fix the bug without you needing to make it publicly available.

BTW, Alternatively, try using Find and Replace to a selected body tag contents with the same a single paragraph of text. If Restructuring the that works, then you know the issue is with that file's content links of some sort.

Or, make a Checkpoint, then run Mend on all HTML files and see if the restructure bug still happens. If not compare it to the Checkpoint to see what changed.

Please do let us know what you find, as Sigil should never crash.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kepub limitation? CyberPaul Kobo Reader 16 06-08-2022 04:01 PM
Borkify ePUB Toxaris Plugins 18 01-26-2017 06:21 PM
Kepub limitation aluisscp Kobo Reader 7 06-29-2014 04:22 PM
Library Limitation Catlady General Discussions 11 04-21-2014 07:26 PM
Size limitation? Kumabjorn Calibre 2 02-19-2012 11:12 AM


All times are GMT -4. The time now is 09:18 AM.


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