mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
Fix adding torrents by URL.
This commit is contained in:
parent
5a90f48ccb
commit
eaddaaa844
2 changed files with 5 additions and 4 deletions
|
@ -283,7 +283,7 @@ class Core(
|
||||||
# Return False because the torrent was not added successfully
|
# Return False because the torrent was not added successfully
|
||||||
return False
|
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)
|
log.info("Attempting to add url %s", url)
|
||||||
|
|
||||||
# Get the actual filename of the torrent from the url provided.
|
# Get the actual filename of the torrent from the url provided.
|
||||||
|
@ -302,7 +302,8 @@ class Core(
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Add the torrent to session
|
# 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):
|
def export_remove_torrent(self, torrent_id, remove_torrent, remove_data):
|
||||||
log.debug("Removing torrent %s from the core.", torrent_id)
|
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.
|
# The torrent was not added successfully.
|
||||||
log.warning("Torrent %s was not added successfully.", filename)
|
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"""
|
"""Adds torrents to the core via url"""
|
||||||
from deluge.common import is_url
|
from deluge.common import is_url
|
||||||
if is_url(torrent_url):
|
if is_url(torrent_url):
|
||||||
try:
|
try:
|
||||||
result = get_core().add_torrent_url(torrent_url, str())
|
result = get_core().add_torrent_url(torrent_url, str(), options)
|
||||||
except (AttributeError, socket.error):
|
except (AttributeError, socket.error):
|
||||||
set_core_uri(None)
|
set_core_uri(None)
|
||||||
result = False
|
result = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue