Ticket #1074: hex_encoded_magnet_1_2.patch

File hex_encoded_magnet_1_2.patch, 725 bytes (added by ianmartin, 15 years ago)
  • deluge/ui/gtkui/addtorrentdialog.py

     
    226226        new_row = None
    227227
    228228        for uri in uris:
    229             info_hash = base64.b32decode(uri.split("&")[0][20:]).encode("hex")
     229            info_hash = uri.split("&")[0][20:]
     230            if len(info_hash) == 32:
     231                #convert old style base32 encoded hash to hex encoded
     232                info_hash = base64.b32decode(info_hash).encode("hex")
    230233            if info_hash in self.infos:
    231234                log.debug("Torrent already in list!")
    232235                continue