<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/dc/d2/0e5a64ee728b8faa2dffa105b3672e2050fdaed628e49cd6583e6f3387fb/aioqb-0.1.6.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.6",
"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": "a9e354a28b5104746fe7bdeec559c1371439babd7eb82b26b2a735e9c5fde1f3",
"md5": "a7534649c3f7b12e07a5d5713210d72d",
"sha256": "b9d44ffd28670ef74636a34c47ea7114d3fa7fec09b469e20c45d221aafb1c5b"
},
"downloads": -1,
"filename": "aioqb-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7534649c3f7b12e07a5d5713210d72d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 15308,
"upload_time": "2024-12-10T12:44:26",
"upload_time_iso_8601": "2024-12-10T12:44:26.431142Z",
"url": "https://files.pythonhosted.org/packages/a9/e3/54a28b5104746fe7bdeec559c1371439babd7eb82b26b2a735e9c5fde1f3/aioqb-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dcd20e5a64ee728b8faa2dffa105b3672e2050fdaed628e49cd6583e6f3387fb",
"md5": "34eb8a94cb1c22687ef55c15d25a400c",
"sha256": "a8ad940a1cc0082e7282008304d28b80acbb6102ce875c0b2e8b71b70a9e92fe"
},
"downloads": -1,
"filename": "aioqb-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "34eb8a94cb1c22687ef55c15d25a400c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 17653,
"upload_time": "2024-12-10T12:44:28",
"upload_time_iso_8601": "2024-12-10T12:44:28.558414Z",
"url": "https://files.pythonhosted.org/packages/dc/d2/0e5a64ee728b8faa2dffa105b3672e2050fdaed628e49cd6583e6f3387fb/aioqb-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 12:44:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "synodriver",
"github_project": "aioqbittorrent",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aioqb"
}