From 33b15fe7c12cd41f02682bd2542756519d4ddf5c Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 15 Dec 2011 16:48:24 -0600 Subject: [PATCH] Fix for (past)contrib author in tthfanficorg. Tweak meaning of --force in CLI. --- downloader.py | 6 +++++- fanficdownloader/adapters/adapter_tthfanficorg.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/downloader.py b/downloader.py index 1962f19..f0b7065 100644 --- a/downloader.py +++ b/downloader.py @@ -70,7 +70,7 @@ def main(): help="Update an existing epub with new chapter, give epub filename instead of storyurl. Not compatible with inserted TOC.",) parser.add_option("--force", action="store_true", dest="force", - help="Force update of an existing epub, download and overwrite all chapters.",) + help="Force overwrite or update of an existing epub, download and overwrite all chapters.",) (options, args) = parser.parse_args() @@ -102,6 +102,10 @@ def main(): config.add_section("overrides") except ConfigParser.DuplicateSectionError: pass + + if options.force: + config.set("overrides","always_overwrite","true") + if options.options: for opt in options.options: (var,val) = opt.split('=') diff --git a/fanficdownloader/adapters/adapter_tthfanficorg.py b/fanficdownloader/adapters/adapter_tthfanficorg.py index 9b92a62..1906aaa 100644 --- a/fanficdownloader/adapters/adapter_tthfanficorg.py +++ b/fanficdownloader/adapters/adapter_tthfanficorg.py @@ -98,7 +98,7 @@ class TwistingTheHellmouthSiteAdapter(BaseSiteAdapter): a = soup.find('a', href=re.compile(r"^/AuthorStories-\d+")) self.story.setMetadata('authorId',a['href'].split('/')[1].split('-')[1]) self.story.setMetadata('authorUrl','http://'+self.host+a['href']) - self.story.setMetadata('author',a.string) + self.story.setMetadata('author',stripHTML(a)) try: # going to pull part of the meta data from author list page.