mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Fallback to using DNS for geoip lookups if the database file is not
available
This commit is contained in:
parent
98f65f13cf
commit
88346a5722
2 changed files with 5 additions and 4 deletions
|
@ -211,9 +211,10 @@ class Core(
|
|||
self.settings = lt.session_settings()
|
||||
self.settings.user_agent = "Deluge %s" % deluge.common.get_version()
|
||||
|
||||
# Load the GeoIP DB for country look-ups
|
||||
self.session.load_country_db(
|
||||
pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat")))
|
||||
# Load the GeoIP DB for country look-ups if available
|
||||
geoip_db = 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 session settings
|
||||
self.settings.lazy_bitfields = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue