Exemplo n.º 1
0
#!/usr/bin/python

'''
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.pauseAll(c.conf_auth_token())
	else:
		s.aria2.pauseAll()

except xmlrpclib.Fault, e:
	print 'Server responded with an error: %s' % e
	sys.exit(2)
Exemplo n.º 2
0
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
	sys.exit(2)
Exemplo n.º 3
0
	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()
        })

except xmlrpclib.Fault, e:
    print 'Server responded with an error: %s' % e
Exemplo n.º 4
0
#!/usr/bin/python

'''
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': '0', 'max-overall-upload-limit': '0' })
	else:
		s.aria2.changeGlobalOption({'max-overall-download-limit': '0', 'max-overall-upload-limit': '0' })

except xmlrpclib.Fault, e:
	print 'Server responded with an error: %s' % e
	sys.exit(2)
Exemplo n.º 5
0
#!/usr/bin/python
'''
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.pauseAll(c.conf_auth_token())
    else:
        s.aria2.pauseAll()

except xmlrpclib.Fault, e:
    print 'Server responded with an error: %s' % e
    sys.exit(2)
Exemplo n.º 6
0
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
	else:
		# If it's a multiple file situation
Exemplo n.º 7
0
#!/usr/bin/python

'''
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() })

except xmlrpclib.Fault, e:
	print 'Server responded with an error: %s' % e
	sys.exit(2)
Exemplo n.º 8
0
#!/usr/bin/python

'''
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_unlimited_maxspeed(), 'max-overall-upload-limit': c.conf_cron_unlimited_maxupspeed() })
	else:
		s.aria2.changeGlobalOption({'max-overall-download-limit': c.conf_cron_unlimited_maxspeed(), 'max-overall-upload-limit': c.conf_cron_unlimited_maxupspeed() })

except xmlrpclib.Fault, e:
	print 'Server responded with an error: %s' % e
	sys.exit(2)
Exemplo n.º 9
0
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
    sys.exit(2)