From 356bae9a7a55f372e67e08338156b29994ba54e5 Mon Sep 17 00:00:00 2001 From: KeinNiemand Date: Thu, 4 May 2023 13:17:28 +0200 Subject: [PATCH] Don't prettify royalroad soup, Fixes #92 --- sites/royalroad.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sites/royalroad.py b/sites/royalroad.py index 606a009..938ac95 100644 --- a/sites/royalroad.py +++ b/sites/royalroad.py @@ -73,18 +73,18 @@ class RoyalRoad(Site): self._clean(content) self._clean_spoilers(content, chapterid) - content = content.prettify() + content = str(content) author_note = soup.find_all('div', class_='author-note-portlet') if len(author_note) == 1: # Find the parent of chapter-content and check if the author's note is the first child div if 'author-note-portlet' in soup.find('div', class_='chapter-content').parent.find('div')['class']: - content = author_note[0].prettify() + '
' + content + content = str(author_note[0]) + '
' + content else: # The author note must be after the chapter content - content = content + '
' + author_note[0].prettify() + content = content + '
' + str(author_note[0]) elif len(author_note) == 2: - content = author_note[0].prettify() + '
' + content + '
' + author_note[1].prettify() + content = str(author_note[0]) + '
' + content + '
' + str(author_note[1]) updated = datetime.datetime.fromtimestamp( int(soup.find(class_="profile-info").find('time').get('unixtime'))