Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Não é possível acessar os dados da Nuconta (Extrato, saldo, etc) #419

@eduardojunio

Description

@eduardojunio

Clonei o repo do zero e gerei o certificado rodando o comando pynubank no terminal.

Escrevi esse arquivo:

from pynubank import Nubank

nu = Nubank()

nu.authenticate_with_cert('[FILTERED]', '[FILTERED]', 'cert.p12')

print(nu.get_account_balance())

E estou recebendo esse erro:

Traceback (most recent call last):
  File "[FILTERED]/pynubank-test/test.py", line 7, in <module>
    print(nu.get_account_balance())
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynubank/auth_mode.py", line 23, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynubank/nubank.py", line 235, in get_account_balance
    data = self._make_graphql_request('account_balance')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynubank/nubank.py", line 52, in _make_graphql_request
    return self._client.post(self._query_url,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynubank/utils/http.py", line 49, in post
    return self._handle_response(post(url, json=json, headers=self._headers, **self._cert_args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynubank/utils/http.py", line 35, in _handle_response
    raise NuRequestException(response)
pynubank.exception.NuRequestException: The request made failed with HTTP status code 401

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions