Skip to content

Instantly share code, notes, and snippets.

@spinza
Created October 3, 2018 20:06
Show Gist options
  • Save spinza/bf2018a35b66b46f4ab6875fee44d32f to your computer and use it in GitHub Desktop.
Save spinza/bf2018a35b66b46f4ab6875fee44d32f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import libtorrent
import sys
info = libtorrent.torrent_info(sys.argv[1])
print "magnet:?xt=urn:btih:%s&dn=%s" % (info.info_hash(), info.name())
@spinza
Copy link
Author

spinza commented Oct 3, 2018

For example

./make_magnet bitcoin-0.17.0.torrent 

Gives

magnet:?xt=urn:btih:1c72f17bc1667a2ce81860b75135e491f6637d05&dn=bitcoin-core-0.17.0

You probably just need to add tracker, though DHT should find it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment