https://github.com/synodriver/aioqbittorrent
Qbittorrent rpc with asyncio
https://github.com/synodriver/aioqbittorrent
asyncio qbittorrent qbittorrent-api
Last synced: about 1 year ago
JSON representation
Qbittorrent rpc with asyncio
- Host: GitHub
- URL: https://github.com/synodriver/aioqbittorrent
- Owner: synodriver
- Created: 2021-08-06T03:30:53.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-10T12:42:45.000Z (over 1 year ago)
- Last Synced: 2025-02-28T17:56:25.441Z (over 1 year ago)
- Topics: asyncio, qbittorrent, qbittorrent-api
- Language: Python
- Homepage:
- Size: 65.4 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
✨ aioqb ✨
The asyncio Qbittorrent Client
[](https://pypi.org/project/aioqb/)





# The asyncio Qbittorrent Client
```python
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
```python
"""
Copyright (c) 2008-2022 synodriver
"""
# 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())
```