use rpc to get aria2 verison
@@ -163,10 +163,12 @@ class Aria2DownloadRPC(DownloadService):
@staticmethod
def check_aria2c_version():
- command = [ARIA2_PATH, '--version']
- p = subprocess.Popen(command, env={'PATH': '/usr/local/bin:/usr/bin:/bin',
- 'HOME': os.environ.get('HOME', '/tmp')}, stdout=subprocess.PIPE)
- version = re.findall('aria2 version (.*)', str(p.stdout.read()).splitlines()[0])
+ url = ARIA2_RPC_URL.split('/')
+ url[2] = ARIA2_RPC_TOKEN + '@' + url[2]
+ url = '/'.join(url)
+ s = ServerProxy(url)
+ r = s.aria2.getVersion('token:{}'.format(ARIA2_RPC_TOKEN), )
+ version = r['version']
if version:
Aria2DownloadRPC.old_version = version[0] < '1.18.4'
else:
