How to convert .torrent file into magnet link?
13,670
Rather late, but as suggested in the comments, the following produces a magnet link, with no further fiddling necessary:
transmission-show -m yourfiles.torrent
This program is shipped as part of the transmission-cli
package on Debian derivatives, and part of the larger Transmission client.
Of course the .torrent
file must be created beforehand, but that can also be done with a Transmission command, and it doesn't require a tracker (anymore):
transmission-create yourfiles
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I'm interested of converting a .torrent binary file into a magnet file.
What are the possibilities to achieve that in Linux/Unix/OSX?
Sample format:
magnet:?xt=urn:btih:adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
-
chovy about 4 yearsis there a way to convert magent url to .torrent file?
-
aplaice about 4 yearsConverting a magnet link to a .torrent file would require internet access and would not be guaranteed to work. Converting a .torrent file into a magnet link is a many-to-one mapping (there are infinity many potential .torrent files that would map to the same magnet link — though fortunately "real-world" collisions are extremely rare), so the reverse operation would only work when you have access to somebody who has the original .torrent file (e.g. a torrent tracker or a "peer"). In any case, this should be a separate question.
-
Jo-Erlend Schinstad over 2 years@chovy: There is no way to convert a magnet url to a torrent file,because the magnet link is based on a hash of the torrent file.Since hashing is a one-way function, you cannot do it in reverse. This becomes obvious if you think about large files, like Linux CD images. If you could recreate the CD image from the md5sum, then the compression would be so enormous that you could store the entire WWW on a single harddisk.
-
aplaice over 2 years@Jo-Erlend Schinstad You're obviously correct that recovering the original file from a hash is impossible (without additional information). However, in practice, converting a magnet link into a torrent file is very much possible since the space of original files is finite and much of it is available online (on torrent trackers etc.). All torrent clients that process magnet links are in effect carrying out this conversion! CLI-wise, I've found this abandoned tool that carries out the conversion.