mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
support for qbittorrent v5.0
This commit is contained in:
parent
470f611240
commit
b4669d7f7f
1 changed files with 24 additions and 6 deletions
|
@ -442,13 +442,19 @@ class Client(object):
|
||||||
|
|
||||||
:param infohash: INFO HASH of torrent.
|
:param infohash: INFO HASH of torrent.
|
||||||
"""
|
"""
|
||||||
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/stop', data={'hashes': infohash.lower()})
|
||||||
|
else:
|
||||||
return self._post('torrents/pause', data={'hashes': infohash.lower()})
|
return self._post('torrents/pause', data={'hashes': infohash.lower()})
|
||||||
|
|
||||||
def pause_all(self):
|
def pause_all(self):
|
||||||
"""
|
"""
|
||||||
Pause all torrents.
|
Pause all torrents.
|
||||||
"""
|
"""
|
||||||
return self._post('torrents/pause', data={'hashes': 'all'})
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/stop', data={'hashes': infohash.lower()})
|
||||||
|
else:
|
||||||
|
return self._post('torrents/pause', data={'hashes': infohash.lower()})
|
||||||
|
|
||||||
def pause_multiple(self, infohash_list):
|
def pause_multiple(self, infohash_list):
|
||||||
"""
|
"""
|
||||||
|
@ -457,6 +463,9 @@ class Client(object):
|
||||||
:param infohash_list: Single or list() of infohashes.
|
:param infohash_list: Single or list() of infohashes.
|
||||||
"""
|
"""
|
||||||
data = self._process_infohash_list(infohash_list)
|
data = self._process_infohash_list(infohash_list)
|
||||||
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/stop', data=data)
|
||||||
|
else:
|
||||||
return self._post('torrents/pause', data=data)
|
return self._post('torrents/pause', data=data)
|
||||||
|
|
||||||
def set_category(self, infohash_list, category):
|
def set_category(self, infohash_list, category):
|
||||||
|
@ -497,12 +506,18 @@ class Client(object):
|
||||||
|
|
||||||
:param infohash: INFO HASH of torrent.
|
:param infohash: INFO HASH of torrent.
|
||||||
"""
|
"""
|
||||||
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/start', data={'hashes': infohash.lower()})
|
||||||
|
else:
|
||||||
return self._post('torrents/resume', data={'hashes': infohash.lower()})
|
return self._post('torrents/resume', data={'hashes': infohash.lower()})
|
||||||
|
|
||||||
def resume_all(self):
|
def resume_all(self):
|
||||||
"""
|
"""
|
||||||
Resume all torrents.
|
Resume all torrents.
|
||||||
"""
|
"""
|
||||||
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/start', data={'hashes': 'all'})
|
||||||
|
else:
|
||||||
return self._post('torrents/resume', data={'hashes': 'all'})
|
return self._post('torrents/resume', data={'hashes': 'all'})
|
||||||
|
|
||||||
def resume_multiple(self, infohash_list):
|
def resume_multiple(self, infohash_list):
|
||||||
|
@ -512,6 +527,9 @@ class Client(object):
|
||||||
:param infohash_list: Single or list() of infohashes.
|
:param infohash_list: Single or list() of infohashes.
|
||||||
"""
|
"""
|
||||||
data = self._process_infohash_list(infohash_list)
|
data = self._process_infohash_list(infohash_list)
|
||||||
|
if self.api_version >= 5.0:
|
||||||
|
return self._post('torrents/start', data=data)
|
||||||
|
else:
|
||||||
return self._post('torrents/resume', data=data)
|
return self._post('torrents/resume', data=data)
|
||||||
|
|
||||||
def delete(self, infohash_list):
|
def delete(self, infohash_list):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue