Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Advertisement
Add Comment
Please, Sign In to add comment