Skip to content

Commit

Permalink
https download
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu authored Nov 24, 2021
1 parent 6db4d87 commit 9ce2785
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions update-db.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get(url: str) -> (list, list):

def gen_ip4_data() -> bytes:
"""generate ipv4 to binary data"""
iplist, geo = get('http://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.CSV.ZIP')
iplist, geo = get('https://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.CSV.ZIP')
pack = lambda e, ip: struct.pack(e+'I', ip)
with open('ipv4.txt', 'wb') as file:
file.write(geo)
Expand All @@ -38,7 +38,7 @@ def gen_ip4_data() -> bytes:

def gen_ip6_data() -> bytes:
"""generate ipv6 to binary data"""
iplist, geo = get('http://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.IPV6.CSV.ZIP')
iplist, geo = get('https://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.IPV6.CSV.ZIP')
pack = lambda e, ip: struct.pack(e+'Q', ip >> 64) + struct.pack(e+'Q', ip & 0xFFFFFFFFFFFFFFFF)
with open('ipv6.txt', 'wb') as file:
file.write(geo)
Expand Down

0 comments on commit 9ce2785

Please sign in to comment.