Turn a bittorrent magnet links into a .torrent file.
Project description
Magnet2Torrent
Pure python project to turn a magnet link into a .torrent file. The goal is to do it as fast as possible.
Getting Started
Installing
pip install magnet2torrent
Usage
Download an ubuntu iso torrent.
magnet2torrent fetch "magnet:?xt=urn:btih:e2467cbf021192c241367b892230dc1e05c0580e&dn=ubuntu-19.10-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce"
Run it as an HTTP server.
magnet2torrent serve
Use from python
import asyncio
from magnet2torrent import Magnet2Torrent, FailedToFetchException
async def fetch_that_torrent():
m2t = Magnet2Torrent("magnet:?xt=urn:btih:e2467cbf021192c241367b892230dc1e05c0580e&dn=ubuntu-19.10-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce")
try:
filename, torrent_data = await m2t.retrieve_torrent()
except FailedToFetchException:
print("Failed")
asyncio.run(fetch_that_torrent())
TODO
- DHT support
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
magnet2torrent-1.0.3.tar.gz
(9.7 kB
view hashes)
Built Distribution
Close
Hashes for magnet2torrent-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fce24682a75dfcdc7fe005a01981e89f585c820fc5f8aeff95fc99c62c69822 |
|
MD5 | 2482579c9b0b304bd473fd1ab14663a8 |
|
BLAKE2b-256 | 111ba6b09447e10f4e16af81d3a4cfed2e02e67fc4b35ed74aef1b94ebb5c38f |