diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 516796a2a..8f52c362b 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -226,7 +226,11 @@ class AddTorrentDialog(component.Component): new_row = None for uri in uris: - info_hash = base64.b32decode(uri.split("&")[0][20:]).encode("hex") + s = uri.split("&")[0][20:] + if len(s) == 32: + info_hash = base64.b32decode(s).encode("hex") + elif len(s) == 40: + info_hash = s if info_hash in self.infos: log.debug("Torrent already in list!") continue diff --git a/deluge/ui/gtkui/ipcinterface.py b/deluge/ui/gtkui/ipcinterface.py index 046073399..e86c4501a 100644 --- a/deluge/ui/gtkui/ipcinterface.py +++ b/deluge/ui/gtkui/ipcinterface.py @@ -71,7 +71,9 @@ class IPCInterface(component.Component): _args = [] for arg in args: if arg.strip(): - _args.append(os.path.abspath(arg)) + if not deluge.common.is_magnet(arg) and not deluge.common.is_url(arg): + arg = os.path.abspath(arg) + _args.append(arg) args = _args socket = os.path.join(deluge.configmanager.get_config_dir("ipc"), "deluge-gtk")