Exit on ff.net error downloading chapter. Replace ':' with '_' in file name for html output, too.

This commit is contained in:
Jimm
2010-09-25 11:55:31 -05:00
parent 950807747c
commit 31c68ff796
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -133,6 +133,8 @@ class FFNet(FanfictionSiteAdapter):
soup = None
div = soup.find('div', {'id' : 'storytext'})
if None == div:
logging.error("Error downloading Chapter: %s" % url)
exit(1)
return '<html/>'
return div.prettify()
+1 -1
View File
@@ -59,7 +59,7 @@ class HTMLWriter(FanficWriter):
def __init__(self, base, name, author, inmemory=False, compress=False):
self.basePath = base
self.name = name.replace(" ", "_")
self.name = name.replace(" ", "_").replace(":","_")
self.storyTitle = name
self.fileName = self.basePath + '/' + self.name + '.html'
self.authorName = author