Package: torf-cli
torf-cli is a command line tool that can create, read and edit torrent files and
magnet URIs. It can also verify a file system path against a torrent and provide
detailed errors. When creating a torrent, it can find an existing torrent with
the same files and copy its piece hashes to the freshly created torrent to avoid
hashing the files again.The output is pleasant to read for humans or easy to parse with common CLI
tools.An optional configuration file specifies custom default options and profiles
that combine commonly used options.Documentation is available as a man page, or you canread it here.The only dependencies aretorfandpyxdg.ExamplesCreate private torrent with two trackers and a specific creation date:$torf./docs-thttp://bar:123/announce-thttp://baz:321/announce\--private--date'2020-03-31 21:23:42'NamedocsSize74.43KiBCreated2020-03-3121:23:42CreatedBytorf3.1.0PrivateyesTrackershttp://bar:123/announcehttp://baz:321/announcePieceSize16KiBPieceCount5FileCount3Filesdocs├─torf.1[14.53KiB]├─torf.1.asciidoc[10.56KiB]└─torf.1.html[49.34KiB]Progress100.00%|0:00:00total|72.69MiB/sInfoHash0a9dfcf07feb2a82da11b509e8929266d8510a02Magnetmagnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02&dn=docs&xl=76217&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2FannounceTorrentdocs.torrentDisplay information about an existing torrent:$torf-idocs.torrentNamedocsInfoHash0a9dfcf07feb2a82da11b509e8929266d8510a02Size74.43KiBCreated2020-03-3121:23:42CreatedBytorf3.1.0PrivateyesTrackershttp://bar:123/announcehttp://baz:321/announcePieceSize16KiBPieceCount5FileCount3Filesdocs├─torf.1[14.53KiB]├─torf.1.asciidoc[10.56KiB]└─torf.1.html[49.34KiB]Magnetmagnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02&dn=docs&xl=76217&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2FannounceQuickly add a comment to an existing torrent:$torf-idocs.torrent--comment'Forgot to add this comment.'-odocs.revised.torrentNamedocsInfoHash0a9dfcf07feb2a82da11b509e8929266d8510a02Size74.43KiBCommentForgottoaddthiscomment.Created2020-03-3121:23:42CreatedBytorf3.1.0PrivateyesTrackershttp://bar:123/announcehttp://baz:321/announcePieceSize16KiBPieceCount5FileCount3Filesdocs├─torf.1[14.53KiB]├─torf.1.asciidoc[10.56KiB]└─torf.1.html[49.34KiB]Magnetmagnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02&dn=docs&xl=76217&tr=http%3A%2F%2Fbar%3A123%2Fannounce&tr=http%3A%2F%2Fbaz%3A321%2FannounceTorrentdocs.revised.torrentVerify the files indocs:$<edittorf.1.html>$torf-idocs.revised.torrentdocsNamedocsInfoHash0a9dfcf07feb2a82da11b509e8929266d8510a02Size74.43KiBCommentForgottoaddthiscomment.Created2020-03-3121:23:42CreatedBytorf3.1.0PrivateyesTrackershttp://bar:123/announcehttp://baz:321/announcePieceSize16KiBPieceCount5FileCount3Filesdocs├─torf.1[14.53KiB]├─torf.1.asciidoc[10.56KiB]└─torf.1.html[49.34KiB]PathdocsInfoHash0a9dfcf07feb2a82da11b509e8929266d8510a02Errordocs/torf.1.html:Toobig:50523insteadof50522bytesErrorCorruptioninpiece2,atleastoneofthesefilesiscorrupt:docs/torf.1.asciidocdocs/torf.1.htmlProgress100.00%|0:00:00total|72.69MiB/storf:docsdoesnotsatisfydocs.revised.torrentGet a list of files viagrepandcut:$torf-idocs.revised.torrent|grep'^Files'|cut-f2-docs/torf.1docs/torf.1.asciidocdocs/torf.1.html# Files are delimited by a horizontal tab (``\t``)Get a list of files viajq:$torf-idocs.revised.torrent--json|jq.Files["docs/torf.1","docs/torf.1.asciidoc","docs/torf.1.html"]Get metainfo as JSON:$torf-idocs.revised.torrent-m{"announce":"http://bar:123/announce","announce-list":[["http://bar:123/announce"],["http://baz:321/announce"]],"comment":"Forgot to add this comment.","created by":"torf 3.1.0","creation date":1585682622,"info":{"name":"docs","piece length":16384,"private":1,"files":[{"length":14877,"path":["torf.1"]},{"length":10818,"path":["torf.1.asciidoc"]},{"length":50522,"path":["torf.1.html"]}]}}InstallationThe latest release is available onPyPIand onAUR.pipxThe easiest and cleanest installation method ispipx, which installs each application with all
dependencies in a separate virtual environment in~/.local/venvs/and links
the executable to~/.local/bin/.$pipxinstalltorf-cli$pipxupgradetorf-cli$pipxuninstalltorf-cli# Also removes dependenciesThe only drawback is that, at the time of writing, pipx doesn’t make the man
page available, butit’s also available here.pipThe alternative is regularpip, but if you
decide to uninstall, you have to manually uninstall the dependencies.$pip3installtorf-cli# Installs system-wide (/usr/local/)$pip3install--usertorf-cli# Installs in your home (~/.local/)Thelatest development versionis
available on GitHub in the master branch.$pip3install[--user]git+https://github.com/rndusr/torf-cli.gitContributingBug reports and feature requests are welcome in theissue tracker.Licensetorf-cli is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.This program is distributed in the hope that it will be useful but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See theGNU General Public Licensefor more details.