Skip to main content

✨ aioqb ✨

The asyncio Qbittorrent Client

pypi python implementation wheel license action

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

Metadata

Release files for aioqb 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioqb 0.1.6
File Size Uploaded
aioqb-0.1.6.tar.gz 17.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioqb 0.1.6
File Interpreter ABI Platform
aioqb-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 33.0 kB

Release files / aioqb-0.1.6.tar.gz

Download URL aioqb-0.1.6.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a8ad940a1cc0082e7282008304d28b80acbb6102ce875c0b2e8b71b70a9e92fe
BLAKE2b-256 checksum
How to use checksums
dcd20e5a64ee728b8faa2dffa105b3672e2050fdaed628e49cd6583e6f3387fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / aioqb-0.1.6-py3-none-any.whl

Download URL aioqb-0.1.6-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9d44ffd28670ef74636a34c47ea7114d3fa7fec09b469e20c45d221aafb1c5b
BLAKE2b-256 checksum
How to use checksums
a9e354a28b5104746fe7bdeec559c1371439babd7eb82b26b2a735e9c5fde1f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page