Skip to content

Instantly share code, notes, and snippets.

@sparky3387
Created June 14, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sparky3387/58f294206595f1b571b24cdb02b0ddd0 to your computer and use it in GitHub Desktop.
Save sparky3387/58f294206595f1b571b24cdb02b0ddd0 to your computer and use it in GitHub Desktop.
rTorrent patch for mylar
diff --git a/lib/rtorrent/__init__.py b/lib/rtorrent/__init__.py
index 7044f71..1bd28b0 100644
--- a/lib/rtorrent/__init__.py
+++ b/lib/rtorrent/__init__.py
@@ -74,7 +74,9 @@ class RTorrent:
if m.is_retriever() and m.is_available(self)]
m = rtorrent.rpc.Multicall(self)
- m.add("d.multicall", view, "d.get_hash=",
+ # multicall2 wants .. something .. as its first argument. It accepts a blank string, so let's go with that.
+ MCFirstArg = ""
+ m.add("d.multicall2", MCFirstArg, view, "d.hash=",
*[method.rpc_call + "=" for method in retriever_methods])
results = m.call()[0] # only sent one call, only need first result
@@ -116,16 +118,16 @@ class RTorrent:
elif verbose:
func_name = "load_verbose"
else:
- func_name = "load"
+ func_name = "load.normal"
elif file_type in ["file", "raw"]:
if start and verbose:
- func_name = "load_raw_start_verbose"
+ func_name = "load.raw_start_verbose"
elif start:
- func_name = "load_raw_start"
+ func_name = "load.raw_start"
elif verbose:
- func_name = "load_raw_verbose"
+ func_name = "load.raw_verbose"
else:
- func_name = "load_raw"
+ func_name = "load.raw"
return(func_name)
@@ -136,38 +138,53 @@ class RTorrent:
info_hash = info_hash.upper()
func_name = self._get_load_function("url", start, verbose)
+ # rtorrent > 0.9.6 requires first parameter @target
+ target = ""
+
# load magnet
- getattr(p, func_name)(magneturl)
+ getattr(p, func_name)(target, magneturl)
if verify_load:
+ magnet = False
i = 0
torrent = None
while i < verify_retries:
- for tor in self.get_torrents():
- if tor.info_hash != info_hash:
- continue
- else:
- torrent = tor
+ for m in self.get_torrents():
+ # This block finds the magnet that was just added, starts it, breaks
+ # out of the for loop, and then out of the while loop.
+ # If it can't find the magnet, magnet won't get defined.
+ if m.info_hash == info_hash:
+ magnet = m
+ magnet.start()
+ i += 999
break
- if torrent is not None:
- break
- time.sleep(1)
- i += 1
- # Resolve magnet to torrent
- torrent.start()
+ # If torrent hasn't been defined, sleep for a second and check again.
+ if not magnet:
+ time.sleep(1)
+ i += 1
+
- assert info_hash in [t.info_hash for t in self.torrents],\
- "Adding magnet was unsuccessful."
+ # This bit waits for the magnet to be resolved into an actual
+ # torrent, and then starts it.
+ torrent = False
i = 0
while i < verify_retries:
- for torrent in self.get_torrents():
- if torrent.info_hash == info_hash:
- if str(info_hash) not in str(torrent.name):
- time.sleep(1)
- i += 1
+ for t in self.get_torrents():
+ if t.info_hash == info_hash:
+ if str(info_hash) not in str(t.name):
+ torrent = t
+ torrent.start()
+ i += 999
+ break
+ if not torrent:
+ time.sleep(1)
+ i += 1
+
+ assert info_hash in [t.info_hash for t in self.torrents],\
+ "Adding magnet was unsuccessful."
return(torrent)
@@ -213,7 +230,9 @@ class RTorrent:
func_name = self._get_load_function("raw", start, verbose)
# load torrent
- getattr(p, func_name)(torrent)
+ # rtorrent > 0.9.6 requires first parameter @target
+ target = ""
+ getattr(p, func_name)(target, torrent)
if verify_load:
i = 0
diff --git a/lib/rtorrent/file.py b/lib/rtorrent/file.py
index a3db35c..758ed76 100644
--- a/lib/rtorrent/file.py
+++ b/lib/rtorrent/file.py
@@ -59,29 +59,29 @@ class File:
methods = [
# RETRIEVERS
- Method(File, 'get_last_touched', 'f.get_last_touched'),
- Method(File, 'get_range_second', 'f.get_range_second'),
- Method(File, 'get_size_bytes', 'f.get_size_bytes'),
- Method(File, 'get_priority', 'f.get_priority'),
- Method(File, 'get_match_depth_next', 'f.get_match_depth_next'),
+ Method(File, 'get_last_touched', 'f.last_touched'),
+ Method(File, 'get_range_second', 'f.range_second'),
+ Method(File, 'get_size_bytes', 'f.size_bytes'),
+ Method(File, 'get_priority', 'f.priority'),
+ Method(File, 'get_match_depth_next', 'f.match_depth_next'),
Method(File, 'is_resize_queued', 'f.is_resize_queued',
boolean=True,
),
- Method(File, 'get_range_first', 'f.get_range_first'),
- Method(File, 'get_match_depth_prev', 'f.get_match_depth_prev'),
- Method(File, 'get_path', 'f.get_path'),
- Method(File, 'get_completed_chunks', 'f.get_completed_chunks'),
- Method(File, 'get_path_components', 'f.get_path_components'),
+ Method(File, 'get_range_first', 'f.range_first'),
+ Method(File, 'get_match_depth_prev', 'f.match_depth_prev'),
+ Method(File, 'get_path', 'f.path'),
+ Method(File, 'get_completed_chunks', 'f.completed_chunks'),
+ Method(File, 'get_path_components', 'f.path_components'),
Method(File, 'is_created', 'f.is_created',
boolean=True,
),
Method(File, 'is_open', 'f.is_open',
boolean=True,
),
- Method(File, 'get_size_chunks', 'f.get_size_chunks'),
- Method(File, 'get_offset', 'f.get_offset'),
- Method(File, 'get_frozen_path', 'f.get_frozen_path'),
- Method(File, 'get_path_depth', 'f.get_path_depth'),
+ Method(File, 'get_size_chunks', 'f.size_chunks'),
+ Method(File, 'get_offset', 'f.offset'),
+ Method(File, 'get_frozen_path', 'f.frozen_path'),
+ Method(File, 'get_path_depth', 'f.path_depth'),
Method(File, 'is_create_queued', 'f.is_create_queued',
boolean=True,
),
diff --git a/lib/rtorrent/peer.py b/lib/rtorrent/peer.py
index 61ca094..f998812 100644
--- a/lib/rtorrent/peer.py
+++ b/lib/rtorrent/peer.py
@@ -60,39 +60,39 @@ methods = [
Method(Peer, 'is_preferred', 'p.is_preferred',
boolean=True,
),
- Method(Peer, 'get_down_rate', 'p.get_down_rate'),
+ Method(Peer, 'get_down_rate', 'p.down_rate'),
Method(Peer, 'is_unwanted', 'p.is_unwanted',
boolean=True,
),
- Method(Peer, 'get_peer_total', 'p.get_peer_total'),
- Method(Peer, 'get_peer_rate', 'p.get_peer_rate'),
- Method(Peer, 'get_port', 'p.get_port'),
+ Method(Peer, 'get_peer_total', 'p.peer_total'),
+ Method(Peer, 'get_peer_rate', 'p.peer_rate'),
+ Method(Peer, 'get_port', 'p.port'),
Method(Peer, 'is_snubbed', 'p.is_snubbed',
boolean=True,
),
- Method(Peer, 'get_id_html', 'p.get_id_html'),
- Method(Peer, 'get_up_rate', 'p.get_up_rate'),
+ Method(Peer, 'get_id_html', 'p.id_html'),
+ Method(Peer, 'get_up_rate', 'p.up_rate'),
Method(Peer, 'is_banned', 'p.banned',
boolean=True,
),
- Method(Peer, 'get_completed_percent', 'p.get_completed_percent'),
+ Method(Peer, 'get_completed_percent', 'p.completed_percent'),
Method(Peer, 'completed_percent', 'p.completed_percent'),
- Method(Peer, 'get_id', 'p.get_id'),
+ Method(Peer, 'get_id', 'p.id'),
Method(Peer, 'is_obfuscated', 'p.is_obfuscated',
boolean=True,
),
- Method(Peer, 'get_down_total', 'p.get_down_total'),
- Method(Peer, 'get_client_version', 'p.get_client_version'),
- Method(Peer, 'get_address', 'p.get_address'),
+ Method(Peer, 'get.down.total', 'p.down_total'),
+ Method(Peer, 'get_client_version', 'p.client_version'),
+ Method(Peer, 'get_address', 'p.address'),
Method(Peer, 'is_incoming', 'p.is_incoming',
boolean=True,
),
Method(Peer, 'is_encrypted', 'p.is_encrypted',
boolean=True,
),
- Method(Peer, 'get_options_str', 'p.get_options_str'),
+ Method(Peer, 'get_options_str', 'p.options_str'),
Method(Peer, 'get_client_version', 'p.client_version'),
- Method(Peer, 'get_up_total', 'p.get_up_total'),
+ Method(Peer, 'get_up_total', 'p.up_total'),
# MODIFIERS
]
diff --git a/lib/rtorrent/rpc/__init__.py b/lib/rtorrent/rpc/__init__.py
index 607d409..e294a72 100644
--- a/lib/rtorrent/rpc/__init__.py
+++ b/lib/rtorrent/rpc/__init__.py
@@ -38,13 +38,13 @@ def get_varname(rpc_call):
r = re.search(
"([ptdf]\.|system\.|get\_|is\_|set\_)+([^=]*)", rpc_call, re.I)
if r:
- return(r.groups()[-1])
+ return(r.groups()[-1].replace(".","_"))
else:
return(None)
def _handle_unavailable_rpc_method(method, rt_obj):
- msg = "Method isn't available."
+ msg = "Method " + str(method) + " isn't available."
if rt_obj.connection._get_client_version_tuple() < method.min_version:
msg = "This method is only available in " \
"RTorrent version v{0} or later".format(
@@ -91,7 +91,7 @@ class Method:
def _get_method_type(self):
"""Determine whether method is a modifier or a retriever"""
- if self.method_name[:4] == "set_": return('m') # modifier
+ if self.method_name[:4] == "set_" or self.method_name[-4:] == ".set": return('m') # modifier
else:
return('r') # retriever
diff --git a/lib/rtorrent/torrent.py b/lib/rtorrent/torrent.py
index bd6bb68..f4f1406 100644
--- a/lib/rtorrent/torrent.py
+++ b/lib/rtorrent/torrent.py
@@ -139,7 +139,7 @@ class Torrent:
results = m.call()[0] # only sent one call, only need first result
offset_method_index = retriever_methods.index(
- rtorrent.rpc.find_method("f.get_offset"))
+ rtorrent.rpc.find_method("f.offset"))
# make a list of the offsets of all the files, sort appropriately
offset_list = sorted([r[offset_method_index] for r in results])
@@ -168,7 +168,7 @@ class Torrent:
"""
m = rtorrent.rpc.Multicall(self)
self.multicall_add(m, "d.try_stop")
- self.multicall_add(m, "d.set_directory", d)
+ self.multicall_add(m, "d.directory.set", d)
self.directory = m.call()[-1]
@@ -181,7 +181,7 @@ class Torrent:
"""
m = rtorrent.rpc.Multicall(self)
self.multicall_add(m, "d.try_stop")
- self.multicall_add(m, "d.set_directory_base", d)
+ self.multicall_add(m, "d.directory_base.set", d)
def start(self):
"""Start the torrent"""
@@ -304,7 +304,7 @@ class Torrent:
m = rtorrent.rpc.Multicall(self)
field = "custom{0}".format(key)
- self.multicall_add(m, "d.get_{0}".format(field))
+ self.multicall_add(m, "d.{0}".format(field))
setattr(self, field, m.call()[-1])
return (getattr(self, field))
@@ -326,7 +326,7 @@ class Torrent:
self._assert_custom_key_valid(key)
m = rtorrent.rpc.Multicall(self)
- self.multicall_add(m, "d.set_custom{0}".format(key), value)
+ self.multicall_add(m, "d.custom{0}.set".format(key), value)
return(m.call()[-1])
@@ -355,7 +355,7 @@ class Torrent:
@note: Variable where the result for this method is stored Torrent.hash_checking_queued"""
m = rtorrent.rpc.Multicall(self)
- self.multicall_add(m, "d.get_hashing")
+ self.multicall_add(m, "d.hashing")
self.multicall_add(m, "d.is_hash_checking")
results = m.call()
@@ -397,86 +397,86 @@ methods = [
Method(Torrent, 'is_hash_checking', 'd.is_hash_checking',
boolean=True,
),
- Method(Torrent, 'get_peers_max', 'd.get_peers_max'),
- Method(Torrent, 'get_tracker_focus', 'd.get_tracker_focus'),
- Method(Torrent, 'get_skip_total', 'd.get_skip_total'),
- Method(Torrent, 'get_state', 'd.get_state'),
- Method(Torrent, 'get_peer_exchange', 'd.get_peer_exchange'),
- Method(Torrent, 'get_down_rate', 'd.get_down_rate'),
- Method(Torrent, 'get_connection_seed', 'd.get_connection_seed'),
- Method(Torrent, 'get_uploads_max', 'd.get_uploads_max'),
- Method(Torrent, 'get_priority_str', 'd.get_priority_str'),
+ Method(Torrent, 'get_peers_max', 'd.peers_max'),
+ Method(Torrent, 'get_tracker_focus', 'd.tracker_focus'),
+ Method(Torrent, 'get_skip_total', 'd.skip.total'),
+ Method(Torrent, 'get_state', 'd.state'),
+ Method(Torrent, 'get_peer_exchange', 'd.peer_exchange'),
+ Method(Torrent, 'get_down_rate', 'd.down.rate'),
+ Method(Torrent, 'get_connection_seed', 'd.connection_seed'),
+ Method(Torrent, 'get_uploads_max', 'd.uploads_max'),
+ Method(Torrent, 'get_priority_str', 'd.priority_str'),
Method(Torrent, 'is_open', 'd.is_open',
boolean=True,
),
- Method(Torrent, 'get_peers_min', 'd.get_peers_min'),
- Method(Torrent, 'get_peers_complete', 'd.get_peers_complete'),
- Method(Torrent, 'get_tracker_numwant', 'd.get_tracker_numwant'),
- Method(Torrent, 'get_connection_current', 'd.get_connection_current'),
- Method(Torrent, 'is_complete', 'd.get_complete',
+ Method(Torrent, 'get_peers_min', 'd.peers_min'),
+ Method(Torrent, 'get_peers_complete', 'd.peers_complete'),
+ Method(Torrent, 'get_tracker_numwant', 'd.tracker_numwant'),
+ Method(Torrent, 'get_connection_current', 'd.connection_current'),
+ Method(Torrent, 'is_complete', 'd.complete',
boolean=True,
),
- Method(Torrent, 'get_peers_connected', 'd.get_peers_connected'),
- Method(Torrent, 'get_chunk_size', 'd.get_chunk_size'),
- Method(Torrent, 'get_state_counter', 'd.get_state_counter'),
- Method(Torrent, 'get_base_filename', 'd.get_base_filename'),
- Method(Torrent, 'get_state_changed', 'd.get_state_changed'),
- Method(Torrent, 'get_peers_not_connected', 'd.get_peers_not_connected'),
- Method(Torrent, 'get_directory', 'd.get_directory'),
+ Method(Torrent, 'get_peers_connected', 'd.peers_connected'),
+ Method(Torrent, 'get_chunk_size', 'd.chunk_size'),
+ Method(Torrent, 'get_state_counter', 'd.state_counter'),
+ Method(Torrent, 'get_base_filename', 'd.base_filename'),
+ Method(Torrent, 'get_state_changed', 'd.state_changed'),
+ Method(Torrent, 'get_peers_not_connected', 'd.peers_not_connected'),
+ Method(Torrent, 'get_directory', 'd.directory'),
Method(Torrent, 'is_incomplete', 'd.incomplete',
boolean=True,
),
- Method(Torrent, 'get_tracker_size', 'd.get_tracker_size'),
+ Method(Torrent, 'get_tracker_size', 'd.tracker_size'),
Method(Torrent, 'is_multi_file', 'd.is_multi_file',
boolean=True,
),
- Method(Torrent, 'get_local_id', 'd.get_local_id'),
- Method(Torrent, 'get_ratio', 'd.get_ratio',
+ Method(Torrent, 'get_local_id', 'd.local_id'),
+ Method(Torrent, 'get_ratio', 'd.ratio',
post_process_func=lambda x: x / 1000.0,
),
- Method(Torrent, 'get_loaded_file', 'd.get_loaded_file'),
- Method(Torrent, 'get_max_file_size', 'd.get_max_file_size'),
- Method(Torrent, 'get_size_chunks', 'd.get_size_chunks'),
+ Method(Torrent, 'get_loaded_file', 'd.loaded_file'),
+ Method(Torrent, 'get_max_file_size', 'd.max_file_size'),
+ Method(Torrent, 'get_size_chunks', 'd.size_chunks'),
Method(Torrent, 'is_pex_active', 'd.is_pex_active',
boolean=True,
),
- Method(Torrent, 'get_hashing', 'd.get_hashing'),
- Method(Torrent, 'get_bitfield', 'd.get_bitfield'),
- Method(Torrent, 'get_local_id_html', 'd.get_local_id_html'),
- Method(Torrent, 'get_connection_leech', 'd.get_connection_leech'),
- Method(Torrent, 'get_peers_accounted', 'd.get_peers_accounted'),
- Method(Torrent, 'get_message', 'd.get_message'),
+ Method(Torrent, 'get_hashing', 'd.hashing'),
+ Method(Torrent, 'get_bitfield', 'd.bitfield'),
+ Method(Torrent, 'get_local_id_html', 'd.local_id_html'),
+ Method(Torrent, 'get_connection_leech', 'd.connection_leech'),
+ Method(Torrent, 'get_peers_accounted', 'd.peers_accounted'),
+ Method(Torrent, 'get_message', 'd.message'),
Method(Torrent, 'is_active', 'd.is_active',
boolean=True,
),
- Method(Torrent, 'get_size_bytes', 'd.get_size_bytes'),
- Method(Torrent, 'get_ignore_commands', 'd.get_ignore_commands'),
- Method(Torrent, 'get_creation_date', 'd.get_creation_date'),
- Method(Torrent, 'get_base_path', 'd.get_base_path'),
- Method(Torrent, 'get_left_bytes', 'd.get_left_bytes'),
- Method(Torrent, 'get_size_files', 'd.get_size_files'),
- Method(Torrent, 'get_size_pex', 'd.get_size_pex'),
+ Method(Torrent, 'get_size_bytes', 'd.size_bytes'),
+ Method(Torrent, 'get_ignore_commands', 'd.ignore_commands'),
+ Method(Torrent, 'get_creation_date', 'd.creation_date'),
+ Method(Torrent, 'get_base_path', 'd.base_path'),
+ Method(Torrent, 'get_left_bytes', 'd.left_bytes'),
+ Method(Torrent, 'get_size_files', 'd.size_files'),
+ Method(Torrent, 'get_size_pex', 'd.size_pex'),
Method(Torrent, 'is_private', 'd.is_private',
boolean=True,
),
- Method(Torrent, 'get_max_size_pex', 'd.get_max_size_pex'),
- Method(Torrent, 'get_num_chunks_hashed', 'd.get_chunks_hashed',
+ Method(Torrent, 'get_max_size_pex', 'd.max_size_pex'),
+ Method(Torrent, 'get_num_chunks_hashed', 'd.chunks_hashed',
aliases=("get_chunks_hashed",)),
Method(Torrent, 'get_num_chunks_wanted', 'd.wanted_chunks'),
- Method(Torrent, 'get_priority', 'd.get_priority'),
- Method(Torrent, 'get_skip_rate', 'd.get_skip_rate'),
- Method(Torrent, 'get_completed_bytes', 'd.get_completed_bytes'),
- Method(Torrent, 'get_name', 'd.get_name'),
- Method(Torrent, 'get_completed_chunks', 'd.get_completed_chunks'),
- Method(Torrent, 'get_throttle_name', 'd.get_throttle_name'),
- Method(Torrent, 'get_free_diskspace', 'd.get_free_diskspace'),
- Method(Torrent, 'get_directory_base', 'd.get_directory_base'),
- Method(Torrent, 'get_hashing_failed', 'd.get_hashing_failed'),
- Method(Torrent, 'get_tied_to_file', 'd.get_tied_to_file'),
- Method(Torrent, 'get_down_total', 'd.get_down_total'),
- Method(Torrent, 'get_bytes_done', 'd.get_bytes_done'),
- Method(Torrent, 'get_up_rate', 'd.get_up_rate'),
- Method(Torrent, 'get_up_total', 'd.get_up_total'),
+ Method(Torrent, 'get_priority', 'd.priority'),
+ Method(Torrent, 'get_skip_rate', 'd.skip.rate'),
+ Method(Torrent, 'get_completed_bytes', 'd.completed_bytes'),
+ Method(Torrent, 'get_name', 'd.name'),
+ Method(Torrent, 'get_completed_chunks', 'd.completed_chunks'),
+ Method(Torrent, 'get_throttle_name', 'd.throttle_name'),
+ Method(Torrent, 'get_free_diskspace', 'd.free_diskspace'),
+ Method(Torrent, 'get_directory_base', 'd.directory_base'),
+ Method(Torrent, 'get_hashing_failed', 'd.hashing_failed'),
+ Method(Torrent, 'get_tied_to_file', 'd.tied_to_file'),
+ Method(Torrent, 'get_down_total', 'd.down.total'),
+ Method(Torrent, 'get_bytes_done', 'd.bytes_done'),
+ Method(Torrent, 'get_up_rate', 'd.up.rate'),
+ Method(Torrent, 'get_up_total', 'd.up.total'),
Method(Torrent, 'is_accepting_seeders', 'd.accepting_seeders',
boolean=True,
),
@@ -490,28 +490,28 @@ methods = [
boolean=True,
),
Method(Torrent, "get_time_started", "d.timestamp.started"),
- Method(Torrent, "get_custom1", "d.get_custom1"),
- Method(Torrent, "get_custom2", "d.get_custom2"),
- Method(Torrent, "get_custom3", "d.get_custom3"),
- Method(Torrent, "get_custom4", "d.get_custom4"),
- Method(Torrent, "get_custom5", "d.get_custom5"),
+ Method(Torrent, "get_custom1", "d.custom1"),
+ Method(Torrent, "get_custom2", "d.custom2"),
+ Method(Torrent, "get_custom3", "d.custom3"),
+ Method(Torrent, "get_custom4", "d.custom4"),
+ Method(Torrent, "get_custom5", "d.custom5"),
# MODIFIERS
- Method(Torrent, 'set_uploads_max', 'd.set_uploads_max'),
- Method(Torrent, 'set_tied_to_file', 'd.set_tied_to_file'),
- Method(Torrent, 'set_tracker_numwant', 'd.set_tracker_numwant'),
- Method(Torrent, 'set_priority', 'd.set_priority'),
- Method(Torrent, 'set_peers_max', 'd.set_peers_max'),
- Method(Torrent, 'set_hashing_failed', 'd.set_hashing_failed'),
- Method(Torrent, 'set_message', 'd.set_message'),
- Method(Torrent, 'set_throttle_name', 'd.set_throttle_name'),
- Method(Torrent, 'set_peers_min', 'd.set_peers_min'),
- Method(Torrent, 'set_ignore_commands', 'd.set_ignore_commands'),
- Method(Torrent, 'set_max_file_size', 'd.set_max_file_size'),
- Method(Torrent, 'set_custom5', 'd.set_custom5'),
- Method(Torrent, 'set_custom4', 'd.set_custom4'),
- Method(Torrent, 'set_custom2', 'd.set_custom2'),
- Method(Torrent, 'set_custom1', 'd.set_custom1'),
- Method(Torrent, 'set_custom3', 'd.set_custom3'),
- Method(Torrent, 'set_connection_current', 'd.set_connection_current'),
+ Method(Torrent, 'set_uploads_max', 'd.uploads_max.set'),
+ Method(Torrent, 'set_tied_to_file', 'd.tied_to_file.set'),
+ Method(Torrent, 'set_tracker_numwant', 'd.tracker_numwant.set'),
+ Method(Torrent, 'set_priority', 'd.priority.set'),
+ Method(Torrent, 'set_peers_max', 'd.peers_max.set'),
+ Method(Torrent, 'set_hashing_failed', 'd.hashing_failed.set'),
+ Method(Torrent, 'set_message', 'd.message.set'),
+ Method(Torrent, 'set_throttle_name', 'd.throttle_name.set'),
+ Method(Torrent, 'set_peers_min', 'd.peers_min.set'),
+ Method(Torrent, 'set_ignore_commands', 'd.ignore_commands.set'),
+ Method(Torrent, 'set_max_file_size', 'd.max_file_size.set'),
+ Method(Torrent, 'set_custom5', 'd.custom5.set'),
+ Method(Torrent, 'set_custom4', 'd.custom4.set'),
+ Method(Torrent, 'set_custom2', 'd.custom2.set'),
+ Method(Torrent, 'set_custom1', 'd.custom1.set'),
+ Method(Torrent, 'set_custom3', 'd.custom3.set'),
+ Method(Torrent, 'set_connection_current', 'd.connection_current.set'),
]
diff --git a/lib/rtorrent/tracker.py b/lib/rtorrent/tracker.py
index 81af2e4..03cec4b 100644
--- a/lib/rtorrent/tracker.py
+++ b/lib/rtorrent/tracker.py
@@ -70,17 +70,17 @@ class Tracker:
methods = [
# RETRIEVERS
Method(Tracker, 'is_enabled', 't.is_enabled', boolean=True),
- Method(Tracker, 'get_id', 't.get_id'),
- Method(Tracker, 'get_scrape_incomplete', 't.get_scrape_incomplete'),
+ Method(Tracker, 'get_id', 't.id'),
+ Method(Tracker, 'get_scrape_incomplete', 't.scrape_incomplete'),
Method(Tracker, 'is_open', 't.is_open', boolean=True),
- Method(Tracker, 'get_min_interval', 't.get_min_interval'),
- Method(Tracker, 'get_scrape_downloaded', 't.get_scrape_downloaded'),
- Method(Tracker, 'get_group', 't.get_group'),
- Method(Tracker, 'get_scrape_time_last', 't.get_scrape_time_last'),
- Method(Tracker, 'get_type', 't.get_type'),
- Method(Tracker, 'get_normal_interval', 't.get_normal_interval'),
- Method(Tracker, 'get_url', 't.get_url'),
- Method(Tracker, 'get_scrape_complete', 't.get_scrape_complete',
+ Method(Tracker, 'get_min_interval', 't.min_interval'),
+ Method(Tracker, 'get_scrape_downloaded', 't.scrape_downloaded'),
+ Method(Tracker, 'get_group', 't.group'),
+ Method(Tracker, 'get_scrape_time_last', 't.scrape_time_last'),
+ Method(Tracker, 'get_type', 't.type'),
+ Method(Tracker, 'get_normal_interval', 't.normal_interval'),
+ Method(Tracker, 'get_url', 't.url'),
+ Method(Tracker, 'get_scrape_complete', 't.scrape_complete',
min_version=(0, 8, 9),
),
Method(Tracker, 'get_activity_time_last', 't.activity_time_last',
@@ -134,5 +134,5 @@ methods = [
),
# MODIFIERS
- Method(Tracker, 'set_enabled', 't.set_enabled'),
+ Method(Tracker, 'set_enabled', 't.is_enabled.set'),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment