Godot 4 Addon for converting .epub files into text using multiple Regex operations. Metadata is not supported.
To use this Addon, clone or download as zip the repository, copy the addons folder inside your project folder, and enable it under Project > Project Settings > Plugins.
Enabling this plugin will create a new Node type called EpubConverter. To use it, add it to any scene you would like to read an epub file in, and in another node's script, you may call it using its function get_text_from_epub(file_path: String) -> String.
There are a few other functions inside it for some customization depending on the epub file. Depending on the epub, it could be required to further do small edits, but after testing it on 3 books from different publishers, the output should have a good overall quality even compared to other more popular tools for this operation. The code relies heavily on RegEx and a big time complexity algorithm for the conversion, so expect slowdowns of a maximum of a second if you want to import a big book (>500kB). There shouldn't be a problem for one time operations or smaller files. I've commented most sections of the code and added type hints, so you can write your own implementation if you want.
Perhaps some of the RegEx patterns could be smaller or simpler to understand, so if you have any suggestions for a more efficient algorithm, feel free to open an issue or a pull request.