mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 03:24:54 +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])
|
||||
d = Deferred()
|
||||
httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file, d)
|
||||
return d
|
||||
return httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file)
|
||||
|
||||
def _on_torrent_downloaded(self, result, filename, d):
|
||||
def _on_torrent_downloaded(self, result, filename):
|
||||
log.debug("filename: %s", filename)
|
||||
d.callback(filename)
|
||||
return filename
|
||||
|
||||
@export
|
||||
def get_torrent_info(self, filename):
|
||||
|
|
Loading…
Add table
Reference in a new issue