imagitronics
By: a guest | Feb 6th, 2009 | Syntax:
Python | Size: 0.73 KB | Hits: 426 | Expires: Never
host = 'localhost'
port = '80'
username = 'admin'
password = 'admin'
filename = '../webui/ybox2.html'
from uTorrent import *
#from zipfile import *
ut = uTorrent(host, port, username, password)
fn = open(filename, 'w')
fn.write('\x0C')
fn.write('\x04')
fn.write('uTorrent download monitor'.center(40))
fn.write('\x0C')
fn.write('\x00')
current_torrents = ut.webui_ls()
for torrent in current_torrents:
fn.write(torrent[UT_TORRENT_PROP_NAME][:35].ljust(36) + str(torrent[UT_TORRENT_STAT_P1000_DONE]/10).rjust(3) + '%')
for i in range(len(current_torrents), 10):
fn.write(' ')
fn.close()
#zipper = ZipFile('../webui.zip', 'a')
#zipper.write(filename)
#zipper.close()