Ticket #1074: hex_encoded_magnet_1_1.patch

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

     
    216216        new_row = None 
    217217 
    218218        for uri in uris: 
    219             info_hash = base64.b32decode(uri.split("&")[0][20:]).encode("hex") 
     219            info_hash = uri.split("&")[0][20:] 
     220            if len(info_hash) == 32: 
     221                #convert old style base32 encoded hash to hex encoded 
     222                info_hash = base64.b32decode(info_hash).encode("hex") 
    220223            if info_hash in self.infos: 
    221224                log.debug("Torrent already in list!") 
    222225                continue