tsangwpx / aioqbt Goto Github PK
View Code? Open in Web Editor NEWqBittorrent WebAPI with asyncio
License: MIT License
qBittorrent WebAPI with asyncio
License: MIT License
Using the example from the readme, I get an ForbiddenError when connecting to an qBittorrent instance which requires a password, but works fine when Authentication is disabled
Request 1/3: GET 'http://192.168.1.74:8080/api/v2/app/version'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/app/version')
Request 1/3: GET 'http://192.168.1.74:8080/api/v2/app/webapiVersion'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/app/webapiVersion')
Request 1/3: GET 'http://192.168.1.74:8080/api/v2/app/version'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/app/version')
Request 1/1: POST 'http://192.168.1.74:8080/api/v2/auth/logout'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/app/version')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/workspaces/qbit/test2.py", line 16, in main
print(await client.app.version()) # v4.6.1
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/api/app.py", line 18, in version
return await self._request_text(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 518, in _request_text
return await self._client().request_text(method, endpoint, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 363, in request_text
resp = await self.request(method, endpoint, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 284, in request
self._handle_error(last_exc, resp, resp_body)
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 351, in _handle_error
raise exc_class.from_response(resp, message) from error
aioqbt.exc.ForbiddenError: ForbiddenError(status=403, message='Forbidden')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/auth/logout')
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 255, in request
raise aiohttp.ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://192.168.1.74:8080/api/v2/app/version')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/runpy.py", line 88, in _run_code
exec(code, run_globals)
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/root/.vscode-server-insiders/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/workspaces/qbit/test2.py", line 26, in <module>
asyncio.run(main())
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/workspaces/qbit/test2.py", line 16, in main
print(await client.app.version()) # v4.6.1
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/api/app.py", line 18, in version
return await self._request_text(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 518, in _request_text
return await self._client().request_text(method, endpoint, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 363, in request_text
resp = await self.request(method, endpoint, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 284, in request
self._handle_error(last_exc, resp, resp_body)
File "/usr/local/lib/python3.11/site-packages/aioqbt/client.py", line 351, in _handle_error
raise exc_class.from_response(resp, message) from error
aioqbt.exc.ForbiddenError: ForbiddenError(status=403, message='Forbidden')
Require aiohttp 3.9 which is currently in prerelease stage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.