-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (18 loc) · 758 Bytes
/
test.py
File metadata and controls
23 lines (18 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding=utf-8 -*-
from aria2.Aria2Rpc import Aria2JsonRpc
from config import RPC_URL
headers = {
'Accept-Encoding': 'gzip, deflate',
'Host': 'wst.shawblog.me',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'text/plain, */*; q=0.01',
'Connection': 'keep-alive',
}
def test_aria2_add_url():
rpc = Aria2JsonRpc(RPC_URL)
headers['Cookie'] = "sessionId=sadsadsad;uind=asdas1212das"
rpc.addUris(['http://localhost:9010/login'], headers=headers)
if __name__ == '__main__':
test_aria2_add_url()