From 409a824d7da1586b399a65fdac35b75f69d7072d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 25 Jun 2008 07:49:58 +0000 Subject: [PATCH] Fix #299 preserve filename in gtkui when using 'add by url' --- deluge/ui/gtkui/addtorrentdialog.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 17cffd73e..c243a2f6b 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -516,7 +516,11 @@ class AddTorrentDialog(component.Component): def _download_from_url(self, url): import urllib - filename, headers = urllib.urlretrieve(url) + import tempfile + import os.path + tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1]) + filename, headers = urllib.urlretrieve(url, tmp_file) + log.debug("filename: %s", filename) self.add_from_files([filename]) def _on_button_hash_clicked(self, widget):