提问人:カルロサグ 提问时间:7/11/2023 最后编辑:カルロサグ 更新时间:7/12/2023 访问量:110
aria2c 的 RPC 接口中的 aria2.addTorrent 方法忽略 “dir” 选项
The aria2.addTorrent method in aria2c's RPC interface ignores "dir" option
问:
我在服务器上使用 aria2c 作为守护程序(RPC 接口),当我使用 aria2.addTorrent 方法添加 torrent + 必须下载文件的特定目录时,aria2c 会下载文件,但不在我指定的目录中
这就是我运行守护进程的方式:
aria2c --log="the.log" --disable-ipv6 \
--enable-rpc --rpc-listen-all --rpc-listen-port=7777 \
--seed-time=0 --bt-tracker-connect-timeout=30 --bt-tracker-timeout=10
这是我在本地发送到 aria2c 服务器的数据(作为 JSON):
{
"jsonrpc":"2.0",
"id":user_id,
"method":"aria2.addTorrent",
"params":[mfile_base64,[{"dir":outdir_str}]],
}
# user_id = Some random username or id
# mfile_base64 = Base64 encoded contents of the metafile (the .torrent file)
# outdir_str = The directory were I want the file(s) to be downloaded
同样,该文件已正确下载,但不在我想要的目录中:它正在我的当前工作目录中下载
如果有人问,我的读/写访问权限很好,该目录甚至在下载开始之前就存在,它是一个普通的目录,它不是另一个分区的挂载点或网络上的任何其他资源,等等......等。。。等。。。
编辑 1
# I tried this:
{
"jsonrpc":"2.0",
"id":user_id,
"method":"aria2.addTorrent",
"params":[mfile_base64,{"dir":outdir_str}],
}
# And the download does not even start, it throws an error, this is the JSON response:
{'id': 'user1', 'jsonrpc': '2.0', 'error': {'code': 1, 'message': 'The parameter at 1 has wrong type.'}}
答:
0赞
カルロサグ
7/12/2023
#1
已修复
参数列表中缺少一个元素:URI 列表 就我而言,我把它留空了,因为我没有什么可以放进去的
{
"jsonrpc":"2.0",
"id":user_id,
"method":"aria2.addTorrent",
"params":[mfile_base64,[],{"dir":outdir_str}],
}
它起作用了:选项字典不再被忽略,因此,文件被下载到我想要的目录中
评论