aioqb


Nameaioqb JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/synodriver/aioqbittorrent
SummarySupport qbittorrent rpc client and manage server with async/await
upload_time2024-09-30 13:39:01
maintainerv-vinson
docs_urlNone
authorsynodriver
requires_python>=3.6
licenseGPLv3
keywords asyncio qbittorrent
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center"><i>✨ aioqb ✨ </i></h1>

<h3 align="center">The asyncio  <a href="https://github.com/qbittorrent/qBittorrent">Qbittorrent Client</a> </h3>



[![pypi](https://img.shields.io/pypi/v/aioqb.svg)](https://pypi.org/project/aioqb/)
![python](https://img.shields.io/pypi/pyversions/aioqb)
![implementation](https://img.shields.io/pypi/implementation/aioqb)
![wheel](https://img.shields.io/pypi/wheel/aioqb)
![license](https://img.shields.io/github/license/synodriver/aioqbittorrent.svg)
![action](https://img.shields.io/github/workflow/status/synodriver/aioqbittorrent/build%20wheel)

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

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/synodriver/aioqbittorrent",
    "name": "aioqb",
    "maintainer": "v-vinson",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "asyncio, qbittorrent",
    "author": "synodriver",
    "author_email": "diguohuangjiajinweijun@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f4/c4/121e9ba743a35ccb20650d1f9dfa2959c463b92929577cebeeb83dcc5ea3/aioqb-0.1.5.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\"><i>\u2728 aioqb \u2728 </i></h1>\r\n\r\n<h3 align=\"center\">The asyncio  <a href=\"https://github.com/qbittorrent/qBittorrent\">Qbittorrent Client</a> </h3>\r\n\r\n\r\n\r\n[![pypi](https://img.shields.io/pypi/v/aioqb.svg)](https://pypi.org/project/aioqb/)\r\n![python](https://img.shields.io/pypi/pyversions/aioqb)\r\n![implementation](https://img.shields.io/pypi/implementation/aioqb)\r\n![wheel](https://img.shields.io/pypi/wheel/aioqb)\r\n![license](https://img.shields.io/github/license/synodriver/aioqbittorrent.svg)\r\n![action](https://img.shields.io/github/workflow/status/synodriver/aioqbittorrent/build%20wheel)\r\n\r\n# The asyncio Qbittorrent Client\r\n\r\n```python\r\nimport asyncio\r\nimport aioqb\r\n\r\n\r\nasync def main():\r\n    client = aioqb.QbittorrentClient()\r\n    await client.torrents_add(torrents=[open(\"xxx.torrent\", \"rb\")])\r\n    print(await client.transfer_info())\r\n    print(await client.torrents_info())\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n### Auto ban thunder\r\n\r\n```python\r\n\"\"\"\r\nCopyright (c) 2008-2022 synodriver <synodriver@gmail.com>\r\n\"\"\"\r\n# Auto ban xunlei without qbee\r\nimport asyncio\r\nfrom pprint import pprint\r\nfrom aioqb import Client\r\n\r\nblock_list = [\"xl\", \"xunlei\"]\r\n\r\n\r\nasync def main():\r\n    async with Client() as client:\r\n        pprint(await client.auth_login())\r\n        while True:\r\n            d = await client.sync_maindata()\r\n            # pprint(d)\r\n            torrent_hashs = d['torrents'].keys()\r\n            rid = d['rid']\r\n            for t in torrent_hashs:\r\n                data = await client.sync_torrentPeers(hash=t, rid=0)\r\n                # filter(lambda x: for ip, peer in data[\"peers\"].items() if , block_list)\r\n                for ip, peer in data[\"peers\"].items():\r\n                    # print(ip)\r\n                    # pprint(v)\r\n                    for b in block_list:\r\n                        if b in peer['client'].lower():\r\n                            await client.transfer_banPeers(ip)\r\n                            print(f\"ban peer {ip} {peer['client']}\")\r\n                            break\r\n            await asyncio.sleep(1)\r\n\r\n\r\nasyncio.run(main())\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Support qbittorrent rpc client and manage server with async/await",
    "version": "0.1.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/synodriver/aioqbittorrent/issues",
        "Homepage": "https://github.com/synodriver/aioqbittorrent"
    },
    "split_keywords": [
        "asyncio",
        " qbittorrent"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4d1a7fb4caf28589f157ce515657ad4bd7b3b3af0a20886107253fb18808950",
                "md5": "6e25b7545fc7a97025ff589704a7c323",
                "sha256": "47cf7b0c5b3a2d28b795c525295a100f72b2708bc7cb80925023c59a9c58c5a0"
            },
            "downloads": -1,
            "filename": "aioqb-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e25b7545fc7a97025ff589704a7c323",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15244,
            "upload_time": "2024-09-30T13:38:59",
            "upload_time_iso_8601": "2024-09-30T13:38:59.826049Z",
            "url": "https://files.pythonhosted.org/packages/d4/d1/a7fb4caf28589f157ce515657ad4bd7b3b3af0a20886107253fb18808950/aioqb-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4c4121e9ba743a35ccb20650d1f9dfa2959c463b92929577cebeeb83dcc5ea3",
                "md5": "cf52b48047257069f21ea2e97f39e221",
                "sha256": "68f29f5ce616c6ca66836405fbf5db4c1cba56d4ba579a09da4618fd69f9c0dc"
            },
            "downloads": -1,
            "filename": "aioqb-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "cf52b48047257069f21ea2e97f39e221",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 17516,
            "upload_time": "2024-09-30T13:39:01",
            "upload_time_iso_8601": "2024-09-30T13:39:01.440604Z",
            "url": "https://files.pythonhosted.org/packages/f4/c4/121e9ba743a35ccb20650d1f9dfa2959c463b92929577cebeeb83dcc5ea3/aioqb-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 13:39:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "synodriver",
    "github_project": "aioqbittorrent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "aioqb"
}
        
Elapsed time: 0.36564s