{"id":18085057,"url":"https://github.com/jwodder/demagnetize-rs","last_synced_at":"2025-04-12T20:11:28.873Z","repository":{"id":176157581,"uuid":"655077696","full_name":"jwodder/demagnetize-rs","owner":"jwodder","description":"Convert magnet links to .torrent files","archived":false,"fork":false,"pushed_at":"2024-04-08T12:31:51.000Z","size":332,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-08T13:41:40.780Z","etag":null,"topics":["available-on-crates-io","bittorent","magnet-link","rust","torrent"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwodder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-06-17T20:17:09.000Z","updated_at":"2024-04-15T13:57:17.435Z","dependencies_parsed_at":null,"dependency_job_id":"f7a6d2f0-f3b2-4303-9fee-1ba5fe1935ec","html_url":"https://github.com/jwodder/demagnetize-rs","commit_stats":null,"previous_names":["jwodder/demagnetize-rs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fdemagnetize-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fdemagnetize-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fdemagnetize-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fdemagnetize-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwodder","download_url":"https://codeload.github.com/jwodder/demagnetize-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":["available-on-crates-io","bittorent","magnet-link","rust","torrent"],"created_at":"2024-10-31T15:09:14.225Z","updated_at":"2025-04-12T20:11:28.845Z","avatar_url":"https://github.com/jwodder.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CI Status](https://github.com/jwodder/demagnetize-rs/actions/workflows/test.yml/badge.svg)](https://github.com/jwodder/demagnetize-rs/actions/workflows/test.yml)\n[![codecov.io](https://codecov.io/gh/jwodder/demagnetize-rs/branch/master/graph/badge.svg)](https://codecov.io/gh/jwodder/demagnetize-rs)\n[![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.81-orange)](https://www.rust-lang.org)\n[![MIT License](https://img.shields.io/github/license/jwodder/demagnetize-rs.svg)](https://opensource.org/licenses/MIT)\n\n[GitHub](https://github.com/jwodder/demagnetize-rs) | [crates.io](https://crates.io/crates/demagnetize) | [Issues](https://github.com/jwodder/demagnetize-rs/issues) | [Changelog](https://github.com/jwodder/demagnetize-rs/blob/master/CHANGELOG.md)\n\n`demagnetize` is a Rust program for converting one or more BitTorrent [magnet\nlinks](https://en.wikipedia.org/wiki/Magnet_URI_scheme) into `.torrent` files\nby downloading the torrent info from active peers.\n\nAt the moment, `demagnetize` only supports basic features of the BitTorrent\nprotocol.  The following notable features are supported:\n\n- BitTorrent protocol v1\n- HTTP (including compact and IPv6 extensions) and UDP trackers\n- magnet URIs with info hashes encoded in either hexadecimal or base32\n- Fast extension ([BEP 6](https://www.bittorrent.org/beps/bep_0006.html))\n- UDP tracker protocol extensions ([BEP\n  41](https://www.bittorrent.org/beps/bep_0041.html))\n\nThe following features are not currently supported but are planned, in no\nparticular order:\n\n- Encryption\n- Distributed hash tables\n- BitTorrent protocol v2\n- `x.pe` parameters in magnet links\n- uTP\n\n`demagnetize` is a translation of a Python program by the same author; you can\nfind the Python version at \u003chttps://github.com/jwodder/demagnetize\u003e.\n\n\nInstallation\n============\n\nRelease Assets\n--------------\n\nPrebuilt binaries for the most common platforms are available as GitHub release\nassets.  [The page for the latest\nrelease](https://github.com/jwodder/demagnetize-rs/releases/latest) lists these\nunder \"Assets\", along with installer scripts for both Unix-like systems and\nWindows.\n\nAs an alternative to the installer scripts, if you have\n[`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) on your\nsystem, you can use it to download \u0026 install the appropriate release asset for\nyour system for the latest version of `demagnetize` by running `cargo binstall\ndemagnetize`.\n\nInstalling from Source\n----------------------\n\nIf you have [Rust and Cargo\ninstalled](https://www.rust-lang.org/tools/install), you can build the latest\nrelease of `demagnetize` from source and install it in `~/.cargo/bin` by\nrunning:\n\n    cargo install demagnetize\n\n`demagnetize` has the following Cargo features, selectable via the `--features\n\u003cLIST\u003e` option to `cargo install`:\n\n- `native-tls` — Use [`native-tls`](https://github.com/sfackler/rust-native-tls)\n  for TLS support.  This feature is enabled by default.\n\n- `native-tls-vendored` — Like `native-tls`, but compile a vendored copy of\n  OpenSSL into `demagnetize` instead of using the platform's copy at runtime.\n  This makes it possible to build `demagnetize` on one system and run it on\n  another system that has a different version of OpenSSL.\n\n  This feature has no effect on Windows and macOS, where OpenSSL is not used.\n\n- `rustls` — Use [`rustls`](https://github.com/rustls/rustls) for TLS support.\n  When selecting this feature, be sure to also supply the\n  `--no-default-features` option in order to disable `native-tls`.\n\n    - The release assets are built using this feature.\n\n\nUsage\n=====\n\n    demagnetize [\u003cglobal options\u003e] \u003csubcommand\u003e ...\n\nThe `demagnetize` command has two main general-purpose subcommands, `get` (for\nconverting a single magnet link) and `batch` (for converting a file of magnet\nlinks).  There are also two low-level commands, `query-tracker` (for getting a\nlist of peers from a single tracker) and `query-peer` (for getting torrent\nmetadata from a single peer).\n\nGlobal Options\n--------------\n\n- `-l \u003clevel\u003e`, `--log-level \u003clevel\u003e` — Set the log level to the given value.\n  Possible values are \"`OFF`\", \"`ERROR`\", \"`WARN`\", \"`INFO`\", \"`DEBUG`\", and\n  \"`TRACE`\" (all case-insensitive).  [default value: `INFO`]\n\n\n`demagnetize get`\n-----------------\n\n    demagnetize [\u003cglobal options\u003e] get [\u003coptions\u003e] \u003cmagnet-link\u003e\n\nConvert a single magnet link specified on the command line to a `.torrent`\nfile.  (Note that you will likely have to quote the link in order to prevent it\nfrom being interpreted by the shell.)  By default, the file is saved at\n`{name}.torrent`, where `{name}` is replaced by the value of the `name` field\nfrom the torrent info, but a different path can be set via the `--outfile`\noption.\n\n### Options\n\n- `-o PATH`, `--outfile PATH` — Save the `.torrent` file to the given path.\n  The path may contain a `{name}` placeholder, which will be replaced by the\n  (sanitized) name of the torrent, and/or a `{hash}` placeholder, which will be\n  replaced by the torrent's info hash in hexadecimal.  Specifying `-` will\n  cause the torrent to be written to standard output.  [default:\n  `{name}.torrent`]\n\n\n`demagnetize batch`\n-------------------\n\n    demagnetize [\u003cglobal options\u003e] batch [\u003coptions\u003e] \u003cfile\u003e\n\nRead magnet links from `\u003cfile\u003e`, one per line (ignoring empty lines and lines\nthat start with `#`), and convert each one to a `.torrent` file.  By default,\neach file is saved at `{name}.torrent`, where `{name}` is replaced by the value\nof the `name` field from the torrent info, but a different path can be set via\nthe `--outfile` option.\n\n### Options\n\n- `-o PATH`, `--outfile PATH` — Save the `.torrent` files to the given path.\n  The path may contain a `{name}` placeholder, which will be replaced by the\n  (sanitized) name of each torrent, and/or a `{hash}` placeholder, which will\n  be replaced by each torrent's info hash in hexadecimal.  [default:\n  `{name}.torrent`]\n\n\n`demagnetize query-tracker`\n---------------------------\n\n    demagnetize [\u003cglobal options\u003e] query-tracker \u003ctracker\u003e \u003cinfo-hash\u003e\n\nQuery the given tracker (specified as an HTTP or UDP URL) for peers serving the\ntorrent with the given info hash (specified as a 40-character hex string or\n32-character base32 string), and print out the the retrieved peers' addresses\nin the form \"IP:PORT\".\n\n\n`demagnetize query-peer`\n------------------------\n\n    demagnetize [\u003cglobal options\u003e] query-peer [\u003coptions\u003e] \u003cpeer\u003e \u003cinfo-hash\u003e\n\nQuery the given peer (specified as an address in \"IPv4:PORT\" or \"[IPv6]:PORT\"\nformat) for the metadata of the torrent with the given info hash (specified as\na 40-character hex string or 32-character base32 string), and save the metadata\nto a file.  By default, the file is saved at `{name}.torrent`, where `{name}`\nis replaced by the value of the `name` field from the torrent info, but a\ndifferent path can be set via the `--outfile` option.\n\nNote that, unlike the `.torrent` files produced by the `get` and `batch`\ncommands, the files produced by this command will not contain tracker\ninformation.\n\n### Options\n\n- `-o PATH`, `--outfile PATH` — Save the `.torrent` file to the given path.\n  The path may contain a `{name}` placeholder, which will be replaced by the\n  (sanitized) name of the torrent, and/or a `{hash}` placeholder, which will be\n  replaced by the torrent's info hash in hexadecimal.  Specifying `-` will\n  cause the torrent to be written to standard output.  [default:\n  `{name}.torrent`]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fdemagnetize-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwodder%2Fdemagnetize-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fdemagnetize-rs/lists"}