aioqb


Nameaioqb JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/synodriver/aioqbittorrent
SummarySupport qbittorrent rpc client and manage server with async/await
upload_time2024-03-16 08:16:47
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": "",
    "keywords": "asyncio,qbittorrent",
    "author": "synodriver",
    "author_email": "diguohuangjiajinweijun@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f7/ab/e30f241228f6077fed9677487b368988e47b8944b4204e52981a0ad2bbce/aioqb-0.1.3.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.3",
    "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": "b5ae9b917db5427f9dc4252d793cb97e0750690dab9c34ab7e6d14b3afa94726",
                "md5": "21814d4716293aaca0e90961b061dd82",
                "sha256": "b959c80456578ce0c530f2d340dcfafe7051e0e1dc6377ff3013afe97491615f"
            },
            "downloads": -1,
            "filename": "aioqb-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "21814d4716293aaca0e90961b061dd82",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15227,
            "upload_time": "2024-03-16T08:16:45",
            "upload_time_iso_8601": "2024-03-16T08:16:45.921783Z",
            "url": "https://files.pythonhosted.org/packages/b5/ae/9b917db5427f9dc4252d793cb97e0750690dab9c34ab7e6d14b3afa94726/aioqb-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7abe30f241228f6077fed9677487b368988e47b8944b4204e52981a0ad2bbce",
                "md5": "f967b38a76ea977d8e197553606feb04",
                "sha256": "72d7a9403f52d0faf201112e74d572de65574136a28aea09c9c08a41a1d45479"
            },
            "downloads": -1,
            "filename": "aioqb-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f967b38a76ea977d8e197553606feb04",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 17478,
            "upload_time": "2024-03-16T08:16:47",
            "upload_time_iso_8601": "2024-03-16T08:16:47.767764Z",
            "url": "https://files.pythonhosted.org/packages/f7/ab/e30f241228f6077fed9677487b368988e47b8944b4204e52981a0ad2bbce/aioqb-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-16 08:16:47",
    "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.20759s