[Request] Tracking Country stats plugin

Suggest, post, or discuss plugins for Deluge
Post Reply
r0ckarong
Member
Member
Posts: 37
Joined: Wed Jan 02, 2008 8:15 pm

[Request] Tracking Country stats plugin

Post by r0ckarong »

Hi guys,
I've been reading stuff about BitTorrent left and right and I'm an active user for a long time and so I planned on doing some reasearch. I want to figure out what the overall rate of international peers that I connect to during a certain period of time is. This is to show what effect on international distribution BitTorrent can have. Not in an insulting way but to point out the strenghts of the protocol. I've read some numbers on the topic but nothing that does it like this in particular. Just out of curiosity and because I mostly share files that are non-native to my country.

Now I wonder, is there a way (or an easy API that I can write a Python script for) to get Deluge to hand me a list of the peers countries? I'm not interested in the IP addresses themselves and for security and anonymity reasons I don't even want them. I just want a way to have Deluge track all the different countries so I can calculate their statistical distribution and overall numbers. Since most Tracker operators are pretty paranoid (for good reasons) about their user stats they won't help me (at least not the ones I spoke to). Since I am quite active on different trackers with popular files and such I could get a (maybe not as representative) sample from my client connections. At least that's my hope.

Maybe you'll tell me that's hard to do and I'm crazy but I believe since Deluge is listing the countries anyway it should be fairly simple to get it to spit out a list of countries that connected during the day or other time period. It would, of course, have to recognize recurring IP addresses in the same session and count those seperately. But this can be done by postprocess filtering I guess. How does Deluge determine the countries from the IP ranges anyway? Is there something in libtorrent that does that? I wondered about that for a long time and I was afraid it'd do an actual WHOIS request on every IP.

I would read some documentation about how to write a plugin for Deluge if you can point me at some. Some easy way to parse the country codes into a file would be preferred since I'm not an adept coder. This isn't meant in any way to be an official plugin for everyone to use but for me to just count some statistics. Maybe if other people are interested later on one could publish that plugin for broader data acquisition. Thanks in advance.
Post Reply