(self)
| 13 | |
| 14 | class IPFactory: |
| 15 | def __init__(self): |
| 16 | cdnFile = os.path.join(path.library, 'cdn_ip_cidr.json') |
| 17 | dbFile = os.path.join(path.library, "data", "ip2region.db") |
| 18 | self.searcher = Ip2Region(dbFile) |
| 19 | with open(cdnFile, 'r', encoding='utf-8') as file: |
| 20 | self.cdns = json.load(file) |
| 21 | |
| 22 | def parse_host(self,url): |
| 23 | host = urlsplit(url).netloc |