mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-09 05:21:13 +02:00
Some chromagnon cache keys aren't bytes or text?
This commit is contained in:
parent
f82e534cb5
commit
10a6554c81
1 changed files with 12 additions and 4 deletions
|
|
@ -108,10 +108,18 @@ class CacheEntry():
|
|||
|
||||
# It is probably an HTTP header
|
||||
self.key = cacheData.CacheData(addr, self.keyLength, True)
|
||||
# Some keys seem to be '_dk_http://example.com https://example.com https://www.example.com/full/url/path'
|
||||
# fix those up so the actual URL will work as a hash key in our table
|
||||
# if key has whitespace followed by final http[s]://something, substitute, otherwise this leaves it unchanged
|
||||
self.key = re.sub(r'^.*\s(https?://\S+)$', r'\1', self.key)
|
||||
try:
|
||||
# Some keys seem to be '_dk_http://example.com https://example.com https://www.example.com/full/url/path'
|
||||
# fix those up so the actual URL will work as a hash key
|
||||
# in our table if key has whitespace followed by final
|
||||
# http[s]://something, substitute, otherwise this leaves
|
||||
# it unchanged
|
||||
self.key = re.sub(r'^.*\s(https?://\S+)$', r'\1', self.key)
|
||||
except TypeError:
|
||||
## Some 'keys' are not bytes or text types. No idea why
|
||||
## not.
|
||||
# print(self.key)
|
||||
pass
|
||||
block.close()
|
||||
|
||||
def keyToStr(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue