diff --git a/sites/royalroad.py b/sites/royalroad.py index e41c668..52fb72c 100644 --- a/sites/royalroad.py +++ b/sites/royalroad.py @@ -52,14 +52,20 @@ class RoyalRoad(Site): soup = self._soup(url) content = soup.find('div', class_='chapter-content') - # TODO: this could be more robust, and I don't know if there's post-chapter notes anywhere as well. + # TODO: this could be more robust. author_note = soup.find('div', class_='author-note-portlet') + # Find the portlet-body and check if the first child div is the author note. + if 'author-note-portlet' in soup.find('div', class_='portlet-body').find('div', recursive=False)['class']: + output = (author_note and (author_note.prettify() + '