Merge pull request #2270 from fuzeman/feature/dev_rtorrent
rTorrent Downloader fixes
This commit is contained in:
commit
1da3546f2d
3 files changed
+10
-7
No files matched your search
@@ -117,6 +117,10 @@ class rTorrent(Downloader):
|
|||||||
# Send torrent to rTorrent
|
# Send torrent to rTorrent
|
||||||
torrent = self.rt.load_torrent(filedata)
|
torrent = self.rt.load_torrent(filedata)
|
||||||
|
|
||||||
|
if not torrent:
|
||||||
|
log.error('Unable to find the torrent, did it fail to load?')
|
||||||
|
return False
|
||||||
|
|
||||||
# Set label
|
# Set label
|
||||||
if self.conf('label'):
|
if self.conf('label'):
|
||||||
torrent.set_custom(1, self.conf('label'))
|
torrent.set_custom(1, self.conf('label'))
|
||||||
|
|||||||
@@ -71,12 +71,10 @@ class RTorrent:
|
|||||||
|
|
||||||
def _verify_conn(self):
|
def _verify_conn(self):
|
||||||
# check for rpc methods that should be available
|
# check for rpc methods that should be available
|
||||||
assert {"system.client_version",
|
assert "system.client_version" in self._get_rpc_methods(), "Required RPC method not available."
|
||||||
"system.library_version"}.issubset(set(self._get_rpc_methods())),\
|
assert "system.library_version" in self._get_rpc_methods(), "Required RPC method not available."
|
||||||
"Required RPC methods not available."
|
|
||||||
|
|
||||||
# minimum rTorrent version check
|
# minimum rTorrent version check
|
||||||
|
|
||||||
assert self._meets_version_requirement() is True,\
|
assert self._meets_version_requirement() is True,\
|
||||||
"Error: Minimum rTorrent version required is {0}".format(
|
"Error: Minimum rTorrent version required is {0}".format(
|
||||||
MIN_RTORRENT_VERSION_STR)
|
MIN_RTORRENT_VERSION_STR)
|
||||||
|
|||||||
@@ -90,9 +90,10 @@ class TorrentParser():
|
|||||||
def _calc_info_hash(self):
|
def _calc_info_hash(self):
|
||||||
self.info_hash = None
|
self.info_hash = None
|
||||||
if "info" in self._torrent_decoded.keys():
|
if "info" in self._torrent_decoded.keys():
|
||||||
info_dict = self._torrent_decoded["info"]
|
info_encoded = bencode.encode(self._torrent_decoded["info"])
|
||||||
self.info_hash = hashlib.sha1(bencode.encode(
|
|
||||||
info_dict)).hexdigest().upper()
|
if info_encoded:
|
||||||
|
self.info_hash = hashlib.sha1(info_encoded).hexdigest().upper()
|
||||||
|
|
||||||
return(self.info_hash)
|
return(self.info_hash)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user