Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

New uTorrent Plugin.

Announcements of new plugins or updates.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

New uTorrent Plugin.

Post by cosenodefi »

Hi, everyone.

I've made a plugin for the uTorrent client. It's the first public release of this plugin, so further development/changes will be expected.

It was tested on uTorrent v1.77 with WebUI v0.310 beta2.
Update (2010-09-27):
Tested & Running OK with uTorrent v2.04 r22150, and webUI v0.371., on WinXP Pro (SP3), WinXP Home (SP3), Win2K (SP4) and Windows 7 Pro
Update (2011-09-02):
Tested & Running OK with uTorrent v3.0 r25460, and webUI v0.383.



A brief summary of the values that can be retrieved by this plugin:

Function 1 (Individual Torrent Stats)
  • 0 - hashvalue
    1 - status
    2 - torrentname
    3 - size (in MBytes/KBytes)
    4 - completed %
    5 - downloaded (in MBytes/KBytes)
    6 - uploaded (in MBytes/KBytes)
    7 - ratio %
    8 - upload (in KBytes/s)
    9 - download (in KBytes/s)
    10 - eta (in days,hours,mins,sec) See note.
    11 - label
    12 - connected peers
    13 - peers in swarm
    14 - connected seeds
    15 - seeds in swarm
    16 - availability (in 1/65536th)
    17 - number of order (assigned by uTorrent)
    18 - remaining bytes (in MBytes/KBytes)


Function 2 (Global Torrent Stats)
  • 0 - Total number of torrents
    1 - Total number of ACTIVE torrents
    2 - Total number of COMPLETED torrents
    3 - Total bytes to download
    4 - Total bytes downloaded
    5 - Total bytes uploaded
    6 - Total upload speed
    7 - Total download speed


Function 3 (About info) - (Self-explained)

For further information, read the README.TXT file, please.

An example of plugin configuration file, and screen definition for LCDSmartie are also included.

Bye.

UPDATES:

01-Apr-2008 - Fixed a potential bug (see notes).
You do not have the required permissions to view the files attached to this post.
Last edited by cosenodefi on September 2nd, 2011, 6:52 am, edited 8 times in total.

tinners
Posts: 16
Joined: January 16th, 2007, 9:29 pm

Post by tinners »

Great work, been waiting for this for ages :D

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Post by cosenodefi »

tinners wrote:Great work, been waiting for this for ages :D
Thanks :D

twhyman
Posts: 19
Joined: October 20th, 2006, 8:10 am

Post by twhyman »

Hi,

Thanks for the plugin :D

It works great :)

Twhyman

Pexxii
Posts: 4
Joined: February 7th, 2007, 2:48 pm
Location: ?land
Contact:

Post by Pexxii »

thaaaanks :D :D ive been waiting for this too :)

Stu8080
Posts: 2
Joined: April 25th, 2008, 10:18 pm

Post by Stu8080 »

Hi

Let me say this is the plugin ive been after for a long time, and i appreciate you putting it up here!

The operation of the plugin is excellent, but i cant figure out how the torrents are ordered?
e.g. torrent # 0 in your plugin does not correspond to torrent # 1 in uTorrent webui (or utorrent itself). What i find im getting is when i request % complete info for torrents 0-4, and request it to display the torrent numbers on the screen preceeding each torrent %, i get *,*,*,4,5, where the '*' torrents are completed and so dont have a download order? It does not give me the top 5 active part downloaded torrents ion my queue.

Does anyone else notice this? If it behaviour exclusive to me, what might influence this and what can i try to identify the problem?

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

It's a uTorrent WebUI thing, the torrent numbering is referenced to the order in witch they were added to the que not the way the user arranged them afterwards.

Thanks for the great plugin!

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Post by cosenodefi »

Stu8080 wrote:Hi

Let me say this is the plugin ive been after for a long time, and i appreciate you putting it up here!

The operation of the plugin is excellent, but i cant figure out how the torrents are ordered?
e.g. torrent # 0 in your plugin does not correspond to torrent # 1 in uTorrent webui (or utorrent itself). What i find im getting is when i request % complete info for torrents 0-4, and request it to display the torrent numbers on the screen preceeding each torrent %, i get *,*,*,4,5, where the '*' torrents are completed and so dont have a download order? It does not give me the top 5 active part downloaded torrents ion my queue.

Does anyone else notice this? If it behaviour exclusive to me, what might influence this and what can i try to identify the problem?
As Caesar said... it's a WebUI matter.

The plugin retrieves a list of the torrents, as it is reported by the webUI, no matter the status of everyone is.

When a torrent is added, the client (uTorrent) assigns a order number that it can't be modified except by the uTorrent itself. When a torrent it's completed, the order number is changed to -1 by the client, and this is reported by the plugin with a '*' char.

Since there's possible to have several torrents completed, and then, their order numbers were identical (-1), is the reason because the plugin's function to retrieve the stats of an indivudual torrent doesn't rely in that order number. Instead of that, the order number is given by the list positions in the WebUI. I was sure, from the earlier stages of the plugin development, this may lead to confussion.

The access to the list of torrents starts from 0 (instead of 1) due to the nature of Delphi structures used (TStringlist). I think it wasn't a serious issue... :-)

I hope I had explained the behaviour enough/well... (and sorry for my english).

Bye.

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

Ok, here is a possible solution:

1. You will need math.dll, also found in this forum.
2. A working utorrent plugin

Given that $dll(utorrent,2,0,0) returns the total number of torrents,
to select the last one you must subtract 1 from the total number of torrents

SO here is an example to show the last 4 added torrents:

Last=total-1: $dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),1),2)

and the remaining 3 LAST ADDED torrents:
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),2),2)
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),3),2)
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),4),2)


basically you change the second parameter with:

$dll(math,2,$dll(utorrent,2,0,0),X)

where X is 1 for the last torrent and you add 1 to X for every subsequent torrent in the list.

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Post by cosenodefi »

caesar wrote:Ok, here is a possible solution:

1. You will need math.dll, also found in this forum.
2. A working utorrent plugin

Given that $dll(utorrent,2,0,0) returns the total number of torrents,
to select the last one you must subtract 1 from the total number of torrents

SO here is an example to show the last 4 added torrents:

Last=total-1: $dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),1),2)

and the remaining 3 LAST ADDED torrents:
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),2),2)
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),3),2)
$dll(utorrent,1,$dll(math,2,$dll(utorrent,2,0,0),4),2)


basically you change the second parameter with:

$dll(math,2,$dll(utorrent,2,0,0),X)

where X is 1 for the last torrent and you add 1 to X for every subsequent torrent in the list.
It's seems (to me) a tricky procedure just to avoid to start from 0.
It needs two DLLs for the same job, and add complexity to the screen setup in LCD Smartie.
It's more easy, having the source code, just add (1) to the parameter when it's passed to the function, and change the loops from something like:

for i:=0 to list.count-1 do...

to something like

for i:=1 to list.count do...

And... it's really so important?. Does it makes any difference start from 0 or from 1?. I don't think so. :?

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

Sorry but my point was to show an easy way to show the last added torrents.

You would anyway use the function to retrieve the total number of torrents and than some way to decrease that number a few times, all this in smartie...

Maybe a new function that retrieves data from the end to the beginning is the solution?

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Post by cosenodefi »

caesar wrote:Sorry but my point was to show an easy way to show the last added torrents.

You would anyway use the function to retrieve the total number of torrents and than some way to decrease that number a few times, all this in smartie...

Maybe a new function that retrieves data from the end to the beginning is the solution?
Maybe I didn't get (all) the point before...
I like your last idea, maybe a function that retrieves only the data from the active torrents would be interesting. From the last active added to the first, or from the first active to the last one. Or... maybe two functions (normal & inverse order).

I've to code this as soon as I can have some free time...

Thanks.

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

I am happy with it now the way it is!
But if you have enough spare time... then we all would appreciate it.

Thanks again for the plugin!

Stu8080
Posts: 2
Joined: April 25th, 2008, 10:18 pm

Post by Stu8080 »

Hi, thanks for the replies guys.

Just to clarify, starting from 0 or 1 makes no difference so long as you are aware of this rule, if i want to call info for the first torrent i use 0, for the second i use 1. Thats no problem!

Its just that it seems to stick on the order the torrents were added, and so unless i delete completed torrents (which i dont want to do because they need to be seeded up to a decent ratio) i end up with stats for the same torrents regardless of the new ones that are added!

As you say this is a WebUI issue which i suspected and i might have to rethink the info i display - ie global stats as opposed to specific ones. However if there is a way of filtering out only active torrents that would be very useful, even more so if i could define things further to get info for downloading torrents (ie less that 100% - and show % complete) or stats for seeding torrents (<2.00 ratio and show the current ratio)

Dont get me wrong, im being picky here, and i appreciate this plugin as is, but if its feasable to define things a little more i for one would be extremely appreciative.

Are there any workarounds that could be used either in the plugin or in the webUI to get round this without you modifying the plugin further? Id be happy to act as a tester of these or for anything you change?

Regards

Stu

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Post by caesar »

Stu, read my first post in this thread, i explained an easy method to show stats for the last added torrents.

http://forums.lcdsmartie.org/viewtopic. ... 3859#13859

sucker
Posts: 1
Joined: July 20th, 2008, 11:56 pm

Post by sucker »

Thanks very much, I download only 1 torrent a time so the plugin works perfect.

SpikedCola
Posts: 12
Joined: April 27th, 2007, 5:32 am

Post by SpikedCola »

For the longest time the plugin worked for me, and now when I use this command:

$dll(utorrent,2,5,) Seeded

it shows:

"KB Seeded"

However, the command for upload speed works just fine. I tried reverting to the old webui (v0.310) but that didnt help. Any ideas?

EDIT Nevermind, I let it sit for about an hour and it decided to start counting the uploaded amount. Confirmed working with uTorrent 1.8.3 and WebUI 0.361
Last edited by SpikedCola on June 22nd, 2009, 9:47 pm, edited 1 time in total.

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Post by cosenodefi »

SpikedCola wrote:For the longest time the plugin worked for me, and now when I use this command:

$dll(utorrent,2,5,) Seeded

it shows:

"KB Seeded"

However, the command for upload speed works just fine. I tried reverting to the old webui (v0.310) but that didnt help. Any ideas?
It's not related with WebUI, it's the uTorrent version. I've not checked it until now.

When you access the WebUI as administrator there is a popup (alert message) warning you about the risk. You must accept (pressing a OK button) in order to access the page. This popup didn't exist in the previous versi?n... and the plugin could access without interferences. Now it isn't possible anymore.

Solution: Enable de guest access to the WebUI, and change the settings in the configuration file of the plugin (*.INI). Set the user setting to the guestname you've choosed, and leave the password setting in blank.

The plugin can access the WebUI again (without interference), and retrieve the info to compsose the stats.

Best regards.

SpikedCola
Posts: 12
Joined: April 27th, 2007, 5:32 am

Post by SpikedCola »

Thanks for the quick reply. As per my earlier post, it started working on its own, but I will set up guest access as you suggested, just incase it decides to not work again.

Confirmed working on uTorrent 1.8.3 and WebUI 0.361

EDIT I enabled guest access and set my .ini as such:

Code: Select all

user=guest
pwd=
server=localhost
port=123
refresh=2000
And it doesnt show speed or the uploaded amount. However, I changed it back to the normal user, and it works now. Strange!

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Strange behavoiur...

Post by cosenodefi »

SpikedCola wrote:Thanks for the quick reply. As per my earlier post, it started working on its own, but I will set up guest access as you suggested, just incase it decides to not work again.

Confirmed working on uTorrent 1.8.3 and WebUI 0.361

EDIT I enabled guest access and set my .ini as such:

Code: Select all

user=guest
pwd=
server=localhost
port=123
refresh=2000
And it doesnt show speed or the uploaded amount. However, I changed it back to the normal user, and it works now. Strange!
Really strange...
Please check this : Every change in the INI must be followed by a Smartie restart in order to 'see' those changes in the config file (it reads the file at the begining and only once).

Anyway, I'm planning a complete rewrite of several plugins (when I find some spare time) including a new one (for the freenas system)... and I'll check the current issue more deeply.

Best Regards.
JR

SpikedCola
Posts: 12
Joined: April 27th, 2007, 5:32 am

Post by SpikedCola »

I made sure to restart uTorrent and LCDSmartie after each change, but regardless, it works now. Cheers!

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Re: New uTorrent Plugin. (Warning to users)

Post by cosenodefi »

WARNING: The uTorrent plugin can't connect with uTorrent 2.0 client

Hi everyone.

I've updated my uTorrent client to version 2.0 (final), I've noticed the uTorrent plugin for LCD Smartie stops working.
It's due to this point: the change in the security system of the uTorrent client.

The uTorrent client now introduces a security schema ir order to avoid a XSS atack in the WebUI.
This schema uses a 'token' generated by the uTorrent client to validate the queries from third party apps, and this makes impossible to connect the plugin (in its actual version) with the uTorrent client. So, I've to re-work the connection system of the plugin.

For more info about this issue, please check this link http://trac.utorrent.com/trac/wiki/TokenSystem.

Sorry for the inconveniences.

Eugene
Posts: 22
Joined: May 10th, 2006, 7:48 pm

Re: New uTorrent Plugin.

Post by Eugene »

You can disable uTorrent WebUI token auth method. Go to Options\Preferences\Advanced and set webui.token_auth parameter to "false".

Works fine for me.

cosenodefi
Plugin Author
Posts: 37
Joined: December 10th, 2007, 5:40 pm
Location: Zaragoza (SPAIN)

Re: New uTorrent Plugin.

Post by cosenodefi »

Eugene wrote:You can disable uTorrent WebUI token auth method. Go to Options\Preferences\Advanced and set webui.token_auth parameter to "false".

Works fine for me.
Thanks, I've no time to make the modification in the plugin.
I tried to find some spare time since I posted the warning, but all the universe is opposing me...

(but I'll find the moment...someday) :-)

zerocode
Posts: 22
Joined: May 21st, 2006, 2:52 am
Location: Brazil

Re: New uTorrent Plugin.

Post by zerocode »

I have problemas with utorrent 2.1...i get the last webui.zip, configure the preferences but all counters show "0". I Disable the option webui.token_auth but not work...any ideia?

Post Reply