From abde9fdf8d3684c0c8d20937e7581a02661b0302 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sat, 2 Mar 2013 15:46:47 -0600 Subject: [PATCH] Page scrape story descriptions again for fimfiction.net due to API issues. --- app.yaml | 2 +- fanficdownloader/adapters/adapter_fimfictionnet.py | 13 +++++++++---- index.html | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app.yaml b/app.yaml index 18f1bcd..be333da 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ # ffd-retief-hrd fanfictiondownloader application: fanfictiondownloader -version: 4-4-45 +version: 4-4-46 runtime: python27 api_version: 1 threadsafe: true diff --git a/fanficdownloader/adapters/adapter_fimfictionnet.py b/fanficdownloader/adapters/adapter_fimfictionnet.py index b0ad261..88b6178 100644 --- a/fanficdownloader/adapters/adapter_fimfictionnet.py +++ b/fanficdownloader/adapters/adapter_fimfictionnet.py @@ -181,10 +181,15 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter): self.setCoverImage(self.url,coverurl) - # the fimfic API gives bbcode for desc, not html. - # btw, bbcode honors newlines, html doesn't. change newlines to br tags. - self.setDescription(self.url, - bbcodeparser().parse(storyMetadata["description"]).html(doDeepCopy=False).replace('\r','').replace('\n','
')) + self.setDescription(self.url,soup.find("div", {"class":"description"})) + # if "description" in storyMetadata and storyMetadata["description"]: + # # the fimfic API gives bbcode for desc, not html. + # # btw, bbcode honors newlines, html doesn't. change newlines to br tags. + # self.setDescription(self.url, + # bbcodeparser().parse(storyMetadata["description"]).html(doDeepCopy=False).replace('\r','').replace('\n','
')) + # elif "short_description" in storyMetadata and storyMetadata["short_description"]: + # self.setDescription(self.url, + # bbcodeparser().parse(storyMetadata["short_description"]).html(doDeepCopy=False).replace('\r','').replace('\n','
')) # Dates are in Unix time # Take the publish date from the first chapter posted diff --git a/index.html b/index.html index 86d1ee5..9e508c4 100644 --- a/index.html +++ b/index.html @@ -57,7 +57,7 @@

Changes:

@@ -68,7 +68,7 @@ If you have any problems with this application, please report them in the FanFictionDownLoader Google Group. The - Previous Version is also available for you to use if necessary. + Previous Version is also available for you to use if necessary.

{{ error_message }}