Linux系统下简洁高效的BT/PT下载工具rtorrent

rtorrent是一个非常简洁、优秀、非常轻量的BT客户端. 它使用了 ncurses 库以 C++ 编写, 因此它完全基于文本并在终端中运行. 将 rTorrent 用在安装有 GNU Screen 和 openssh 的低端系统上作为远程的 BT 客户端是非常理想的。

rtorrent的安装非常简单,这里以debian系统为例,简单的运行下面的命令,rtorrent就安装到了我们的电脑上了。
#apt-get install rtorrent

安装完成以后,我们需要简单的配置一下才能更好的使用。在当前用户目录下新建一个名为 .rtorrent.rc 的配置文件。下面这些配置的值只是个人观点,这主要取决于你的系统和网络速度。

 

# 每个种子所允许的最大最小连接数
#min_peers = 40
max_peers = 52

# 同上,针对的是已经完成的种子 (-1 表示和下载中的种子一致)
#min_peers_seed = 10
max_peers_seed = 52

# 每个种子的最大同时上传数
max_uploads = 8

# 全局的上传与下载速度限制(以 KB 为单位),“0”表示无限制
download_rate = 200
upload_rate = 28

# 设定默认保存 torrents 的目录
directory = /home/[user]/torrents/

# 默认会话目录. 确保你没有同时运行使用相同会话目录的 rTorrent 程序.
# 或者是否使用了一个相对路径?
session = /home/[user]/.session/

# 监听目录中的新的种子文件,并停止那些已经被删除部分的种子
#schedule = watch_directory,5,5,load_start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=
schedule = watch_directory,5,5,load_start=/home/[user]/watch/*.torrent
schedule = untied_directory,5,5,stop_untied=
schedule = tied_directory,5,5,start_tied=

# 当磁盘空间不足时停止下载
schedule = low_diskspace,5,60,close_low_diskspace=100M

# 侦听端口范围
port_range = 49164-49164

# 是否在下载完成时进行校验。
check_hash = yes

# 加密选项,设为0(默认情况)或下面的任何一个:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# 如下例中的值将允许将接入连接加密,开始时以非加密方式作为连接的输出方式,
# 如行不通则以加密方式进行重试,在加密握手后,优先选择将纯文本以 RC4 加密
#
# encryption = allow_incoming,enable_retry,prefer_plaintext
encryption = allow_incoming,try_outgoing,enable_retry

# 使能对 trackerless torrents 或当所有的 tracker 都停止情况下的 DHT 支持。
# 可以被设置为 "disable" (完全禁止 DHT),“off“(不启动 DHT), "auto"(按需要启
# 动或停止 DHT)或者 "on" (即时开启 DHT)。
# 默认设置为 "off"。要使 DHT 工作,会话目录必须被定义。
#
# dht = auto
# UDP 使用 UHT的端口
#
# dht_port = 6881
# 使能 peer 的交换 (对那些没有被标记为私有的 torrent)
#
# peer_exchange = yes

这里有一点需要注意的是,因为rtorrent是运行在终端下面的程序,而我们一般都会通过SSH远程来控制我们的服务器,这时我们如果断开SSH连接,rtorrent系统也会随之退出,所以我们一般需要搭配screen程序来一起使用。

下面是一些我们经常会用到的rtorrent操作的快捷键

添加和删除 torrents

回退键     用 URL 或者文件路径添加,采用 tab 键查看目录内容并自动完成,支持通配符,例如: ~/torrent/*

回车键     和回退键一样,但是添加的 torrent 保持非激活( inactive )状态 (用 ^s 激活)

^o     对选择的 torrent 设置新的下载目录,仅仅对还没有被激活过的 torrent

^s     开始下载,先运行 hash ,除非已经做过

^d     停止激活的下载,或者删除一个停止的下载

^r     初始化 torrent 的 hash 检查

注意: ^s 和 ^q 在 shell 里面经常用来控制屏幕的暂停,这会和 rTorrent 发生冲突,用 stty -a 来检查是否已经被使用,删除的办法是:

stty stop undef

stty start undef

before running rTorrent (or reattaching to screen) to leave them undefined. You could also replace undef with some other code — ^p, say. ^d also usually sends end-of-file but ncurses passes this through to rTorrent. stty eof undef if you are worried.

To fix this, you may also toggle the flow control in screen with ^a ^f until screen displays “-flow” in the bottom left corner.

修改带宽

a/s/d     增加上传带宽 1/5/50 KB.

z/x/c     降低上传带宽 1/5/50 KB.

A/S/D     增加下载带宽 1/5/50 KB.

Z/X/C     降低下载带宽 1/5/50 KB.

Common Error Messages

Could not parse bencoded data

This message is caused by bad communication with the tracker, often caused by invalid client authentication (passkey, IP address, etc.)

Could not create download, the input is not a valid torrent

This message is caused by a corrupted or otherwise non-valid .torrent file. You should redownload the .torrent file or possibly find a new source for it.

浏览

Global Keys

^q     关闭 rTorrent,再按一次,强行关闭

上下箭头     选择 torrent

左键     回到前一个屏幕

主屏幕视图操作

向右键     切换到下载视图

^r     检查 hash

+/-     修改优先度

l     查看日志,空格退出

1     显示所有下载

2     显示所有下载,按文件名排序

3     显示开始的下载

4     显示停止的下载

5     显示完成的下载

6     显示未完成的下载

7     显示正在 hash 的下载

8     显示正在做种的下载

下载视图

right     Switch to selected view

left     Switch to view selection or back to main view

1/2     Adjust max uploads.

3/4     Adjust min peers.

5/6     Adjust max peers.

p     显示 peer

o     显示 torrent 信息

i     Display file list

u     Display tracker list

t/T     Initiate tracker request. Use capital T to force the request, ignoring the “min interval” set by the tracker.

Peer list View Keys

left     Switch to view selection

right     Show peer details

*     Snub peer (stop uploading to this peer)

k     Kick peer (disconnect from peer)

File list View Keys

left     Switch to view selection

right     Show file details

space     Change the file priority; applies recursively when done on a directory

*     Change the priority of all files

/     Collapse directories. While collapsed, press right to expand the selected directory.

Priority options are blank (standard priority), hig (high priority) and off (not to be downloaded).

Tracker list View Keys

left     Switch to view selection

*     Enable/disable tracker

space     Rotate trackers in a group

发表评论?

1 条评论。

  1. 饿了就啃我衣服,狗粮从来不吃,晚上趁我睡着了,自己偷冰箱里的大蒜吃。

回复给 嘟嘟传奇 ¬
取消回复


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>