Torrent Info

May 25, 2018
915
0
16
#1
Hi was hoping I could get some pointers I share a seedbox with a few freinds and have set the box up with labels for the few people using it.

What I want to do is record into an array the hardrive space each user label is using.

I know my way around php quite well so hopefully this can be done through php.

I have looked through all the code for a few hrs trying to find away to get this data
 
May 25, 2018
718
0
16
#2
this isn't going to be easy.

The best method of doing this is much more simple:

Create a unix user for each user.

install "quota"

set an rtorrent for EACH user

user webmin to check how much space each user has used via quota.

This is the best way to CHECK how much space each user is using
 
May 25, 2018
773
0
16
#3
Thanks for your quick reply The reason I want to use this method is I have linked rutorrent with my forum (vbul)

I have vbul running in an iframe with other iframes as chat box and a menu system allowing people to go to the forum page.

If a user tries to login in to just the rtorrent it checks to make sure they are loged in to the forum if not it will kick the user back to a login page

If the user is loged into the forum every torrent they upload is labeled as their vbul username
(i know each "!user" as ill call it really is just one user as per rutorrents perpective and has access to everything, thats fine in my case)

what im trying to do is read that label (sponge) has more then 20gb on the seedbox and I should look at removing some torrents.

would also like to expand this latter into checking upload rates of torrents and passing the information to a database and if a torrent has had 0k upload in the last 24hrs suggest to the user to delete the torrent.

so all I need to do to get my self started is a way to read all the torrents information in to an array including the label tag the rest I can code up from there.
 
May 25, 2018
897
0
16
#4
What I want to do is record into an array the hardrive space each user label is using.
This can't be done by that way. rTorrent use a memory mapped files for torrents, it doesn't allocate all disk space immediatelly after torrent addition.
Really, you can only check - which diskspace will be used, when all user's torrents will be finished.
 
May 25, 2018
718
0
16
#5
Rutorrent is on seedbox so all torrent are fully completed in a matter of minutes anyway so even if i pull the information from the torrent size information rather then how much it has downloaded this will suit my purposes

I just need a basic script to pull the data from rtorrent and add it to an array so i can use the information in a php script

just really need torrent name size and label but if i could pull more information out as well im sure I could use it

Again thanks for quick repies did not expect to get repies this quick, but think it is bed time for my self now 3am here in Aus.
 
May 25, 2018
773
0
16
#6
Since you're familiar with PHP, have you taken a look at the contents of rutorrent's /php/ folder?
There are a few files in there which appear to have the functions you're looking for - specifically Torrent.php.

Hope this points you in the right direction,
 
May 25, 2018
897
0
16
#7
I just need a basic script to pull the data from rtorrent and add it to an array so i can use the information in a php script
Then simple write it.
One d.multicall with d.get_hash, d.get_name, d.get_size_bytes and d.get_custom1 (for label).
Sum all d.get_size_bytes per some label. And you got what you want.
 
May 25, 2018
718
0
16
#8
Have tried to code this up but not having much luck at all. dont know how to to use the xmlrpc.php function to fill this information out.

Thanks for the pointer of One d.multicall with d.get_hash, d.get_name, d.get_size_bytes and d.get_custom1 (for label).
 
May 25, 2018
773
0
16
#9
Have tried to code this up but not having much luck at all. dont know how to to use the xmlrpc.php function to fill this information out.
Ok. What do you really want?
1) You can to learn - how you can obtain this information. In this case you must to say - what you tried, what you give and where is a problem.
2) You need the addition to ruTorrent, which will solve your problem. In this case you must to say - what do you wish to see on ruTorrent UI? And, ofcourse, you must be ready to spent some money for this solution.