It is currently February 25th, 2021, 9:49 pm

qbittorrent skin

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
Bishop149
Posts: 25
Joined: March 23rd, 2016, 3:07 pm

qbittorrent skin

Post by Bishop149 »

As far as I can see there are few Rainmeter skins supporting output for torrent clients other than uTorrent.
Personally I don't much like uTorrent, it was a once great little client that has become increasingly bloated and commercialized with each and every new version. My favored alternative is qBittorrent an open source client specifically designed to recall the nice clean simple client that uTorrent used to be!

So I was little disappointed that there was no rainmeter skin for qBittorrent and resolved to create one myself, which I attach.
I say myself, what I mean is myself with substantial help from jsmorley!
I have almost no lua experience and the vast majority of the code in the .lua file is his, I merely tweeked bits of it to better suit the output I wanted. His code to parse an information stream using lua, and his helpful answers to my many questions can be found here

How to use the skin

- The first thing to be done is to enable qBittorrent's WebUI, instructions for doing so can be found here:
https://github.com/lgallard/qBittorrent-Controller/wiki/How-to-enable-the-qBittorrent-Web-UI
In addition to those instructions be sure to tick "Bypass authentication for localhost"

- The skin should now work, as long a qBittorrent is running, minimsed to the taskbar is fine (which is where my client spends most of its time)

Edit:
- It has been suggested to me that the current format of an important link isn't as general purpose as it perhaps could be!
So if it doesn't work for you (displays a blank window) then it might be worth trying the following.
One line 25 of qbittorrent.ini change

Code: Select all

http://127.0.0.1:8080/query/torrents?filter=downloading&sort=eta&limit=4
to

Code: Select all

http://localhost:8080/query/torrents?filter=downloading&sort=eta&limit=4
How the skin is currently setup / how to change it

In the supplied form the skin is setup to:
1) Only show downloading torrents
2) To order them by increasing ETA
3) Only display the first 4 torrents
4) To show ETA as a decimal of the largest relevant time increment. For example. 1,000,000 seconds would be displayed as "1.7 wks" whilst 10,000 seconds would be displayed as "2.8 hrs"

I should note that I am not a very experienced coder and the skin is not currently designed to cater for all possible end user requirements. It is currently tailored to MY requirements. I hope to perhaps release a more catch-all version at some point but in the meantime below are some tips about how you might tailor it differently to YOUR requirements.

Easy things to change

Changing the size, colour, position, background etc of the meters should all be pretty familiar to anyone who has some experience of rainmeter. There is nothing especially special or different about the skin everything in this regard is very standard.

Points 1) and 2) of the above list are not actually controlled by anything intrinsic to skin but rather by the format of the WebUI link the skin parses. This link is found on line 25 of qbittorrent.ini and reads

Code: Select all

http://127.0.0.1:8080/query/torrents?filter=downloading&sort=eta&limit=4
http://127.0.0.1:8080/query/torrents - Is general, its just accessing torrent info from the WebUI

The next 3 terms specify what torrent information is retrieved

?filter=downloading - We want info on downloading torrents
&sort=eta - Order them by ETA
&limit=4 - Only return the top 4

You can tailor this link to whatever you might require, there is a guide as to the formatting to be found here:
https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation#get-torrent-list

Harder things to change

The skin is currently designed to retrieve the following info from the torrent list you ask the WebUI for
- Torrent Name
- Torrent ETA
- Download Speed
- Torrent Progress
Retrieving other or additional bit of torrent info would (whilst eminently fiesible) require making some reasonably substantive changes to both the .ini and .lua and you should probably only attempt it if you have a pretty decent knowledge of .lua coding

Returning more than 4 torrents is a little more doable, only requiring changes to the .ini
The changes that would need to be made are:

- Increase the &limit=4 term in the link as described above to your desired value.
- In [MeasureScript] on line 34 increase MaxTorrents to your desired value.
- Between lines 37 and 60 you will find 4 measures named "MeasureProg#", you will need to create additional versions of these with the # incrementing up to your desired value.
- From line 96 onwards you will find 5 meters per potential torrent, you will need to create additional copies of these meters upto the max number of torrents you want displayed. You will probably also have to tweek the positioning of the new meters, I'm afraid I didn't take the time to fully optimize the X and Y positions so that everything aligns properly upon merely copy and pasting the meters, I found this tricky as the different meters use different alignments.
It is important that the naming convention for both the meter names and the Group is followed. Convention is described below

Code: Select all

Meter names

[MeterNameX]
[MeterSpeedX]
[MeterETAX]
[MeterProgBarX]
[MeterProgX]

Where X is an incrementing number from 1 to Max Torrent number
Each meter for each increment must also have the following group
 
Group=qbt|TorrentX 
 

I hope people might find this useful.
This is the first skin I've published so I may have made mistakes!
You do not have the required permissions to view the files attached to this post.
Last edited by Bishop149 on April 21st, 2016, 1:52 pm, edited 3 times in total.
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: qbittorrent skin

Post by jsmorley »

Outstanding. I'll have to look at this. While I like uTorrent well enough, I do agree that it has gotten increasingly bloated and full of advertising. I'll have to see if I can rework my uTorrent skin...
Bishop149
Posts: 25
Joined: March 23rd, 2016, 3:07 pm

Re: qbittorrent skin

Post by Bishop149 »

This is a brief list of ways I think I could improve the skin in future versions:

- Scope for displaying more than 4 torrents, perhaps as defined by a user input. There would however have to be a maximum, I'm thinking 10?

- Sort out the meter alignment in a more elegant way (its currently a bit make do and mend!) and allow the skin to resize with the number of torrents its displaying.

- A more generic design, the current design is intended to fit in with my other skins.

- Displaying more complete torrent info, number of seeds etc. I have kept the info (what I consider) minimal in this version because I wanted the display in a large font to be read from a distance (the sofa!), so space was limited. if I made all the text etc smaller there would room for far more info.

- Switching display between downloads, uploads or both.

- Implement control functions. The WebUI allows control input (e.g. pause / unpause) via links . . . . I'll see if I can find a way to use this to allow control from within the skin.
User avatar
Active Colors
Moderator
Posts: 652
Joined: February 16th, 2012, 3:32 am

Re: qbittorrent skin

Post by Active Colors »

I would like to use this skin on my desktop, but the skin is not working for me. I do have "Bypass authentication for localhost" option ticked.

By the way. I don't know whether it is the reason or not. Opening http://127.0.0.1:8080/query/torrents through browser it shows nothing but favicon of bittorent. Web UI appears only trough http://127.0.0.1:8080 address (without /query/torrents). I tried changing that in the skin, but nothing happened. What am I supposed to do?
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: qbittorrent skin

Post by jsmorley »

Active Colors wrote:I would like to use this skin on my desktop, but the skin is not working for me. I do have "Bypass authentication for localhost" option ticked.

By the way. I don't know whether it is the reason or not. Opening http://127.0.0.1:8080/query/torrents through browser it shows nothing but favicon of bittorent. Web UI appears only trough http://127.0.0.1:8080 address (without /query/torrents). I tried changing that in the skin, but nothing happened. What am I supposed to do?
http://localhost:8088/query/torrents

Works for me. I set 8088 as the port and checked Bypass authentication for localhost in Settings and that was pretty much all I had to do.
User avatar
Active Colors
Moderator
Posts: 652
Joined: February 16th, 2012, 3:32 am

Re: qbittorrent skin

Post by Active Colors »

All right. It seems updating qbittorrent resolved the problem (I found out that I had been using a version from 2009). But not completely. The http://127.0.0.1:8080/query/torrents page shows some bunch of text, but skin still shows nothing. The About tab says Fetch error, operation timed-out, ErrorCode=12002.
User avatar
Active Colors
Moderator
Posts: 652
Joined: February 16th, 2012, 3:32 am

Re: qbittorrent skin

Post by Active Colors »

This has resolved my problem. Thank you, jsmorley.

I think it might be reasonable to include this link in the op-post.

Thank you Bishop149 for the great skin.
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: qbittorrent skin

Post by jsmorley »

Active Colors wrote:This has resolved my problem. Thank you, jsmorley.

I think it might be reasonable to include this link in the op-post.

Thank you Bishop149 for the great skin.
http://127.0.0.1:8080/query/torrents

and

http://localhost:8080/query/torrents

Are exactly the same thing.

127.0.0.1 is the IP address of the local loopback interface, and localhost is just the hostname that is always assigned to that.
User avatar
Active Colors
Moderator
Posts: 652
Joined: February 16th, 2012, 3:32 am

Re: qbittorrent skin

Post by Active Colors »

jsmorley wrote:http://127.0.0.1:8080/query/torrents

and

http://localhost:8080/query/torrents

Are exactly the same thing.

127.0.0.1 is the IP address of the local loopback interface, and localhost is just the hostname that is always assigned to that.
1.PNG
2.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: qbittorrent skin

Post by jsmorley »

Well, as usual your computer is different than every other Windows computer in the world. I suspect you have hacked at your hosts file somehow.

Code: Select all

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost