mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
使用数据库来查ASN信息 优化内存
This commit is contained in:
+3
-1
@@ -685,11 +685,13 @@ def is_subname(name):
|
||||
|
||||
|
||||
def ip_to_int(ip):
|
||||
if isinstance(ip, int):
|
||||
return ip
|
||||
try:
|
||||
ipv4 = IPv4Address(ip)
|
||||
except Exception as e:
|
||||
logger.log('ERROR', e.args)
|
||||
return None
|
||||
return 0
|
||||
return int(ipv4)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user