Skip to content

Instantly share code, notes, and snippets.

@lizhaode
Created December 17, 2019 09:48
Show Gist options
  • Save lizhaode/55d7211672f1c8065529e34b4d111027 to your computer and use it in GitHub Desktop.
Save lizhaode/55d7211672f1c8065529e34b4d111027 to your computer and use it in GitHub Desktop.
send aria task by http
import requests
base_url = 'http://1.1.1.1:6800/jsonrpc'
data = {
'jsonrpc': '2.0',
'method': 'aria2.addUri',
'id': '0',
'params': ['token:', ['https://example.com/file'], {'out': 'aaa', 'dir': '/opt/drive/bbb'}]
}
re = requests.post(base_url, json=data)
print(re.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment