mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
添加cidr,asn,addr字段
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import zipfile
|
||||
import IP2Location
|
||||
from config.setting import data_storage_dir
|
||||
|
||||
|
||||
zip_path = data_storage_dir.joinpath("IP2LOCATION-LITE-DB3.BIN.ZIP")
|
||||
bin_path = data_storage_dir.joinpath("IP2LOCATION-LITE-DB3.BIN")
|
||||
if not bin_path.exists():
|
||||
zf = zipfile.ZipFile(zip_path)
|
||||
zf.extract('IP2LOCATION-LITE-DB3.BIN', data_storage_dir)
|
||||
IpGeoInfo = IP2Location.IP2Location(bin_path)
|
||||
Reference in New Issue
Block a user