remove directory option in utorrent
doesn't behave as expected on windows
This commit is contained in:
1 parent
81dbc1ca79
commit
ccc2028690
2 files changed
+2
-13
No files matched your search
@@ -36,11 +36,6 @@ config = [{
|
|||||||
'name': 'label',
|
'name': 'label',
|
||||||
'description': 'Label to add torrent as.',
|
'description': 'Label to add torrent as.',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'name': 'directory',
|
|
||||||
'type': 'directory',
|
|
||||||
'description': 'Download to this directory. Keep empty for default uTorrent download directory.',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'name': 'remove_complete',
|
'name': 'remove_complete',
|
||||||
'label': 'Remove torrent',
|
'label': 'Remove torrent',
|
||||||
|
|||||||
@@ -92,12 +92,6 @@ class uTorrent(Downloader):
|
|||||||
if len(torrent_hash) == 32:
|
if len(torrent_hash) == 32:
|
||||||
torrent_hash = b16encode(b32decode(torrent_hash))
|
torrent_hash = b16encode(b32decode(torrent_hash))
|
||||||
|
|
||||||
# Set download directory
|
|
||||||
if self.conf('directory'):
|
|
||||||
directory = self.conf('directory')
|
|
||||||
else:
|
|
||||||
directory = False
|
|
||||||
|
|
||||||
# Send request to uTorrent
|
# Send request to uTorrent
|
||||||
if data.get('protocol') == 'torrent_magnet':
|
if data.get('protocol') == 'torrent_magnet':
|
||||||
self.utorrent_api.add_torrent_uri(torrent_filename, data.get('url'), directory)
|
self.utorrent_api.add_torrent_uri(torrent_filename, data.get('url'), directory)
|
||||||
@@ -256,13 +250,13 @@ class uTorrentAPI(object):
|
|||||||
def add_torrent_uri(self, filename, torrent, add_folder = False):
|
def add_torrent_uri(self, filename, torrent, add_folder = False):
|
||||||
action = "action=add-url&s=%s" % urllib.quote(torrent)
|
action = "action=add-url&s=%s" % urllib.quote(torrent)
|
||||||
if add_folder:
|
if add_folder:
|
||||||
action += "&path=%s" % urllib.quote(add_folder)
|
action += "&path=%s" % urllib.quote(filename)
|
||||||
return self._request(action)
|
return self._request(action)
|
||||||
|
|
||||||
def add_torrent_file(self, filename, filedata, add_folder = False):
|
def add_torrent_file(self, filename, filedata, add_folder = False):
|
||||||
action = "action=add-file"
|
action = "action=add-file"
|
||||||
if add_folder:
|
if add_folder:
|
||||||
action += "&path=%s" % urllib.quote(add_folder)
|
action += "&path=%s" % urllib.quote(filename)
|
||||||
return self._request(action, {"torrent_file": (ss(filename), filedata)})
|
return self._request(action, {"torrent_file": (ss(filename), filedata)})
|
||||||
|
|
||||||
def set_torrent(self, hash, params):
|
def set_torrent(self, hash, params):
|
||||||
|
|||||||
Reference in new issue
Block a user