1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2026-01-13 11:02:56 +01:00

Royalroad: don't crash on malformed spoiler tags

Fixes #74
This commit is contained in:
David Lynch 2022-02-03 11:08:40 -06:00
parent dc9c9dbe57
commit 697e4c0bf9

View file

@ -93,7 +93,7 @@ class RoyalRoad(Site):
def _clean_spoilers(self, content, chapterid):
# Spoilers to footnotes
for spoiler in content.find_all(class_=('spoiler-new')):
spoiler_title = spoiler['data-caption']
spoiler_title = spoiler.get('data-caption')
if self.options['skip_spoilers']:
link = self._footnote(spoiler, chapterid)
if spoiler_title: