Fix #299 preserve filename in gtkui when using 'add by url'

This commit is contained in:
Andrew Resch 2008-06-25 07:49:58 +00:00
parent 0d273690d5
commit 409a824d7d
1 changed files with 5 additions and 1 deletions

View File

@ -516,7 +516,11 @@ class AddTorrentDialog(component.Component):
def _download_from_url(self, url): def _download_from_url(self, url):
import urllib 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]) self.add_from_files([filename])
def _on_button_hash_clicked(self, widget): def _on_button_hash_clicked(self, widget):