From 03d030feab9f967dbdb1123764a4494d039dc7e8 Mon Sep 17 00:00:00 2001 From: oh45454545 <49881751+oh45454545@users.noreply.github.com> Date: Wed, 8 Sep 2021 15:55:02 +0200 Subject: [PATCH] Update adapter_asianfanficscom.py --- .../adapters/adapter_asianfanficscom.py | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/fanficfare/adapters/adapter_asianfanficscom.py b/fanficfare/adapters/adapter_asianfanficscom.py index 61df675e..b67f0541 100644 --- a/fanficfare/adapters/adapter_asianfanficscom.py +++ b/fanficfare/adapters/adapter_asianfanficscom.py @@ -246,24 +246,15 @@ class AsianFanFicsComAdapter(BaseSiteAdapter): data = self.get_request(url) soup = self.make_soup(data) + content = soup.find('div', {'id': 'user-submitted-body'}) - try: - # - jsonlink = soup.find('script',string=re.compile(r'/api/chapters/[0-9]+/chapter_[0-9a-z]+.json')).get_text().split('"')[1] # grabs url from quotation marks - chap_json = json.loads(self.get_request(jsonlink)) - content = self.make_soup(chap_json['post']).find('body') # BS4 adds
if not present. - content.name='div' # change body to a div. - if self.getConfig('inject_chapter_title'): - # the dumbest workaround ever for the abbreviated chapter titles from before - logger.debug("Injecting full-length chapter title") - newTitle = soup.find('h1', {'id' : 'chapter-title'}).text - newTitle = self.make_soup('