transmission CLI 设置

由于不想在本地win系统上安装多余的下载软件,同时又有种子文件的下载需求。于是想在服务器上安装一款小巧并具有CLI功能的种子下载软件。transmission是预装在ubuntu系统中的默认种子下载器,一番查询后决定加装它的CLI功能。

首先需要安装transmission-daemon

sudo apt install transmission-daemon

在安装transmission-daemon时,ubuntu会自动安装上transmission-remote

安装完成后,还不能直接就开始种子或磁力的下载,如果直接运行

transmission-remote -a "magnet:?xt=urn:btih:9f9165d9a281a9b8e782cd5176bbcc8256fd1871&dn=Ubuntu+16.04.1+LTS+Desktop+64-bit&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969"

会直接报错:

transmission-remote Unexpected response:
401: Unauthorized

需要先关闭 transmission-daemon

/etc/init.d/transmission-daemon stop

简单配置一下配置文件:

sudo vim /etc/transmission-daemon/settings.json

将”rpc-authentication-required”: true, 改为 “rpc-authentication-required”: false,

保存并重启transmission-daemon

/etc/init.d/transmission-daemon restart

然后需要手动设置一下transmission的默认下载目录:

transmission-daemon --download-dir "/home/xcb/Downloads"

这个下载目录的设置只对本次会话生效,断开终端重新连接就不行了。如果需要永久修改下载位置的话,需要在settings.json里面修改:

"download-dir": "/var/lib/transmission-daemon/downloads",

然后就可以运行下载命令:

transmission-remote -a "magnet:?xt=urn:btih:9f9165d9a281a9b8e782cd5176bbcc8256fd1871&dn=Ubuntu+16.04.1+LTS+Desktop+64-bit&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969"

运行

transmission-remote -l

来查看下载进度

transmission-remote -t ID -r

来删除下载进程

设置简单总结如下:

sudo apt install transmission-daemon
/etc/init.d/transmission-daemon stop
sudo vim /etc/transmission-daemon/settings.json
/etc/init.d/transmission-daemon restart
transmission-daemon --download-dir "/home/xcb/Downloads"
transmission-remote -a "magnet:?xt=urn:btih:9f9165d9a281a9b8e782cd5176bbcc8256fd1871&dn=Ubuntu+16.04.1+LTS+Desktop+64-bit&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969"
transmission-remote -l

参考文章:

https://cli-ck.io/transmission-cli-user-guide/

https://stackoverflow.com/questions/18936994/transmission-remote-commands-are-erroring-with-unexpected-response-h1401-una

https://forum.transmissionbt.com/viewtopic.php?t=12696

尽量不要在/etc/transmission-daemon/settings.json 修改下载地址,没研究明白前别乱改地址,我改了之后下载不了东西了。。。。

不过不修改地址的话,一切正常,很好用~~nice。

20211207

0

评论0

没有账号? 注册  忘记密码?