首先,我想创建 shell 脚本来在 torrent 客户端中启动/停止下载。我不需要 CLI,但如果您知道如何使用 shell 脚本通过 CLI 执行此操作,那就没问题了。
我使用 jDownloader,它是一个基于 GUI 的应用程序,但有一些如下所示的命令行参数,我用它来启动/停止下载。
-h/--help Show this help message
-a/--add-link(s) Add links
-co/--add-container(s) Add containers
-d/--start-download Start download
-D/--stop-download Stop download
-H/--hide Don't open Linkgrabber when adding Links
-m/--minimize Minimize download window
-f/--focus Get jD to foreground/focus
-s/--show Show JAC prepared captchas
-t/--train Train a JAC method
-r/--reconnect Perform a Reconnect
-C/--captcha <filepath or url> <method> Get code from image using JAntiCaptcha
-p/--add-password(s) Add passwords
-n --new-instance Force new instance if another jD is running
因此我可以轻松地按如下方式开始/停止下载,
jdownloader --start-download
jdownloader --stop-download
现在我想要 torrent 客户端通过 shell 脚本来执行此操作。
答案1
rtorrent、deluge 和 transmission 都具有原生的 Linux torrent 客户端,可以通过命令行进行操作。
答案2
我用Flush
通过终端启动或停止正在运行的实例的 torrent 下载。
我可以将这些选项与 flush 一起使用。
--start={all,downloads,uploads} Start torrents
--stop={all,downloads,uploads} Stop torrents
其他 torrent 客户端的命令行选项
1.Deluge
选择很少
Usage: deluge-gtk [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
Common Options:
-c CONFIG, --config=CONFIG
Set the config folder location
-l LOGFILE, --logfile=LOGFILE
Output to designated logfile instead of stdout
-L LOGLEVEL, --loglevel=LOGLEVEL
Set the log level: none, info, warning, error,
critical, debug
-q, --quiet Sets the log level to 'none', this is the same as `-L
none`
2. 对于Transmission
Usage:
transmission-gtk [OPTION...] [torrent files or urls]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
GTK+ Options
--class=CLASS Program class as used by the window manager
--name=NAME Program name as used by the window manager
--screen=SCREEN X screen to use
--sync Make X calls synchronous
--gtk-module=MODULES Load additional GTK+ modules
--g-fatal-warnings Make all warnings fatal
Application Options:
-p, --paused Start with all torrents paused
--version Show version number and exit
-m, --minimized Start minimized in notification area
-g, --config-dir Where to look for configuration files
--display=DISPLAY X display to use
3.qbittorrent
选项
Usage:
qbittorrent --version: displays program version
qbittorrent --no-splash: disable splash screen
qbittorrent --help: displays this help message
qbittorrent --webui-port=x: changes the webui port (current: 8080)
qbittorrent [files or urls]: downloads the torrents passed by the user (optional)