From 31c68ff796936761de13ba684a559caa15b6c766 Mon Sep 17 00:00:00 2001 From: Jimm Date: Sat, 25 Sep 2010 11:55:31 -0500 Subject: [PATCH] Exit on ff.net error downloading chapter. Replace ':' with '_' in file name for html output, too. --- ffnet.py | 2 ++ output.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ffnet.py b/ffnet.py index fb1ff29..373c6ea 100644 --- a/ffnet.py +++ b/ffnet.py @@ -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 '' return div.prettify() diff --git a/output.py b/output.py index 9c004c7..a0784c2 100644 --- a/output.py +++ b/output.py @@ -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