mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
just return the deferred created by httpdownloader
This commit is contained in:
parent
a2893cc1b7
commit
3a94a33b56
1 changed files with 3 additions and 5 deletions
|
@ -441,13 +441,11 @@ class WebApi(JSONComponent):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
|
tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
|
||||||
d = Deferred()
|
return httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file)
|
||||||
httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file, d)
|
|
||||||
return d
|
|
||||||
|
|
||||||
def _on_torrent_downloaded(self, result, filename, d):
|
def _on_torrent_downloaded(self, result, filename):
|
||||||
log.debug("filename: %s", filename)
|
log.debug("filename: %s", filename)
|
||||||
d.callback(filename)
|
return filename
|
||||||
|
|
||||||
@export
|
@export
|
||||||
def get_torrent_info(self, filename):
|
def get_torrent_info(self, filename):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue