创建、读取和编辑torrent文件的cli工具
torf-cli的Python项目详细描述
torf cli是一个命令行工具,可以创建torrents和magnet链接,dump 激流的元信息,编辑现有的洪流(例如修复一个错误) 不用再把所有的碎片都散开)。
该输出对人类来说很容易阅读,并且很容易用common cli解析 如果stdout不是tty,则使用工具。
可选配置文件指定自定义默认选项和配置文件 为一组选项命名的。
文档可以作为手册页提供,也可以read it here。
示例
使用两个跟踪器创建私有Torrent:
$ torf ./docs -t http://bar:123/announce -t http://baz:321/announce --private Name docs Size 60.1 KiB Created 2018-06-19 14:47:26 Private yes Trackers http://bar:123/announce http://baz:321/announce Piece Size 16 KiB Piece Count 4 File Count 3 Files docs ├─torf.1 ├─torf.1.asciidoc └─torf.1.html Path docs Progress 100.00 % | Time: 0:00:00 |58.84 MB/s Info Hash 215f506179b6526b582e4fb78ebc24dd1f2a791f Magnet magnet:?xt=urn:btih:215f506179b6526b582e4fb78ebc24dd1f2a791f&dn=docs&xl=61542&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2Fannounce Torrent docs.torrent
显示现有洪流的元信息:
$ torf -i docs.torrent Name docs Info Hash 215f506179b6526b582e4fb78ebc24dd1f2a791f Size 60.1 KiB Created 2018-06-19 14:47:26 Private yes Trackers http://bar:123/announce http://baz:321/announce Piece Size 16 KiB Piece Count 4 File Count 3 Files docs ├─torf.1 ├─torf.1.asciidoc └─torf.1.html Magnet magnet:?xt=urn:btih:215f506179b6526b582e4fb78ebc24dd1f2a791f&dn=docs&xl=61542&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2Fannounce
快速添加注释到现有洪流:
$ torf -i docs.torrent --comment 'Forgot to add this comment.' -o docs.revised.torrent Name docs Info Hash 215f506179b6526b582e4fb78ebc24dd1f2a791f Size 60.1 KiB Comment Forgot to add this comment. Created 2018-06-19 14:47:26 Private yes Trackers http://bar:123/announce http://baz:321/announce Piece Size 16 KiB Piece Count 4 File Count 3 Files docs ├─torf.1 ├─torf.1.asciidoc └─torf.1.html Magnet magnet:?xt=urn:btih:215f506179b6526b582e4fb78ebc24dd1f2a791f&dn=docs&xl=61542&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2Fannounce Torrent docs.revised.torrent
获取文件列表:
$ torf -i docs.revised.torrent | grep '^Files'| cut -f2- docs/torf.1 docs/torf.1.asciidoc docs/torf.1.html
安装
皮普西
最简单、最干净的安装方法是pipsi,它使用 ~/.local/venvs/和链接中单独虚拟环境中的依赖项 对~/.local/bin/的可执行文件。
$ pipsi install torf-cli
$ pipsi upgrade torf-cli
$ pipsi uninstall torf-cli # Also removes dependencies
唯一的缺点是,在写这篇文章的时候,皮普斯并没有让这个人 页面可用。但你可以read it in your browser。
PIP
另一种选择是普通的pip,但是如果你 决定卸载,您必须手动卸载依赖项。
$ pip3 install torf-cli # Installs system-wide (/usr/local/) $ pip3 install --user torf-cli # Installs in your home (~/.local/)
latest development version是 在github的主分支中提供。
$ pip3 install [--user] git+https://github.com/rndusr/torf-cli.git
贡献
在issue tracker中欢迎错误报告和功能请求。
许可证
torf cli是免费软件:您可以在 自由软件发布的GNU通用公共许可条款 基金会,许可证的第3版,或(由您选择)以后的任何版本 版本。
这个程序的发布是希望它能有用,但是没有 保证;甚至没有对商品的适销性或适用性的暗示保证 特殊目的。有关详细信息,请参见GNU General Public License。