#πŸ”’ i am using a package called sharkiq and i am getting a error

32 messages Β· Page 1 of 1 (latest)

winged adder
#
Traceback (most recent call last):
  File "c:\Users\mayha\Desktop\Chrismas Thing\main.py", line 7, in <module>
    ayla_api.sign_in()
  File "C:\Users\mayha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sharkiq\ayla_api.py", line 93, in sign_in
    self._set_credentials(resp.status_code, resp.json())
  File "C:\Users\mayha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sharkiq\ayla_api.py", line 82, in _set_credentials
    raise SharkIqAuthError(login_result["error"]["message"])
                           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'```
tall lakeBOT
#

@winged adder

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

winged adder
#

i don't know if this helps but python version Python 3.11.9

steel star
#

is says in you dict map of keys.. login_result .. one of your keys is a actually a string and your referencing it as a key

#

or perhaps the info your sending in is not formatted correctly

frail scaffold
#

You could try simply opening the actual library file in your editor and edit that line to be raise SharkIqAuthError(str(login_result))

#

i.e. literally open the file C:\Users\mayha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sharkiq\ayla_api.py in a text editor and update line number 82

#

that won't resolve your authorization error, but you'll at least be able to see the true error message

#

alternatively you can run your code in debug mode, and inspect the login_result variable in your IDE

#

in summary

  • Your API request is failing for some reason
  • You can't see the reason because the python library is out of date
  • you can try to figure out the reason your API request is failing by inspecting the login_result variable that's in site-packages\sharkiq\ayla_api.py either by editing that file or using a debugger
winged adder
#

after changing the line i get the error sharkiq.exc.SharkIqAuthError: {'error': 'Your have exceeded your maximum login attempts.\nYour account is locked. Please try again after 30 minutes.'}

#

so thats not going to give me the error i am looking for until my account become unlocked i think

frail scaffold
winged adder
#

ok gonna retry at 11:30

#
    ayla_api.sign_in()
  File "C:\Users\mayha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sharkiq\ayla_api.py", line 93, in sign_in      
    self._set_credentials(resp.status_code, resp.json())
  File "C:\Users\mayha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\sharkiq\ayla_api.py", line 82, in _set_credentials
    raise SharkIqAuthError(str(login_result))
sharkiq.exc.SharkIqAuthError: {'error': 'Invalid email or password.'}
PS C:\Users\mayha\Desktop\Chrismas Thing> ``` but its valid?
frail scaffold
#

how are you supplying the email and password?

#

have you verified them manually?

winged adder
#

yeah

#

i’m using the code example on github

#

i submitted a issue report on it

frail scaffold
#

If you're using this package, it's very likely just that it's out of date

#

it was out of date for the error handling

#

so why assume that it's up-to-date for other things

#

the package hasn't been touched in 4 years and has 33 stars

#

you might have to update the package yourself or use a different one

#

it might not work exactly how you want, but it might be a good starting point

#

(idk exactly what you're trying to do)

tall lakeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.