Posted by imagitronics on Fri 6 Feb 15:25
report abuse | download | new post
- 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()
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.