Code Monkey home page Code Monkey logo

aioqbt's People

Contributors

tsangwpx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mhdzumair

aioqbt's Issues

Login not working

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

Python 3.12

Require aiohttp 3.9 which is currently in prerelease stage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.