Giter VIP home page Giter VIP logo

torrentp's Introduction

TorrentP

Wrapped python library for downloading from torrent

Torrentp

Download from torrent with .torrent file or magnet link. With just 3 lines of python code.

PyPI version Supported Python versions Downloads

Installation

$ pip install torrentp

Also can be found on pypi

How can I use it?

  • Install the package by pip package manager.
  • After installing, you can use it and call the library.
  • You have to pass magnet link or torrent file, and a path for saving the file. use . (dot) for saving in current directory.

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()

How can I use a custom port?

torrent_file = TorrentDownloader("magnet/torrent.file", '.', port=0000)

How can I limit the upload or download speed?

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)

Using Command Line Interface (CLI)

Download with a magnet link:

$ torrentp --link 'magnet:...'

or download with .torrent file:

$ torrentp --link 'test.torrent'

You can also use --help parameter to display all the parameters that you can use

args 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 '.'

To do list

  • Limit upload and download speed
  • User can change the port
  • CLI
  • Pause / Resume / Stop

Star History

Star History Chart

Issues

Feel free to submit issues and enhancement requests or contact me via vida.page/nima.

Contributing

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.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Update the Version inside init.py
  4. Commit changes to your own branch
  5. Push your work back up to your fork
  6. Submit a Pull request so that we can review your changes

torrentp's People

Contributors

abieru avatar erdincsk avatar itsamirhn avatar iw4p avatar nimdinu avatar ufoptg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

torrentp's Issues

I cannot download using the magnet link

Whenever I try to download using the magnet link the interpreter shows this error
: Enable tracemalloc to get the object allocation traceback

Please help me here!!!!!!!!!!!!!
Screenshot 2024-03-13 014729

Pip dependency resolution

When downloading the package using pip install torrentp the terminal spits out this:
image
None of the fixes work and it seems that i need to install libtorrent before this

Progress tracking

Hi, I am writing simple Flask torrent server and I would like to get progress of downloading torrent via API request. how can I reference torrent info of torrent that started download.

Requirement file

It will be help full if you gave a requirement file to this repo.

libtorrent module not found

I am receiving this module not found error

Traceback (most recent call last):
  File "f:/CS/Alpha Tauri/OX-base/torrent+download.py", line 3, in <module>
    from torrentp import TorrentDownloader
  File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\torrentp\__init__.py", line 6, in <module>
    from .torrent_downloader import TorrentDownloader
  File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\torrentp\torrent_downloader.py", line 4, in <module>
    import libtorrent as lt
ImportError: DLL load failed while importing libtorrent: The specified module could not be found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.