Automatically try site without "www.".

This commit is contained in:
Jim Miller
2012-07-12 09:48:00 -05:00
parent 615f7b2bc2
commit fcdd799d10
2 changed files with 6 additions and 5 deletions
+5
View File
@@ -121,6 +121,11 @@ def getAdapter(config,url,fileform=None):
logging.debug("site:"+domain)
cls = getClassFor(domain)
if not cls and domain.startswith("www."):
domain = domain.replace("www.","")
logging.debug("trying site:without www: "+domain)
cls = getClassFor(domain)
fixedurl = fixedurl.replace("http://www.","http://")
if not cls:
logging.debug("trying site:www."+domain)
cls = getClassFor("www."+domain)
@@ -71,15 +71,11 @@ class TheMasqueNetAdapter(BaseSiteAdapter):
# The site domain. Does have www here, if it uses it.
return 'themasque.net'
@classmethod
def getAcceptDomains(cls):
return ['www.themasque.net','themasque.net'] #
def getSiteExampleURLs(self):
return "http://themasque.net/wiktt/efiction/viewstory.php?sid=1234 http://themasque.net/efiction/viewstory.php?sid=1234"
def getSiteURLPattern(self):
return re.escape("http://")+"(www\.)?"+re.escape(self.getSiteDomain())+"(/wiktt)?/efiction"+re.escape("/viewstory.php?sid=")+r"\d+$"
return re.escape("http://"+self.getSiteDomain())+"(/wiktt)?/efiction"+re.escape("/viewstory.php?sid=")+r"\d+$"
## Login seems to be reasonably standard across eFiction sites.
def needToLoginCheck(self, data):