Skip to content

Instantly share code, notes, and snippets.

@lizhaode
lizhaode / aria2.py
Created December 17, 2019 09:48
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'}]
}
@lizhaode
lizhaode / log.py
Created December 10, 2019 10:01
set log format
logging.basicConfig(format='%(asctime)s %(levelname)s %(thread)d --- [%(name)s-%(threadName)s] %(message)s',level=logging.DEBUG)