Simple library for communicating with rTorrent via ruTorrent's httprpc plugin
Project description
esutils
This was used for personal use, consider it experimental and use at own risk.
Install
pip install pyruTorrent
Usage
Incomplete docs
Create Instance
rt = rTorrent(
host='xxxxxxxxxx',
port=123456,
username='xxxxxxxxxx',
password='xxxxxxxxxx',
rpc_path='/rutorrent/plugins/httprpc/action.php'
)
# or
rt = rTorrent(
uri='https://<username>:<password>@<host>:<port>/rutorrent/plugins/httprpc/action.php',
)
Add Torrent
# :torrent_item: accepts multiple formats
# Ex: <bytes> | [<bytes>] | [<bytes>, <bytes>, <bytes>...]
# Ex: <magnet> | [<magnet>] | [<magnet>, <magnet>, <magnet>...]
# Ex: <path> | [<path>] | [<path>, <path>, <path>]
# Ex: [<magnet>, [<path>], [<bytes>], <magnet>]
# <magnet> the magnet url
# <path> local filepath to .torrent file
# <bytes> byte contents of a .torrent file
# Not recommended to send more than 80 torrents at a time.
# Failiure happens when sending around 100 torrents at once.
#
# :kwargs: Client defaults used if not set
rt.add_torrent(
torrent_item,
download_path=None,
label=None,
ratio_group=None,
add_stopped=False,
add_name_to_path=True,
save_uploaded_torrent=False
)
Get Torrent
# Returns single torrent
rt.get_torrent(
'<torrent-hash>',
include_trackers=False,
include_files=False,
include_peers=False
)
Get Torrents
# Note:
# With include_trackers, include_files & include_peers enabled,
# response sent from RPC will be double or more in size, depending on
# number of files, peers and trackers.
# Test:
# Test with 1,125 torrents, 1-3 trackers & 0-4 peers per torrent:
# - 1.48MB w/ include_trackers, include_files & include_peers disabled
# - 3.25MB w/ include_trackers, include_files & include_peers enabled
# Returns all torrents if no hashes or ratio_group specified
rt.get_torrents(
hashes=None,
ratio_group=None,
include_trackers=False,
include_files=False,
include_peers=False
)
# Returns torrents matching hashes
rt.get_torrents(['<torrent-hash>', '<torrent-hash>', '<torrent-hash>'])
Start
rt.start('<torrent-hash>')
Stop
rt.stop('<torrent-hash>')
Pause
rt.pause('<torrent-hash>')
Start All
rt.start_all(view='default', ratio_group=None)
Stop All
rt.stop_all(view='default', ratio_group=None)
Pause All
rt.pause_all(view='default', ratio_group=None)
Remove
rt.remove('<torrent-hash>')
Remove and Delete Files
rt.remove_and_delete('<torrent-hash>')
Remove All
rt.remove_all(view='default', ratio_group=None)
Remove All and Delete Files
rt.remove_and_delete_all(view='default', ratio_group=None)
Check Hash
rt.check_hash('<torrent-hash>')
Check Hash All
rt.check_hash_all(view='default', ratio_group=None)
Remote Ratio Group
rt.remove_ratio_group(['<torrent-hash>', '<torrent-hash>', '<torrent-hash>'])
Set Ratio Group
rt.set_ratio_group(['<torrent-hash>', '<torrent-hash>', '<torrent-hash>'], 2)
Get Settings
rt.get_settings()
Set Settings
rt.set_settings({'min_peers': 1, 'max_peers': 200})
Get Download Directory
# Returns default download directory
rt.get_download_directory()
Get Torrent Views
# Returns default download directory
rt.get_views()
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file pyrutorrent-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pyrutorrent-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0d1f557361f1c043aa297b3d9df071b9c0ce4ec4ee5523634e690ad3ffe271 |
|
MD5 | f6409b6af6f34965e7adc81851dff76f |
|
BLAKE2b-256 | 4b6725af97f0791eadff8e2fc7d269cb08142dfbae69caead51847fdfb83c1bd |