From dd293909c0c99cb9455313d9dc0fdfb55605bab4 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 28 Feb 2012 14:27:32 -0600 Subject: [PATCH] GA fails on some chapters. Soup seems to work better than Stone this time. --- calibre-plugin/__init__.py | 2 +- fanficdownloader/adapters/adapter_gayauthorsorg.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py index 0605748b..9e1489a8 100644 --- a/calibre-plugin/__init__.py +++ b/calibre-plugin/__init__.py @@ -27,7 +27,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase): description = 'UI plugin to download FanFiction stories from various sites.' supported_platforms = ['windows', 'osx', 'linux'] author = 'Jim Miller' - version = (1, 5, 0) + version = (1, 5, 2) minimum_calibre_version = (0, 8, 30) #: This field defines the GUI plugin class that contains all the code diff --git a/fanficdownloader/adapters/adapter_gayauthorsorg.py b/fanficdownloader/adapters/adapter_gayauthorsorg.py index 66023de9..60f728d7 100644 --- a/fanficdownloader/adapters/adapter_gayauthorsorg.py +++ b/fanficdownloader/adapters/adapter_gayauthorsorg.py @@ -193,8 +193,9 @@ class GayAuthorsAdapter(BaseSiteAdapter): logging.debug('Getting chapter text from: %s' % url) - soup = bs.BeautifulStoneSoup(self._fetchUrl(url), - selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags. + data = self._fetchUrl(url) + data = data[data.index("
"):] + soup = bs.BeautifulSoup(data) # this one's happier with Soup, not StoneSoup for some reason. div = soup.find('div', {'id' : 'chapter-content'})