{"id":13569690,"url":"https://github.com/rndusr/torf-cli","last_synced_at":"2025-04-08T18:19:20.925Z","repository":{"id":57476597,"uuid":"117556165","full_name":"rndusr/torf-cli","owner":"rndusr","description":"CLI tool for creating, reading and editing torrent files","archived":false,"fork":false,"pushed_at":"2024-12-23T10:20:23.000Z","size":612,"stargazers_count":147,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T16:17:00.653Z","etag":null,"topics":["cli","magnet-link","magnet-uri","torrent","torrent-files"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rndusr.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-15T14:34:03.000Z","updated_at":"2025-03-29T18:08:20.000Z","dependencies_parsed_at":"2024-01-16T20:25:06.420Z","dependency_job_id":"bfcbcdf6-8d57-4e69-97f8-9110061b3288","html_url":"https://github.com/rndusr/torf-cli","commit_stats":{"total_commits":520,"total_committers":4,"mean_commits":130.0,"dds":0.01538461538461533,"last_synced_commit":"53bfabd991600f30bfa1a5cf22320ca507132782"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rndusr%2Ftorf-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rndusr%2Ftorf-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rndusr%2Ftorf-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rndusr%2Ftorf-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rndusr","download_url":"https://codeload.github.com/rndusr/torf-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247898519,"owners_count":21014722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","magnet-link","magnet-uri","torrent","torrent-files"],"created_at":"2024-08-01T14:00:42.849Z","updated_at":"2025-04-08T18:19:20.898Z","avatar_url":"https://github.com/rndusr.png","language":"Python","readme":"torf-cli\n========\n\ntorf-cli is a command line tool that can create, read and edit torrent files and\nmagnet URIs. It can also verify a file system path against a torrent and provide\ndetailed errors. When creating a torrent, it can find an existing torrent with\nthe same files and copy its piece hashes to the freshly created torrent to avoid\nhashing the files again.\n\nThe output is pleasant to read for humans or easy to parse with common CLI\ntools.\n\nAn optional configuration file specifies custom default options and profiles\nthat combine commonly used options.\n\nDocumentation is available as a man page, or you can `read it here\n\u003chttps://rndusr.github.io/torf-cli/torf.1.html\u003e`_.\n\nThe only dependencies are `torf \u003chttps://pypi.org/project/torf/\u003e`_ and `pyxdg\n\u003chttps://pypi.org/project/pyxdg/\u003e`_.\n\n\nExamples\n--------\n\nCreate private torrent with two trackers and a specific creation date:\n\n.. code:: sh\n\n    $ torf ./docs -t http://bar:123/announce -t http://baz:321/announce \\\n                  --private --date '2020-03-31 21:23:42'\n           Name  docs\n           Size  74.43 KiB\n        Created  2020-03-31 21:23:42\n     Created By  torf 3.1.0\n        Private  yes\n       Trackers  http://bar:123/announce\n                 http://baz:321/announce\n     Piece Size  16 KiB\n    Piece Count  5\n     File Count  3\n          Files  docs\n                 ├─torf.1 [14.53 KiB]\n                 ├─torf.1.asciidoc [10.56 KiB]\n                 └─torf.1.html [49.34 KiB]\n       Progress  100.00 % | 0:00:00 total | 72.69 MiB/s\n      Info Hash  0a9dfcf07feb2a82da11b509e8929266d8510a02\n         Magnet  magnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02\u0026dn=docs\u0026xl=76217\u0026tr=http%3A%2F%2Fbar%3A123%2Fannounce\u0026tr=http%3A%2F%2Fbaz%3A321%2Fannounce\n        Torrent  docs.torrent\n\nDisplay information about an existing torrent:\n\n.. code:: sh\n\n    $ torf -i docs.torrent\n           Name  docs\n      Info Hash  0a9dfcf07feb2a82da11b509e8929266d8510a02\n           Size  74.43 KiB\n        Created  2020-03-31 21:23:42\n     Created By  torf 3.1.0\n        Private  yes\n       Trackers  http://bar:123/announce\n                 http://baz:321/announce\n     Piece Size  16 KiB\n    Piece Count  5\n     File Count  3\n          Files  docs\n                 ├─torf.1 [14.53 KiB]\n                 ├─torf.1.asciidoc [10.56 KiB]\n                 └─torf.1.html [49.34 KiB]\n         Magnet  magnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02\u0026dn=docs\u0026xl=76217\u0026tr=http%3A%2F%2Fbar%3A123%2Fannounce\u0026tr=http%3A%2F%2Fbaz%3A321%2Fannounce\n\nQuickly add a comment to an existing torrent:\n\n.. code:: sh\n\n    $ torf -i docs.torrent --comment 'Forgot to add this comment.' -o docs.revised.torrent\n           Name  docs\n      Info Hash  0a9dfcf07feb2a82da11b509e8929266d8510a02\n           Size  74.43 KiB\n        Comment  Forgot to add this comment.\n        Created  2020-03-31 21:23:42\n     Created By  torf 3.1.0\n        Private  yes\n       Trackers  http://bar:123/announce\n                 http://baz:321/announce\n     Piece Size  16 KiB\n    Piece Count  5\n     File Count  3\n          Files  docs\n                 ├─torf.1 [14.53 KiB]\n                 ├─torf.1.asciidoc [10.56 KiB]\n                 └─torf.1.html [49.34 KiB]\n         Magnet  magnet:?xt=urn:btih:0a9dfcf07feb2a82da11b509e8929266d8510a02\u0026dn=docs\u0026xl=76217\u0026tr=http%3A%2F%2Fbar%3A123%2Fannounce\u0026tr=http%3A%2F%2Fbaz%3A321%2Fannounce\n        Torrent  docs.revised.torrent\n\nVerify the files in ``docs``:\n\n.. code:: sh\n\n    $ \u003cedit torf.1.html\u003e\n    $ torf -i docs.revised.torrent docs\n           Name  docs\n      Info Hash  0a9dfcf07feb2a82da11b509e8929266d8510a02\n           Size  74.43 KiB\n        Comment  Forgot to add this comment.\n        Created  2020-03-31 21:23:42\n     Created By  torf 3.1.0\n        Private  yes\n       Trackers  http://bar:123/announce\n                 http://baz:321/announce\n     Piece Size  16 KiB\n    Piece Count  5\n     File Count  3\n          Files  docs\n                 ├─torf.1 [14.53 KiB]\n                 ├─torf.1.asciidoc [10.56 KiB]\n                 └─torf.1.html [49.34 KiB]\n           Path  docs\n      Info Hash  0a9dfcf07feb2a82da11b509e8929266d8510a02\n          Error  docs/torf.1.html: Too big: 50523 instead of 50522 bytes\n          Error  Corruption in piece 2, at least one of these files is corrupt:\n                   docs/torf.1.asciidoc\n                   docs/torf.1.html\n       Progress  100.00 % | 0:00:00 total | 72.69 MiB/s\n    torf: docs does not satisfy docs.revised.torrent\n\nGet a list of files via ``grep`` and ``cut``:\n\n.. code:: sh\n\n    $ torf -i docs.revised.torrent | grep '^Files' | cut -f2-\n    docs/torf.1     docs/torf.1.asciidoc    docs/torf.1.html\n    # Files are delimited by a horizontal tab (``\\t``)\n\nGet a list of files via `jq \u003chttps://stedolan.github.io/jq/\u003e`_:\n\n.. code:: sh\n\n    $ torf -i docs.revised.torrent --json | jq .Files\n    [\n      \"docs/torf.1\",\n      \"docs/torf.1.asciidoc\",\n      \"docs/torf.1.html\"\n    ]\n\nGet metainfo as JSON:\n\n.. code:: sh\n\n    $ torf -i docs.revised.torrent -m\n    {\n        \"announce\": \"http://bar:123/announce\",\n        \"announce-list\": [\n            [\n                \"http://bar:123/announce\"\n            ],\n            [\n                \"http://baz:321/announce\"\n            ]\n        ],\n        \"comment\": \"Forgot to add this comment.\",\n        \"created by\": \"torf 3.1.0\",\n        \"creation date\": 1585682622,\n        \"info\": {\n            \"name\": \"docs\",\n            \"piece length\": 16384,\n            \"private\": 1,\n            \"files\": [\n                {\n                    \"length\": 14877,\n                    \"path\": [\n                        \"torf.1\"\n                    ]\n                },\n                {\n                    \"length\": 10818,\n                    \"path\": [\n                        \"torf.1.asciidoc\"\n                    ]\n                },\n                {\n                    \"length\": 50522,\n                    \"path\": [\n                        \"torf.1.html\"\n                    ]\n                }\n            ]\n        }\n    }\n\n\nInstallation\n------------\n\nThe latest release is available on `PyPI \u003chttps://pypi.org/project/torf-cli\u003e`_\nand on `AUR \u003chttps://aur.archlinux.org/packages/torf-cli/\u003e`_.\n\n\npipx\n````\n\nThe easiest and cleanest installation method is `pipx\n\u003chttps://pipxproject.github.io/pipx/\u003e`__, which installs each application with all\ndependencies in a separate virtual environment in ``~/.local/venvs/`` and links\nthe executable to ``~/.local/bin/``.\n\n.. code:: sh\n\n    $ pipx install torf-cli\n    $ pipx upgrade torf-cli\n    $ pipx uninstall torf-cli  # Also removes dependencies\n\nThe only drawback is that, at the time of writing, pipx doesn't make the man\npage available, but `it's also available here\n\u003chttps://rndusr.github.io/torf-cli/torf.1.html\u003e`_.\n\n\npip\n```\n\nThe alternative is regular `pip \u003chttps://pypi.org/project/torf/\u003e`__, but if you\ndecide to uninstall, you have to manually uninstall the dependencies.\n\n.. code:: sh\n\n    $ pip3 install torf-cli         # Installs system-wide (/usr/local/)\n    $ pip3 install --user torf-cli  # Installs in your home (~/.local/)\n\nThe `latest development version \u003chttps://github.com/rndusr/torf-cli\u003e`_ is\navailable on GitHub in the master branch.\n\n.. code:: sh\n\n    $ pip3 install [--user] git+https://github.com/rndusr/torf-cli.git\n\n\nContributing\n------------\n\nBug reports and feature requests are welcome in the `issue tracker\n\u003chttps://github.com/rndusr/torf-cli/issues\u003e`_.\n\n\nLicense\n-------\n\ntorf-cli is free software: you can redistribute it and/or modify it under the\nterms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the `GNU General Public License\n\u003chttps://www.gnu.org/licenses/gpl-3.0.txt\u003e`_ for more details.\n","funding_links":[],"categories":["Python","CLI Tools"],"sub_categories":["Upload Assistant"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frndusr%2Ftorf-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frndusr%2Ftorf-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frndusr%2Ftorf-cli/lists"}