From 44bd7f631934fda6fba2ddba8436dbeeff80210d Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 29 Oct 2013 22:19:12 -0500 Subject: [PATCH] Handling for fictionpad.com empty chapters. "This chapter has no text." --- fanficdownloader/adapters/adapter_fictionpadcom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fanficdownloader/adapters/adapter_fictionpadcom.py b/fanficdownloader/adapters/adapter_fictionpadcom.py index 86985cc..704e904 100644 --- a/fanficdownloader/adapters/adapter_fictionpadcom.py +++ b/fanficdownloader/adapters/adapter_fictionpadcom.py @@ -180,7 +180,11 @@ class FictionPadSiteAdapter(BaseSiteAdapter): def getChapterText(self, url): logger.debug('Getting chapter text from: %s' % url) - soup = bs.BeautifulSoup("
"+self._fetchUrl(url)+"
") + if not url: + data = u"This chapter has no text." + else: + data = self._fetchUrl(url) + soup = bs.BeautifulSoup(u"
"+data+u"
") return self.utf8FromSoup(url,soup) def getClass():