Opened 8 years ago

Closed 7 years ago

#2861 closed patch (Fixed)

libtorrent-rasterbar 1.1.x+ GeoIP support

Reported by: XRevan86 Owned by:
Priority: minor Milestone: 1.3.14
Component: Core Version: develop
Keywords: Cc: Cas


Deluge currently uses libtorrent to get GeoIP data. In libtorrent-rasterbar 1.1+ GeoIP functionality has been removed so a direct implementation is required.
This patch uses python-GeoIP bindings for the job (rewriting it using pygeoip or ctypes is not a problem).
On libtorrent-rasterbar 1.0 or older new behaviour is to first try libtorrent's implementation then if failed to try bindings.

Attachments (1)

deluge-libtorrent-1.1-geoip.patch (2.9 KB) - added by XRevan86 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by XRevan86

  • Component changed from Unknown to Core
  • Summary changed from libtorrent-rastebar 1.1+ GeoIP support to libtorrent-rasterbar 1.1.x+ GeoIP support
  • Version changed from master (git) to develop (git)

Changed 8 years ago by XRevan86

comment:2 Changed 8 years ago by Cas

Looking good but needs a few tweaks.

You can replace the isalpha loop with list comprehension:

country = "".join([ char if char.isalpha() else " " for char in country ])

Need to use a more descriptive var name than gi.

Also shouldn't have a bare try..except with pass.

If you have a github account you could provide this patch as a PR.

Last edited 8 years ago by Cas (previous) (diff)

comment:4 Changed 8 years ago by Cas

  • Milestone changed from 2.0 to 1.3.14

Fixed in develop: [ca7cbd291f25]

Since lt 1.1 supports 1.3-stable probably is prudent to apply changes there too but will need to verify not introducing any new bugs. Have created a PR:

comment:5 Changed 7 years ago by Cas

  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in 1.3-stable: [ffb1316f09b]

Note: See TracTickets for help on using tickets.