>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') +>>> opts = dict(dir='/tmp', +... header=['Accept-Language: ja', +... 'Accept-Charset: utf-8']) +>>> s.aria2.addUri(['http://example.org/file'], opts) +'1'+
From 119cf01f6c4d30fc7648552b7b7c901fa592f013 Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa
Following example adds a download with 2 options: dir and header. +header option has 2 values, so it uses a list:
>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') +>>> opts = dict(dir='/tmp', +... header=['Accept-Language: ja', +... 'Accept-Charset: utf-8']) +>>> s.aria2.addUri(['http://example.org/file'], opts) +'1'+
The following Ruby script adds http://localhost/aria2.tar.bz2 to aria2c operated on localhost with option --dir=/downloads and @@ -4538,7 +4550,7 @@ files in the program, then also delete it here.