uTorrent WebUI command line utility and library for Python 3 (Page 2) / Web API / µTorrent Community Forums
 

#26 2010-12-29 02:50:19

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Fixed torrent sorting broken by previous changes and improved recheck logic, it now automatically stops torrents before recheck and starts (if required) after.

Offline

#27 2011-01-18 00:47:16

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Version supporting newer builds of µTorrent Linux server was just committed. Please note that older builds are no longer supported. Also there were API changes because of that.

Offline

#28 2011-02-05 02:05:59

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Added support for downloaded whole torrent, not just single files

Offline

#29 2011-02-09 00:41:02

monica2587
Member

Re: uTorrent WebUI command line utility and library for Python 3

Thank you for the script. I am seeing a problem when using the script.
command:

utorrentctl.py --settings

exception:

Traceback (most recent call last):
  File "C:\heap\deploy\twistedfall-utorrentctl-53c39f3\utorrentctl.py", line 664, in _get_data
    resp = self.getresponse()
  File "C:\Python31\lib\http\client.py", line 1033, in getresponse
    response.begin()
  File "C:\Python31\lib\http\client.py", line 347, in begin
    version, status, reason = self._read_status()
  File "C:\Python31\lib\http\client.py", line 303, in _read_status
    line = str(self.fp.readline(), "iso-8859-1")
  File "C:\Python31\lib\socket.py", line 228, in readinto
    return self._sock.recv_into(b)
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\heap\deploy\twistedfall-utorrentctl-53c39f3\utorrentctl.py", line 1306, in <module>
    utorrent = uTorrentConnection( opts.host, opts.user, opts.password ).utorrent()
  File "C:\heap\deploy\twistedfall-utorrentctl-53c39f3\utorrentctl.py", line 765, in utorrent
    ver = Version( self.do_action( "getversion", retry = False ) )
  File "C:\heap\deploy\twistedfall-utorrentctl-53c39f3\utorrentctl.py", line 757, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = data, retry = retry, save_buffer = save_buffer, progr
ess_cb = progress_cb )
  File "C:\heap\deploy\twistedfall-utorrentctl-53c39f3\utorrentctl.py", line 699, in _get_data
    elif e.args[0] == errno.ECONNREFUSED:
AttributeError: 'int' object has no attribute 'args'

I have WebUI and uTorrent up and running on my host. Can you please help me get around this?

Oh and I'm trying this on Windows Server 2003. Thanks!

Last edited by monica2587 (2011-02-09 00:42:04)

Offline

#30 2011-02-09 00:50:31

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

> socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host

It seems that you don't have access to the remote host running uTorrent. Can you connect to it via web browser? If yes, did you specify connection parameters of utorrentctl correctly? Did you use config.py file or pass arguments via command line?

Last edited by twistedfall (2011-02-09 00:52:09)

Offline

#31 2011-02-09 23:19:57

monica2587
Member

Re: uTorrent WebUI command line utility and library for Python 3

Yes. I used config.py to pass arguments. and I can connect to the WebUI via browser for the client. However, when executing from command line I get the exception repeatedly. Any suggestions?

Thanks!

Offline

#32 2011-02-10 00:28:09

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Could you show me your config file? (hostname and password hidden of course smile )

Like that:

#!/usr/bin/env python3

# default username and password
utorrentcfg = {
        'host' : '<hostname>:16006',
        'login' : 'utorrent',
        'password' : '<password>'
}

Offline

#33 2011-02-10 09:19:28

monica2587
Member

Re: uTorrent WebUI command line utility and library for Python 3

sure- here goes:

#!/usr/bin/env python3

# default username and password
utorrentcfg = {
    'host' : '<ip>:19762',
    'login' : 'test',
    'password' : 'test'
}

i hit the web ui with this url: http://<ip>:19762/gui/

Offline

#34 2011-02-10 23:25:26

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Well then. Could you try running

telnet <ip> 19762

and paste here its output?

Offline

#35 2011-03-04 23:28:20

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Bump newest linux server version support

Offline

#36 2011-03-05 05:24:00

utorrential31337
Member

Re: uTorrent WebUI command line utility and library for Python 3

Thanks for sharing your work with everyone.

I'm experiencing exactly the same issue as monica2587, and this issue seems to be related to accessing a machine from the same host utorrent is running on.

Here is my error:

C:\utorrentctl>utorrentctl.py -l -c
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 668, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 308, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python32\lib\socket.py", line 273, in readinto
    return self._sock.recv_into(b)
socket.error: [Errno 10054] An existing connection was forcibly closed by the re
mote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1311, in <module>
    utorrent = uTorrentConnection( opts.host, opts.user, opts.password ).utorren
t()
  File "C:\utorrentctl\utorrentctl.py", line 769, in utorrent
    ver = Version( self.do_action( "getversion", retry = False ) )
  File "C:\utorrentctl\utorrentctl.py", line 761, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = dat
a, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 703, in _get_data
    elif e.args[0] == errno.ECONNREFUSED:
AttributeError: 'int' object has no attribute 'args'

C:\utorrentctl>

Config.py

#!/usr/bin/env python3

# default username and password
utorrentcfg = {
    'host' : 'localhost:3391',
    'login' : 'user',
    'password' : 'nopass'
}

Telnet localhost 3391 connects and gives me a blinking cursor, although it can take 3-4 seconds before the cursor pops up.

I've tried localhost:3391, machinename:3391, 127.0.0.1:3391.  I've tried using the config.py, I've tried using the command line, it makes no difference.

C:\utorrentctl>utorrentctl.py -H localhost:3391 -U user -P nopass -c -l
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 668, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 308, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python32\lib\socket.py", line 273, in readinto
    return self._sock.recv_into(b)
socket.error: [Errno 10054] An existing connection was forcibly closed by the re
mote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1311, in <module>
    utorrent = uTorrentConnection( opts.host, opts.user, opts.password ).utorren
t()
  File "C:\utorrentctl\utorrentctl.py", line 769, in utorrent
    ver = Version( self.do_action( "getversion", retry = False ) )
  File "C:\utorrentctl\utorrentctl.py", line 761, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = dat
a, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 703, in _get_data
    elif e.args[0] == errno.ECONNREFUSED:
AttributeError: 'int' object has no attribute 'args'

C:\utorrentctl>

I've allowed python.exe and pythonw.exe through the firewall. (didn't work)  I disabled windows firewall completely. (didn't work)

I turned webui.auth token on and off, it didn't help.

The script works from a different pc on my network.  (A server 2003 SP1 machine with 32bit python)

Machine that doesn't work with script, which is also running the uTorrent I want to connect to:
OS: Server 2008 R2 SP1 (x64)
Python: 3.2 x64 bit (latest)
uTorrent: 2.2.23703

Offline

#37 2011-03-05 06:12:15

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

I have implemented some changes that might help. Please try running the latest version ( https://github.com/twistedfall/utorrent … rentctl.py )

Offline

#38 2011-03-05 07:04:09

utorrential31337
Member

Re: uTorrent WebUI command line utility and library for Python 3

It seems to have improved access from the remote machine, esp using <IP>:<PORT>.  I just noticed a bit ago that it was only successfully working remotely maybe 1/5 times.  Now it seems to be perhaps 4/5 times.  Here is a sequence of events from the remote machine..it works, then doesn't, then does, then doesn't...

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
DAF31BC1F60FB151386816F8F68C8176B51786EE Downloading      26.8% 228.91GiB D:   1.60MiB/s U:   2.92kiB/s 0.00   2/2     eta: 4d 8h   MyTorrentName
   Properties:
      label = MyLabel
      dht = -1
      dlrate = 0
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      pex = -1
      seed_override = 0
      seed_ratio = 1050
      seed_time = 900
      superseed = 0
      trackers:
         http://MyTracker
      ulrate = 0
   Read-only:
      availability = 258129
      dl_remain = 179823525888
      dl_speed = 1681474
      downloaded = 65963068755
      eta = 375966
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      name = MyTorrentName
      peers_connected = 24
      peers_total = 51
      progress = 26.8
      queue_order = 1
      ratio = 0.003
      seeds_connected = 2
      seeds_total = 2
      size = 245785120083
      status = Downloading
      ul_speed = 2993
      uploaded = 231915520

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1489, in <module>
    tors = utorrent.torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 1003, in torrent_list
    res = self._fetch_torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 995, in _fetch_torrent_list
    out = self.do_action( "list" )
  File "C:\utorrentctl\utorrentctl.py", line 969, in do_action
    return self._connection.do_action( action = action, params = params, params_str = params_str, data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 782, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 729, in _get_data
    raise e
  File "C:\utorrentctl\utorrentctl.py", line 680, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 316, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
DAF31BC1F60FB151386816F8F68C8176B51786EE Downloading      26.8% 228.91GiB D:   1.66MiB/s U:   3.09kiB/s 0.00   2/2     eta: 4d 7h   MyTorrentName
   Properties:
      label = MyLabel
      dht = -1
      dlrate = 0
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      pex = -1
      seed_override = 0
      seed_ratio = 1050
      seed_time = 900
      superseed = 0
      trackers:
         http://mytracker
      ulrate = 0
   Read-only:
      availability = 258131
      dl_remain = 179790905344
      dl_speed = 1736603
      downloaded = 65995689299
      eta = 373643
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      name = MyTorrentName
      peers_connected = 24
      peers_total = 51
      progress = 26.8
      queue_order = 1
      ratio = 0.003
      seeds_connected = 2
      seeds_total = 2
      size = 245785120083
      status = Downloading
      ul_speed = 3164
      uploaded = 231948288

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1489, in <module>
    tors = utorrent.torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 1004, in torrent_list
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 1004, in <dictcomp>
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 283, in __init__
    self.fill( torrent )
  File "C:\utorrentctl\utorrentctl.py", line 362, in fill
    self.completed_on, self._unk_str, self.download_dir = torrent[19:27]
ValueError: need more than 0 values to unpack

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1489, in <module>
    tors = utorrent.torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 1003, in torrent_list
    res = self._fetch_torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 995, in _fetch_torrent_list
    out = self.do_action( "list" )
  File "C:\utorrentctl\utorrentctl.py", line 969, in do_action
    return self._connection.do_action( action = action, params = params, params_str = params_str, data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 782, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 729, in _get_data
    raise e
  File "C:\utorrentctl\utorrentctl.py", line 680, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 316, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1489, in <module>
    tors = utorrent.torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 1003, in torrent_list
    res = self._fetch_torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 995, in _fetch_torrent_list
    out = self.do_action( "list" )
  File "C:\utorrentctl\utorrentctl.py", line 969, in do_action
    return self._connection.do_action( action = action, params = params, params_str = params_str, data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 782, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 729, in _get_data
    raise e
  File "C:\utorrentctl\utorrentctl.py", line 680, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 316, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''

C:\utorrentctl>utorrentctl.py --dump DAF31BC1F60FB151386816F8F68C8176B51786EE
DAF31BC1F60FB151386816F8F68C8176B51786EE Downloading      27.4% 228.91GiB D:   1.90MiB/s U:   6.41kiB/s 0.00   2/2     eta: 1w 5d   MyTorrentName
   Properties:
      label = MyLabel
      dht = -1
      dlrate = 0
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      pex = -1
      seed_override = 0
      seed_ratio = 1050
      seed_time = 900
      superseed = 0
      trackers:
         MyTrackerName
      ulrate = 0
   Read-only:
      availability = 259831
      dl_remain = 178421628928
      dl_speed = 1991172
      downloaded = 67364965715
      eta = 1058420
      hash = DAF31BC1F60FB151386816F8F68C8176B51786EE
      name = MyTorrentName
      peers_connected = 29
      peers_total = 59
      progress = 27.4
      queue_order = 1
      ratio = 0.003
      seeds_connected = 2
      seeds_total = 2
      size = 245785120083
      status = Downloading
      ul_speed = 6562
      uploaded = 233537536


The error message has changed when running the script from the local machine, but I still can't get it to work.

C:\utorrentctl>utorrentctl.py -l -c
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1341, in <module>
    for h, t in sorted( utorrent.torrent_list().items(), key = lambda x: getattr( x[1], opts.sort_field ), reverse = opts.sort_desc ):
  File "C:\utorrentctl\utorrentctl.py", line 1004, in torrent_list
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 1004, in <dictcomp>
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 283, in __init__
    self.fill( torrent )
  File "C:\utorrentctl\utorrentctl.py", line 362, in fill
    self.completed_on, self._unk_str, self.download_dir = torrent[19:27]
ValueError: need more than 0 values to unpack

C:\utorrentctl>utorrentctl.py -l -c
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1341, in <module>
    for h, t in sorted( utorrent.torrent_list().items(), key = lambda x: getattr( x[1], opts.sort_field ), reverse = opts.sort_desc ):
  File "C:\utorrentctl\utorrentctl.py", line 1003, in torrent_list
    res = self._fetch_torrent_list()
  File "C:\utorrentctl\utorrentctl.py", line 995, in _fetch_torrent_list
    out = self.do_action( "list" )
  File "C:\utorrentctl\utorrentctl.py", line 969, in do_action
    return self._connection.do_action( action = action, params = params, params_str = params_str, data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 782, in do_action
    res = self._get_data( self._action( action, params, params_str ), data = data, retry = retry, save_buffer = save_buffer, progress_cb = progress_cb )
  File "C:\utorrentctl\utorrentctl.py", line 722, in _get_data
    raise e
  File "C:\utorrentctl\utorrentctl.py", line 680, in _get_data
    resp = self.getresponse()
  File "C:\Python32\lib\http\client.py", line 1046, in getresponse
    response.begin()
  File "C:\Python32\lib\http\client.py", line 346, in begin
    version, status, reason = self._read_status()
  File "C:\Python32\lib\http\client.py", line 308, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python32\lib\socket.py", line 273, in readinto
    return self._sock.recv_into(b)
socket.error: [Errno 10053] An established connection was aborted by the software in your host machine

Offline

#39 2011-03-05 07:22:03

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Please download the fresh version and give it another try

Offline

#40 2011-03-05 07:34:33

utorrential31337
Member

Re: uTorrent WebUI command line utility and library for Python 3

Tried the new version, this time it doesn't work on either 2003 remotely or 2008 locally, at all.  But, I only get 1 error and it's the same error on both machines, so I guess that's positive smile

Here is the error now.  It never changes no matter what I do.

C:\utorrentctl>utorrentctl.py -l -c
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1341, in <module>
    for h, t in sorted( utorrent.torrent_list().items(), key = lambda x: getattr( x[1], opts.sort_field ), reverse = opts.sort_desc ):
  File "C:\utorrentctl\utorrentctl.py", line 1004, in torrent_list
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 1004, in <dictcomp>
    out = { h : self._TorrentClass( self, t ) for h, t in self._torrent_cache.items() }
  File "C:\utorrentctl\utorrentctl.py", line 283, in __init__
    self.fill( torrent )
  File "C:\utorrentctl\utorrentctl.py", line 362, in fill
    self.completed_on, self._unk_str, self.download_dir = torrent[19:27]
ValueError: need more than 0 values to unpack

Offline

#41 2011-03-05 07:47:44

utorrential31337
Member

Re: uTorrent WebUI command line utility and library for Python 3

More good news, it seems the --server-version flag is working well 100% of the time, from either 2008 local or 2003 remote.  So that eliminates a lot of possible issues.


C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

C:\utorrentctl>utorrentctl.py --server-version
BTWebClient/3000(23703) /UT3000 desktop v3.0.0.23703, engine v23703, ui v23703

Also --settings returns a different error.

C:\utorrentctl>utorrentctl.py --settings
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1378, in <module>
    for i in sorted( utorrent.settings_get().items() ):
  File "C:\utorrentctl\utorrentctl.py", line 1178, in settings_get
    for name, type, value, attrs in res["settings"]:
ValueError: need more than 3 values to unpack

C:\utorrentctl>utorrentctl.py --settings
Traceback (most recent call last):
  File "C:\utorrentctl\utorrentctl.py", line 1378, in <module>
    for i in sorted( utorrent.settings_get().items() ):
  File "C:\utorrentctl\utorrentctl.py", line 1178, in settings_get
    for name, type, value, attrs in res["settings"]:
ValueError: need more than 3 values to unpack

Last edited by utorrential31337 (2011-03-05 07:58:44)

Offline

#42 2011-03-05 08:04:40

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Yup, that's good news smile The connection problems are gone and we are now facing only server response format errors. That's something I can debug locally. According to the server-version response you are using µTorrent Falcon, am I right? If yes, then please, first make sure you downloaded and installed the latest version from http://user.utorrent.com/labs/get-falcon . Meanwhile I will install it locally to see what is wrong.

Offline

#43 2011-03-05 08:10:13

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Ah, I see, I'm wrong. Server-version is detected incorrectly for the latest 2.2rc.

Offline

#44 2011-03-05 08:33:08

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Download the latest version. It should work at last. Also I added the ability to override server API version. So you could also try running utorrentctl with --server=desktop (see help for all available values). Specifying this option completely disables µTorrent API version auto-detection so if chosen incorrectly may produce erratic results. Actually this is what happened in your case. My utility was incorrectly identifying your µTorrent as Falcon.

Last edited by twistedfall (2011-03-05 08:35:47)

Offline

#45 2011-03-05 09:05:33

utorrential31337
Member

Re: uTorrent WebUI command line utility and library for Python 3

Doh, I didn't even notice that it reported version 3.0 and I'm actually using 2.2.  Glad you figured that out smile

I got the latest, and as long as I force server=desktop it works great.  Thank you so much for your work.

With this working, I should be able to create a vbs script that calls your script on every state change of a torrent, pass my script the hash id, pass it to yours, then pull the tracker out with yours, do some tracker=label logic with mine, then assign a label based on the tracker with yours...and voila, auto labels!

Thanks again

Offline

#46 2011-03-05 09:14:01

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

smile) You are welcome. I'll try to work out some more robust version detection based on build number, but apparently there is no logic in assigning those...

Offline

#47 2011-03-06 10:46:34

Ultima
Administrator

Re: uTorrent WebUI command line utility and library for Python 3

It's just the SVN revision number... and the repository is shared by all versions. Having the "build" key made sense in the past, when there was only one branch being tested at any given time. Doesn't work quite so well now with 3+ branches being tested simultaneously hmm

The only way I've managed to reliably differentiate between 2.2 and 3.0 is to check action=getsettings to see if webui.uconnect_enable is defined. If so, then it's 3.0; if not, then it's 2.2 (or more precisely, anything older, but who's counting those really?).


[size=0.85][ Tweaking Checklist | User Manual | BEE | MiniUI | µTA ][/size]

Offline

#48 2011-03-06 13:18:25

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

Thanks, that helped! I have implemented the detection of the aforementioned setting. So the auto-detection should be reliable now. Also, for those affected, I have renamed --server option into --api (but it shouldn't be required now anyway).

Last edited by twistedfall (2011-03-06 13:18:54)

Offline

#49 2011-06-23 12:46:34

jbmia
Member

Re: uTorrent WebUI command line utility and library for Python 3

I"ve downloaded and trying to run from F14 and get the following error...


[root@home home]# python utorrentctl.py --help
  File "utorrentctl.py", line 1280
    print_orig = print
                     ^
SyntaxError: invalid syntax

Any assistance would be appreciated..

jbmia

Offline

#50 2011-06-23 23:59:30

twistedfall
Member

Re: uTorrent WebUI command line utility and library for Python 3

It looks like you are using Python version 2.x. Python 3.1 is required.

Offline

Board footer

Powered by FluxBB

©2013 BitTorrent, Inc. µTorrent is a trademark of BitTorrent, Inc.