From 07e9b6da810b37495d2dca56df68a067a1d38ce3 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 30 May 2012 16:47:56 -0500 Subject: [PATCH] Make thehexfiles.net accept www.thehexfiles.net too. --- fanficdownloader/adapters/adapter_thehexfilesnet.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fanficdownloader/adapters/adapter_thehexfilesnet.py b/fanficdownloader/adapters/adapter_thehexfilesnet.py index 20123684..ad74ce34 100644 --- a/fanficdownloader/adapters/adapter_thehexfilesnet.py +++ b/fanficdownloader/adapters/adapter_thehexfilesnet.py @@ -69,13 +69,15 @@ class TheHexFilesNetAdapter(BaseSiteAdapter): # The site domain. Does have www here, if it uses it. return 'thehexfiles.net' + @classmethod + def getAcceptDomains(cls): + return ['www.thehexfiles.net','thehexfiles.net'] + def getSiteExampleURLs(self): return "http://"+self.getSiteDomain()+"/viewstory.php?sid=1234" def getSiteURLPattern(self): - return re.escape("http://"+self.getSiteDomain()+"/viewstory.php?sid=")+r"\d+$" - - + return re.escape("http://")+"(www\.)?"+re.escape(self.getSiteDomain()+"/viewstory.php?sid=")+r"\d+$" ## Getting the chapter list and the meta data, plus 'is adult' checking. def extractChapterUrlsAndMetadata(self): @@ -196,4 +198,4 @@ class TheHexFilesNetAdapter(BaseSiteAdapter): if None == soup: raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url) - return self.utf8FromSoup(url,soup) \ No newline at end of file + return self.utf8FromSoup(url,soup)