p0n1 / epub_to_audiobook

EPUB to audiobook converter, optimized for Audiobookshelf
MIT License
888 stars 86 forks source link

Error when parsing book with nested chapters #57

Open GamerClassN7 opened 3 months ago

GamerClassN7 commented 3 months ago

I get error when trying to pase tis book: https://www.kosmas.cz/knihy/257693/ostre-stribro/

/usr/local/lib/python3.11/site-packages/bs4/builder/__init__.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument `features="xml"` into the BeautifulSoup constructor.
  warnings.warn(

Could it be connectet to nested chapters ? image

p0n1 commented 3 months ago

Hi @GamerClassN7. Looks like your error log is not completed for me.

I can only see the bellow log from your post which is normal warning from the underlying dependencies.

/usr/local/lib/python3.11/site-packages/bs4/builder/init.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. warnings.warn(

GamerClassN7 commented 3 months ago

Hi @GamerClassN7. Looks like your error log is not completed for me.

I can only see the bellow log from your post which is normal warning from the underlying dependencies.

/usr/local/lib/python3.11/site-packages/bs4/builder/init.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. warnings.warn(

Sorry, for insufficient description @p0n1, in thee end it seems that problem is only half there since after converting the book all chapters are saved in incorrect order, ant that was the thing which mislead me that the XML parsing warning is root cause of the problem. I can buy a book for testing purposes to help you troubleshoot the issue