JimmXinu / FanFicFare

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

Unhandled Exception when updating Anthology from ao3 and FFNET #860

Closed M3We closed 2 years ago

M3We commented 2 years ago

Updating an anthology (admittedly 150+ stories), but regardless of using FFNet Cache or load direct for AO3, I recieve the same error when updating.

calibre, version 5.40.0
ERROR: Unhandled exception: <b>KeyError</b>:'all_metadata'

calibre 5.40  embedded-python: True is64bit: True
macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '21.5.0', 'Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.16', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: Count Pages (1, 11, 2) && EpubMerge (2, 13, 0) && FanFicFare (4, 12, 4) && Manage Series (1, 3, 0) && Reading List (1, 9, 0)
Traceback (most recent call last):
  File "calibre/gui2/proceed.py", line 208, in do_ask_question
  File "calibre_plugins.fanficfare_plugin.fff_plugin", line 2043, in do_download_merge_update
    mergebook = self.merge_meta_books(existingbook,good_list,options)
  File "calibre_plugins.fanficfare_plugin.fff_plugin", line 2898, in merge_meta_books
    for (k,v) in six.iteritems(b['all_metadata']):
KeyError: 'all_metadata'
JimmXinu commented 2 years ago

I'm not seeing that error. Without knowing the series/stories you're trying to download, I'm very limited in what help I can provide.

Also, you're on old versions of Calibre and FFF both. I suggest updating both.

M3We commented 2 years ago

Same error once updated to latest versions as well (both Calibre and FFF).

I am downloading the following as an anthology: https://archiveofourown.org/series/1461751

JimmXinu commented 2 years ago

I tried downloading that 'series' as a single anthology. I got 168 good downloads and 25 Client Error: Too Many Requests failures. Honestly, I'm not surprised--193 stories is way more than I would recommend downloading at a time.

I was still able to save the anthology of the downloads that worked.

Several hours later, I ran into similar errors (but not always on the same stories) while trying to update it to get the other stories. Got up to 170 good downloads. I did then see the error described.

It's an issue with a previously downloaded story failing now, an edge case I didn't test well enough, it seems. FFF is meant to keep those, but warn you about them.

I have a fix for the exception, but the title/auth for the failed book(s) isn't put in the anthology desc, comes out as Uknown by Unknown. Which is all FFF knows at that moment.

I will be uploading a fix eventually, but I want to think about it more first.

In the mean time, either a) don't download such large series or b) experiment with setting slow_down_sleep_time considerably higher for AO3. Default is 2, I'd try 5 or 10. Not all the time, just when doing such large downloads.