mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 01:48:40 +00:00
[#2763] [GTKUI] Fix unhandled error with invalid magnet uri
This commit is contained in:
parent
e4f2a450d6
commit
58059300bd
1 changed files with 5 additions and 1 deletions
|
@ -251,12 +251,16 @@ class AddTorrentDialog(component.Component):
|
||||||
|
|
||||||
for uri in uris:
|
for uri in uris:
|
||||||
s = uri.split("&")[0][20:]
|
s = uri.split("&")[0][20:]
|
||||||
|
info_hash = None
|
||||||
if len(s) == 32:
|
if len(s) == 32:
|
||||||
info_hash = base64.b32decode(s).encode("hex")
|
info_hash = base64.b32decode(s).encode("hex")
|
||||||
elif len(s) == 40:
|
elif len(s) == 40:
|
||||||
info_hash = s
|
info_hash = s
|
||||||
|
if info_hash is None:
|
||||||
|
log.error("Invalid info_hash in uri: %s", uri)
|
||||||
|
continue
|
||||||
if info_hash in self.infos:
|
if info_hash in self.infos:
|
||||||
log.debug("Torrent already in list!")
|
log.debug("Torrent already in list: %s", uri)
|
||||||
continue
|
continue
|
||||||
name = None
|
name = None
|
||||||
for i in uri.split("&"):
|
for i in uri.split("&"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue