JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
770 stars 165 forks source link

RecursionError: maximum recursion depth exceeded while calling a Python object #613

Closed Klysas closed 3 years ago

Klysas commented 3 years ago

I'm using FanFicFare v3.26.0 and tried to download "Release that Witch" from WuxiaWorld.site and WuxiaWorld.co and receive following error. I'm guessing this is because this novel has 1498 chapters.

Download 1 FanFiction Book(s)
FFF: INFO: 2020-12-19 01:58:42,337: calibre_plugins.fanficfare_plugin.jobs(53): FanFicFare v3.26.0
FFF: INFO: 2020-12-19 01:58:42,338: calibre_plugins.fanficfare_plugin.jobs(57): Adding jobs for URLs:
FFF: INFO: 2020-12-19 01:58:42,338: calibre_plugins.fanficfare_plugin.jobs(59): https://www.wuxiaworld.co/Release-that-Witch/
FFF: INFO: 2020-12-19 02:39:12,680: calibre_plugins.fanficfare_plugin.jobs(95): Logfile for book ID None (Release that Witch)
FFF: INFO: 2020-12-19 02:39:12,682: calibre_plugins.fanficfare_plugin.jobs(96): url:(https://www.wuxiaworld.co/Release-that-Witch/) id:(None)

......

FFF: INFO: 2020-12-19 02:39:12,200: calibre_plugins.fanficfare_plugin.jobs(350): Exception: {'title': 'Release that Witch', 'author_sort': ['Er Mu'], 'author': ['Er Mu'], 'comments': '<div class="content">\n                    <p class="desc">\n                        <br/>\nCheng Yan traveled through time only to end up in Europe of the medieval period, becoming Roland, a Royal Prince. But this world doesn’t seem to be the same as his former world. Witches are real and they really can use magic?\n\nFollow Roland’s battle for the throne against his siblings. Will he be able to win, even though the king already declared him to be a hopeless case and with the worst starting situation? With his experiences of modern technologies and the help of the witches who are known as devils’ servants and hunted by the the Holy Church he might have a fighting chance.\n\nNow, let his journey begin.\n                    </p>\n                </div>', 'good': False, 'status': 'Error', 'showerror': True, 'calibre_id': None, 'begin': None, 'end': None, 'comment': 'maximum recursion depth exceeded while calling a Python object', 'url': 'https://www.wuxiaworld.co/Release-that-Witch/', 'site': 'www.wuxiaworld.co', 'series': '', 'added': False, 'pubdate': None, 'publisher': 'www.wuxiaworld.co', 'uniqueurl': 'https://www.wuxiaworld.co/Release-that-Witch/[None-None]', 'listorder': 0, 'collision': 'Overwrite if Newer', 'is_adult': False, 'username': 'NoneGiven', 'password': '', 'icon': 'dialog_error.png', 'all_metadata': {'category': '', 'genre': '', 'characters': '', 'ships': '', 'warnings': '', 'extratags': 'FanFiction', 'author': 'Er Mu', 'authorId': 'Er Mu', 'authorUrl': '', 'lastupdate': 'Last Update Year/Month: 2020/02, Last Update: 2020/02/18', 'series': '', 'seriesUrl': '', 'language': '', 'status': 'Completed', 'datePublished': '', 'dateUpdated': '2020-02-18', 'dateCreated': '2020-12-19 01:58:37', 'rating': '', 'numChapters': '1,499', 'numWords': '', 'words_added': '', 'site': 'www.wuxiaworld.co', 'publisher': 'www.wuxiaworld.co', 'storyId': 'Release-that-Witch', 'title': 'Release that Witch', 'titleHTML': "<a class='titlelink' href='https://www.wuxiaworld.co/Release-that-Witch/'>Release that Witch</a>", 'storyUrl': 'https://www.wuxiaworld.co/Release-that-Witch/', 'sectionUrl': 'https://www.wuxiaworld.co/Release-that-Witch/', 'description': '<div class="content">\n                    <p class="desc">\n                        <br/>\nCheng Yan traveled through time only to end up in Europe of the medieval period, becoming Roland, a Royal Prince. But this world doesn’t seem to be the same as his former world. Witches are real and they really can use magic?\n\nFollow Roland’s battle for the throne against his siblings. Will he be able to win, even though the king already declared him to be a hopeless case and with the worst starting situation? With his experiences of modern technologies and the help of the witches who are known as devils’ servants and hunted by the the Holy Church he might have a fighting chance.\n\nNow, let his journey begin.\n                    </p>\n                </div>', 'formatname': '', 'formatext': '', 'siteabbrev': 'wuxco', 'version': 'FanFicFare v3.26.0', 'authorHTML': "<a class='authorlink' href=''>Er Mu</a>", 'seriesHTML': '', 'langcode': '', 'output_css': '', 'cover_image': ''}, 'tags': ['FanFiction', 'Completed'], 'updatedate': datetime.datetime(2020, 2, 18, 16, 15, tzinfo=SafeLocalTimeZone()), 'timestamp': datetime.datetime(2020, 12, 19, 1, 58, 43, 474460, tzinfo=SafeLocalTimeZone()), 'calibre_columns': {}, 'outfile': 'C:\\Users\\Klysas\\AppData\\Local\\Temp\\calibre_7w7i7uta\\fanficfare_exoednyx\\Release that Witch-Er Mu-cvg32n75.mobi'}:maximum recursion depth exceeded while calling a Python object

Traceback (most recent call last):

  File "calibre_plugins.fanficfare_plugin.jobs", line 248, in do_download_for_worker

  File "calibre_plugins.fanficfare_plugin.fanficfare.writers.base_writer", line 230, in writeStory

  File "calibre_plugins.fanficfare_plugin.fanficfare.writers.writer_mobi", line 180, in writeStoryImpl

  File "calibre_plugins.fanficfare_plugin.fanficfare.mobi", line 70, in ConvertStrings

  File "calibre_plugins.fanficfare_plugin.fanficfare.mobi", line 139, in _ConvertStringsToFile

  File "calibre_plugins.fanficfare_plugin.fanficfare.mobi", line 147, in _ConvertStringToFile

  File "calibre_plugins.fanficfare_plugin.fanficfare.mobihtml", line 149, in CleanHtml

  File "calibre_plugins.fanficfare_plugin.fanficfare.mobihtml", line 77, in _ReplaceAnchorStubs

  File "bs4\element.py", line 1491, in __unicode__

  File "bs4\__init__.py", line 744, in decode

  File "bs4\element.py", line 1598, in decode

  File "bs4\element.py", line 1692, in decode_contents

  File "bs4\element.py", line 1598, in decode

 ....

  File "bs4\element.py", line 1692, in decode_contents

  File "bs4\element.py", line 1598, in decode

  File "bs4\element.py", line 1692, in decode_contents

  File "bs4\element.py", line 1598, in decode

  File "bs4\element.py", line 1692, in decode_contents

  File "bs4\element.py", line 1598, in decode

  File "bs4\element.py", line 1692, in decode_contents

  File "bs4\element.py", line 1598, in decode

  File "bs4\element.py", line 1690, in decode_contents

  File "bs4\element.py", line 925, in output_ready

  File "bs4\element.py", line 209, in format_string

  File "bs4\formatter.py", line 86, in substitute

  File "<frozen importlib._bootstrap>", line 393, in parent

RecursionError: maximum recursion depth exceeded while calling a Python object

FFF: INFO: 2020-12-19 02:39:12,689: calibre_plugins.fanficfare_plugin.jobs(100): 
Download Results:
Error https://www.wuxiaworld.co/Release-that-Witch/ maximum recursion depth exceeded while calling a Python object

FFF: INFO: 2020-12-19 02:39:12,690: calibre_plugins.fanficfare_plugin.jobs(124): 
Error
https://www.wuxiaworld.co/Release-that-Witch/
JimmXinu commented 3 years ago

Large numbers of chapter don't cause recursion errors in HTML processing--that's usually bad HTML in the story or on the site.

I suspect that you removed the debug output before the exception that would have helped tell me what chapter the error was in. If you still have it, that would be nice to see.

JimmXinu commented 3 years ago

I was able to download this without seeing that error, but I did get a different error (connection failure) temporarily on one chapter. Because I had continue_on_chapter_error:true in personal.ini, the download still finished, but I had to remove the bad chapter and do an update.

With huge long stories continue_on_chapter_error:true can be a good idea to not waste all that time just because the network burps.

If you are on window 32bit version of Calibre, I suggest you switch to 64bit.

JimmXinu commented 3 years ago

Assuming resolved.