+ def miss(self, url):
+ req = urllib.request.Request(url, headers={"User-Agent": "automanga/1"})
+ with urllib.request.urlopen(req) as s:
+ if s.headers.get("content-encoding") == "gzip":
+ import gzip, io
+ return gzip.GzipFile(fileobj=io.BytesIO(s.read()), mode="r").read()
+ return s.read()
+
+ def fetch(self, url, expire=3600):