mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-24 10:18:51 +00:00
Remove no longer needed fetch_url
This commit is contained in:
parent
88929d4821
commit
6ded75caef
@ -406,30 +406,6 @@ def is_magnet(uri):
|
|||||||
return True
|
return True
|
||||||
return False
|
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=[]):
|
def create_magnet_uri(infohash, name=None, trackers=[]):
|
||||||
"""
|
"""
|
||||||
Creates a magnet uri
|
Creates a magnet uri
|
||||||
|
Loading…
x
Reference in New Issue
Block a user