mirror of
https://github.com/ValdikSS/blockcheck.git
synced 2026-09-14 11:05:48 +05:00
Try to resolve IP addresses for DPI test and fallback to static IP if it failed
This commit is contained in:
parent
9c8a85cb7d
commit
31d21e5b82
@ -683,6 +683,16 @@ def test_dpi():
|
||||
dpiresults = []
|
||||
for dpisite in dpi_list:
|
||||
site = dpi_list[dpisite]
|
||||
# First try to resolve IP address using Google API.
|
||||
# Use a static one if this did not work.
|
||||
newip = _get_a_record_over_google_api(site['host'])
|
||||
if newip:
|
||||
site['ip'] = newip[0]
|
||||
if ipv6_available:
|
||||
newip = _get_a_record_over_google_api(site['host'], 'AAAA')
|
||||
if newip:
|
||||
site['ipv6'] = newip[0]
|
||||
|
||||
dpi_built_tests = _dpi_build_tests(site['host'], site['urn'], site['ip'], site['lookfor'])
|
||||
for testname in dpi_built_tests:
|
||||
test = dpi_built_tests[testname]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user