From 6ded75caef3d9493ce41d0680e4911acf1277f6e Mon Sep 17 00:00:00 2001 From: John Garland Date: Fri, 30 Apr 2010 02:20:41 +1000 Subject: [PATCH] Remove no longer needed fetch_url --- deluge/common.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index 985773b2e..0cde41b0b 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -406,30 +406,6 @@ def is_magnet(uri): return True return False -def fetch_url(url): - """ - Downloads a torrent file from a given URL and checks the file's validity - - :param url: the url of the .torrent file to fetch - :type url: string - :returns: the filepath to the downloaded file - :rtype: string - - """ - import urllib - from deluge.log import LOG as log - try: - filename, headers = urllib.urlretrieve(url) - except IOError: - log.debug("Network error while trying to fetch torrent from %s", url) - else: - if filename.endswith(".torrent") or headers["content-type"] ==\ - "application/x-bittorrent": - return filename - else: - log.debug("URL doesn't appear to be a valid torrent file: %s", url) - return None - def create_magnet_uri(infohash, name=None, trackers=[]): """ Creates a magnet uri