私は、リモートコントロール用のダウンロードクライアントとしてaria2を使用しています。Python xmlrpcを使用してaria2にオプションを追加できませんか?
ショーをaria2ものと、それが実行されるスクリプトに3つのパラメータを渡すことができ、--on-download-complete
をサポートしています。ここでのリファレンスです:https://aria2.github.io/manual/en/html/aria2c.html?highlight=on-download#event-hook
しかし、今、私はAria2に話をするPythonのXMLRPCのラッパーを使用しています。 https://github.com/alfateam123/pyaria2
server = PyAria2( 'localhost', 6800, rpcSecret={"useSecret": False, "secret": None} ) unique_id_accepted = server.addUri([http://somewhere.com/somefile.iso], options={ "dir": "/srv/", "gid": "abcdef1234567890", "max-connection per-server": 5, "on-download-complete": "touch /tmp/done" } )
をAria2がunique_id_accepted
は、このシナリオでgid
と同じであり、URIからダウンロードを開始した場合:これは私が使用していたラッパーです。実際にはaria2が動作します。 Aria2でダウンロードしたジョブを見ると、gid
が受け入れられます。しかし、それが完了した後、それがコマンドにtouch /tmp/done
を実行していないオプションに何か問題はありますか?
どのようにそれが完了した後にコマンドを実行するためにaria2する話すことができましたか?
ありがとうございます! "onDownloadComplete": "touch /tmp/done"
しかし、それはまだ動作しません:
更新が私はこの行を試してみました https://aria2.github.io/manual/en/html/aria2c.html#sample-xml-rpc-client-code
Sample XML-RPC Client Code
を見つけました。
1.18.1 ** Configuration ** Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5 Libraries: zlib/1.2.8 libxml2/2.9.1 sqlite3/3.8.1 GnuTLS/2.12.23 libgcrypt/1.5.3 c-ares/1.10.0