$ pip install torrentp
Also can be found on pypi
Download with magnet link:
import asyncio
from torrentp import TorrentDownloader
torrent_file = TorrentDownloader("magnet:...", '.')
# Start the download process
asyncio.run(torrent_file.start_download()) # start_download() is a asynchronous method
# Pausing the download
torrent_file.pause_download()
# Resuming the download
torrent_file.resume_download()
# Stopping the download
torrent_file.stop_download()
Or download with .torrent file:
import asyncio
from torrentp import TorrentDownloader
torrent_file = TorrentDownloader("test.torrent", '.')
# Start the download process
asyncio.run(torrent_file.start_download()) # start_download() is a asynchronous method
# Pausing the download
torrent_file.pause_download()
# Resuming the download
torrent_file.resume_download()
# Stopping the download
torrent_file.stop_download()
torrent_file = TorrentDownloader("magnet/torrent.file", '.', port=0000)
Download Using 0 (default number) means unlimited speed:
await torrent_file.start_download(download_speed=0, upload_speed=0)
Or download with specifc number (kB/s):
await torrent_file.start_download(download_speed=2, upload_speed=1)
Download with a magnet link:
$ torrentp --link 'magnet:...'
or download with .torrent file:
$ torrentp --link 'test.torrent'
--help
parameter to display all the parameters that you can useargs | help | type |
---|---|---|
--link | Torrent link. Example: [--link 'file.torrent'] or [--link 'magnet:...'] [required] | str |
--download_speed | Download speed with a specific number (kB/s). Default: 0, means unlimited speed | int |
--upload_speed | Upload speed with a specific number (kB/s). Default: 0, means unlimited speed | int |
--save_path | Path to save the file, default: '.' | str |
--help | Show this message and exit |
Example with all commands:
$ torrentp --link 'magnet:...' --download_speed 100 --upload_speed 50 --save_path '.'
Feel free to submit issues and enhancement requests or contact me via vida.page/nima.
Please refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.