account for ipv6 brackets [ip:ip:ip]:port
This commit is contained in:
parent
37618e4a13
commit
219be3f440
|
@ -154,8 +154,14 @@ def add_peer_dialog():
|
||||||
response = peer_dialog.run()
|
response = peer_dialog.run()
|
||||||
if response:
|
if response:
|
||||||
value = txt_ip.get_text()
|
value = txt_ip.get_text()
|
||||||
ip = value.split(":")[0]
|
if ']' in value:
|
||||||
port = value.split(":")[1]
|
#ipv6
|
||||||
|
ip = value.split("]")[0][1:]
|
||||||
|
port = value.split("]")[1][1:]
|
||||||
|
else:
|
||||||
|
#ipv4
|
||||||
|
ip = value.split(":")[0]
|
||||||
|
port = value.split(":")[1]
|
||||||
if deluge.common.is_ip(ip):
|
if deluge.common.is_ip(ip):
|
||||||
id = component.get("TorrentView").get_selected_torrent()
|
id = component.get("TorrentView").get_selected_torrent()
|
||||||
log.debug("adding peer %s to %s", value, id)
|
log.debug("adding peer %s to %s", value, id)
|
||||||
|
|
Loading…
Reference in New Issue