Metadata-Version: 2.4
Name: libtorrentx
Version: 0.0.8
Summary: libtorrent python api
Home-page: https://github.com/imneonizer/libtorrentx
Author: Nitin Rai
Author-email: mneonizer@gmail.com
License: MIT License
Platform: linux
Platform: unix
Requires-Python: >3.5.2
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: libtorrent>=2.0.7
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: platform
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

### LibtorrentX

A python wrapper for libtorrent, makes it easy to manage torrents. Built in support for state management and state recovery after restart.

- Easily pause and resume your torrent streams.
- Optimized settings for faster download speeds.

**Install via pip**

````sh
pip install libtorrentx
````

**Simple demo app**

````python
from libtorrentx import LibTorrentSession
import time

magnet = "magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF"
output_dir = "./downloads"
session = LibTorrentSession()
handle = session.add_torrent(magnet, output_dir)

while True:
    props = handle.props()

    if not props.ok:
        print("waiting for torrent to start...")
        time.sleep(1)
        continue

    print(props.string)

    if props.is_finished:
        break

    time.sleep(1)

````

or use CLI `python -m libtorrentx -m magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF`

**Output**

````sh
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 1.20 MB/s, 19%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 12.00 MB/s, 19%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 28.11 MB/s, 77%
Spider-Man.No.Way.Home.2022.1080p.BluRay.1600MB.DD5.1.x264-GalaxyRG[TGx], 29.00 MB/s, 100%
````

You can stop the execution and restart again, the download will resume from previous state.

**Install via Docker**

```sh
docker build . -t libtorrentx
```

````sh
docker run --rm -it -v $(pwd)/downloads:/app/downloads libtorrentx -m magnet:?xt=urn:btih:4C9B41D664D7B6B23F0BF39AE185858CBADDA3FF
````

