Support qbittorrent rpc client and manage server with async/await
Project description
✨ aioqb ✨
The asyncio Qbittorrent Client
The asyncio Qbittorrent Client
import asyncio
import aioqb
async def main():
client = aioqb.QbittorrentClient()
await client.torrents_add(torrents=[open("xxx.torrent", "rb")])
print(await client.transfer_info())
print(await client.torrents_info())
asyncio.run(main())
Auto ban thunder
"""
Copyright (c) 2008-2022 synodriver <synodriver@gmail.com>
"""
# Auto ban xunlei without qbee
import asyncio
from pprint import pprint
from aioqb import Client
block_list = ["xl", "xunlei"]
async def main():
async with Client() as client:
pprint(await client.auth_login())
while True:
d = await client.sync_maindata()
# pprint(d)
torrent_hashs = d['torrents'].keys()
rid = d['rid']
for t in torrent_hashs:
data = await client.sync_torrentPeers(hash=t, rid=0)
# filter(lambda x: for ip, peer in data["peers"].items() if , block_list)
for ip, peer in data["peers"].items():
# print(ip)
# pprint(v)
for b in block_list:
if b in peer['client'].lower():
await client.transfer_banPeers(ip)
print(f"ban peer {ip} {peer['client']}")
break
await asyncio.sleep(1)
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioqb-0.1.6.tar.gz
(17.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
aioqb-0.1.6-py3-none-any.whl
(15.3 kB
view details)
File details
Details for the file aioqb-0.1.6.tar.gz.
File metadata
- Download URL: aioqb-0.1.6.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ad940a1cc0082e7282008304d28b80acbb6102ce875c0b2e8b71b70a9e92fe
|
|
| MD5 |
34eb8a94cb1c22687ef55c15d25a400c
|
|
| BLAKE2b-256 |
dcd20e5a64ee728b8faa2dffa105b3672e2050fdaed628e49cd6583e6f3387fb
|
File details
Details for the file aioqb-0.1.6-py3-none-any.whl.
File metadata
- Download URL: aioqb-0.1.6-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d44ffd28670ef74636a34c47ea7114d3fa7fec09b469e20c45d221aafb1c5b
|
|
| MD5 |
a7534649c3f7b12e07a5d5713210d72d
|
|
| BLAKE2b-256 |
a9e354a28b5104746fe7bdeec559c1371439babd7eb82b26b2a735e9c5fde1f3
|