Skip to content
This will convert a magnet link into a .torrent file
Branch: master
Clone or download
Pull request Compare This branch is 31 commits ahead, 4 commits behind danfolkes:master.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Adding in a git ignore Aug 29, 2012 Create Dec 17, 2013 chg: dev: log when index error. Jun 10, 2017 Merge branch 'master' into master Jun 12, 2017


A command line tool that converts magnet links into .torrent files.


  • python2.7/3.5
  • python-libtorrent (libtorrent-rasterbar version 0.16 or later) for python 2.7 or python3-libtorrent for python 3.5

Install libtorrent-python on Mac

brew install libtorrent-rasterbar --with-python

Install python-libtorrent on Ubuntu

sudo apt-get install python-libtorrent -y


usage: [-h] -m MAGNET [-o OUTPUT] [--rewrite-file]
                         [--no-rewrite-file] [--skip-file] [--open-file]

A command line tool that converts magnet links into .torrent files

Optional arguments:

-h, --help            Show this help message and exit.
-m MAGNET, --magnet MAGNET
                        The magnet url.
-o OUTPUT, --output OUTPUT
                        The output torrent file name.
--rewrite-file        Rewrite torrent file if it already exists (default).
--no-rewrite-file     Create a new filename if torrent exists.
--skip-file           Skip file if it already exists.
--open-file           Open file after converting.

Example usage

python -m <magnet link> [torrent file]

python -m "magnet:?xt=urn:btih:49fbd26322960d982da855c54e36df19ad3113b8&dn=ubuntu-12.04-desktop-i386.iso&" -o ubunut12-04.iso


All code is licensed under the GPL version 3

You can’t perform that action at this time.