''' LoadBox Downloader Toolset for Unix-Based Systems For more info: http://github.com/zxcmehran/LoadBox Developed by Mehran Ahadi http://mehran.ahadi.me/ Licensed undet MIT (Expat) License ''' import xmlrpclib import configuration as c try: s = xmlrpclib.ServerProxy(c.conf_protocol() + c.conf_auth_userpass() + c.conf_address() + ':' + c.conf_port() + '/rpc') if c.conf_auth_token() != '': s.aria2.changeGlobalOption( c.conf_auth_token(), { 'max-overall-download-limit': c.conf_cron_maxspeed(), 'max-overall-upload-limit': c.conf_cron_maxupspeed() }) else: s.aria2.changeGlobalOption({ 'max-overall-download-limit': c.conf_cron_maxspeed(), 'max-overall-upload-limit': c.conf_cron_maxupspeed() })
''' import xmlrpclib import sys import configuration as c import socket try: gid = sys.argv[1] except IndexError: print 'Please specify a GID.' sys.exit(1) try: s = xmlrpclib.ServerProxy(c.conf_protocol()+c.conf_auth_userpass()+c.conf_address()+':'+c.conf_port()+'/rpc') if c.conf_auth_token() != '' : stats = s.aria2.tellStatus(c.conf_auth_token(), gid, ['errorCode', 'errorMessage']) else: stats = s.aria2.tellStatus(gid, ['errorCode', 'errorMessage']) if len(stats) == 2 : print stats['errorCode']+' : '+stats['errorMessage'] elif len(stats) == 1 : print stats['errorCode'] sys.exit(0) except xmlrpclib.Fault, e: print 'Server responded with an error: %s' % e
Licensed undet MIT (Expat) License ''' import xmlrpclib import sys import configuration as c import socket try: gid = sys.argv[1] except IndexError: print 'Please specify a GID.' sys.exit(1) try: s = xmlrpclib.ServerProxy(c.conf_protocol()+c.conf_auth_userpass()+c.conf_address()+':'+c.conf_port()+'/rpc') if c.conf_auth_token() != '' : files = s.aria2.tellStatus(c.conf_auth_token(), gid) else: files = s.aria2.tellStatus(gid) if 'followedBy' in files: print 'It\'s a metalink or torrent descriptor file. Skipping.'; sys.exit(7); relpath = files['files'][0]['path'][len(files['dir'])+1:] if(relpath.find('/') == -1): # If it's a single file situation print files['dir']+'/'+relpath