Fix adding torrents by URL.
This commit is contained in:
parent
5a90f48ccb
commit
eaddaaa844
|
@ -283,7 +283,7 @@ class Core(
|
|||
# Return False because the torrent was not added successfully
|
||||
return False
|
||||
|
||||
def export_add_torrent_url(self, url, save_path):
|
||||
def export_add_torrent_url(self, url, save_path, options):
|
||||
log.info("Attempting to add url %s", url)
|
||||
|
||||
# Get the actual filename of the torrent from the url provided.
|
||||
|
@ -302,7 +302,8 @@ class Core(
|
|||
return False
|
||||
|
||||
# Add the torrent to session
|
||||
return self.export_add_torrent_file(filename, save_path, filedump)
|
||||
return self.export_add_torrent_file(
|
||||
filename, save_path, filedump, options)
|
||||
|
||||
def export_remove_torrent(self, torrent_id, remove_torrent, remove_data):
|
||||
log.debug("Removing torrent %s from the core.", torrent_id)
|
||||
|
|
|
@ -263,12 +263,12 @@ def add_torrent_file(torrent_files, torrent_options=None):
|
|||
# The torrent was not added successfully.
|
||||
log.warning("Torrent %s was not added successfully.", filename)
|
||||
|
||||
def add_torrent_url(torrent_url):
|
||||
def add_torrent_url(torrent_url, options=None):
|
||||
"""Adds torrents to the core via url"""
|
||||
from deluge.common import is_url
|
||||
if is_url(torrent_url):
|
||||
try:
|
||||
result = get_core().add_torrent_url(torrent_url, str())
|
||||
result = get_core().add_torrent_url(torrent_url, str(), options)
|
||||
except (AttributeError, socket.error):
|
||||
set_core_uri(None)
|
||||
result = False
|
||||
|
|
Loading…
Reference in New Issue