Skip to content

Commit 3eef6ff

Browse files
committed
Be compatible with both the old and new module
The old transmissionrpc and new transmission-rpc has a few conflicts in argument name here and there, it tries to handle these conflicts.
1 parent 0d17bae commit 3eef6ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

transmission-trackers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Host, port, username and password to connect to Transmission
55
# Set user and pw to None if auth is not required
66
client = {
7-
'address': 'localhost',
7+
'host': 'localhost',
88
'port': 9091,
99
'user': 'admin',
1010
'password': 'passwd'
@@ -80,6 +80,9 @@
8080
import sys, os, time, socket
8181
try:
8282
from transmissionrpc import Client
83+
if 'host' in client:
84+
client['address'] = client['host']
85+
del client['host']
8386
except ImportError:
8487
try:
8588
from transmission_rpc import Client

0 commit comments

Comments
 (0)