just use domain, not subdomain

This commit is contained in:
j 2008-04-27 19:08:28 +02:00
parent ef59090610
commit c708596d1c

View file

@ -35,7 +35,7 @@ def getUrlCacheFile(url, data=None, headers=DEFAULT_HEADERS):
url_hash = sha.sha(url + '?' + data).hexdigest() url_hash = sha.sha(url + '?' + data).hexdigest()
else: else:
url_hash = sha.sha(url).hexdigest() url_hash = sha.sha(url).hexdigest()
domain = urlparse.urlparse(url)[1] domain = ".".join(urlparse.urlparse(url)[1].split('.')[-2:])
return os.path.join(getCacheBase(), domain, url_hash[:2], url_hash[2:4], url_hash[4:6], url_hash) return os.path.join(getCacheBase(), domain, url_hash[:2], url_hash[2:4], url_hash[4:6], url_hash)
def loadUrlCache(url_cache_file, data, timeout=cache_timeout): def loadUrlCache(url_cache_file, data, timeout=cache_timeout):