Fallback to using DNS for geoip lookups if the database file is not
available
This commit is contained in:
parent
4eedc1b23e
commit
66ae89122d
@ -165,9 +165,10 @@ class Core(
|
|||||||
# Load the session state if available
|
# Load the session state if available
|
||||||
self.load_session_state()
|
self.load_session_state()
|
||||||
|
|
||||||
# Load the GeoIP DB for country look-ups
|
# Load the GeoIP DB for country look-ups if available
|
||||||
self.session.load_country_db(
|
geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
|
||||||
pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat")))
|
if os.path.exists(geoip_db):
|
||||||
|
self.session.load_country_db(geoip_db)
|
||||||
|
|
||||||
# Set the user agent
|
# Set the user agent
|
||||||
self.settings = lt.session_settings()
|
self.settings = lt.session_settings()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user