BasioMeusPuga / Lector

Qt based ebook reader
GNU General Public License v3.0
1.51k stars 208 forks source link

fb2 support #66

Closed antmak closed 6 years ago

antmak commented 6 years ago

A small request, please add a fb2 support. Including .fb2.zip files

Thanks

BasioMeusPuga commented 6 years ago

Gladly. Can you please link me to ab .fb2 file? Something I can use to get started with?

antmak commented 6 years ago

I am glad to help! I've uploaded .fb2.zip example here https://gitlab.com/snippets/1722408 Also you could unzip it to get pure .fb2 file

Many mobile readers understand .fb2.zip format but no one on the desktop

BasioMeusPuga commented 6 years ago

Thanks. I'll get started. I will probably have to write a parser from scratch for this, so be patient. Watch this space for more.

BasioMeusPuga commented 6 years ago

So we should have working fb2 support. Please tell me if you can get it to read the files you have.

antmak commented 6 years ago

I'm sorry my distro don't have update of lector yet. I plan to try it from git as I'll have a time

lockedshadow commented 5 years ago

Perhaps the specifications of fb2 format would be also interesting? You can find it here: https://github.com/gribuser/fb2. And Calibre e-book management tool that also written in Python has implementation of fb2 reader/parser too. You can find source code here: https://github.com/kovidgoyal/calibre.

ghost commented 5 years ago

Hi! Today from git: do not open any(and fb2) formats with "cannot parse". python3 main.py from sources or build with PM and run. Installed all depends except python-poppler-qt5.

BasioMeusPuga commented 5 years ago

@wwwwwwww1 Were these files working earlier? I have made a few changes, so can you link me to a copy of a book that's not working?

ghost commented 5 years ago

Any fb2 book from ponyfiction.org. Also don't open epub. For example, wget

Launch in terminal

How to more details?

BasioMeusPuga commented 5 years ago

I can't replicate this here. So I'd recommend a clean clone, and removal of the database / conflig files in ~/.local/share/Lector and ~/.config/Lector and restarting. You can also maybe check if python-lxml is installed.

screenshot_20190118_201447

In the meantime, I'm working on getting logging functional. That should allow me to diagnose things better.

ghost commented 5 years ago

Thanks! python-lxml was installed with errors. After reinstalling this package with pip3 it all worked. But there are problems. Do not added books from ponyfiction.

Check it, please. Book was added successful, but few problems. I downloaded this book again and it don't add.

And this. Not add.

Carmina16 commented 5 years ago

The error with Vse tsveta... is caused by this line: https://github.com/BasioMeusPuga/Lector/blob/5e3987dc0426e6a28d248ab6725eefe96dffa0aa/lector/readers/read_fb2.py#L79

FB2 files can have no attachments or cover, so easiest way to fix it is also catching the TypeError exception.

@wwwwwwww1 The other file looks OK, what are your problems with it?

BasioMeusPuga commented 5 years ago

@Carmina16 Yup. It was a TypeError thing for both of the books. It should be fixed in the next commit.

ghost commented 5 years ago

Thank you very much! Your last commit solved the problem of adding books to the library. Small bug: if ~/.local/share/Lector was not created, lector don't run.

FileNotFoundError: [Errno 2] No such file or directory: '/home/fury/.local/share/Lector/Lector.log'

PS. I not met the book readers that show fb2 description.

BasioMeusPuga commented 5 years ago

Yes. That was an oversight on my part. I've fixed it now.

If you need anything else, please consider creating a new issue so I can track thing better.