Fedihosting-Foundation / plemmy

A Python package for accessing the LemmyHttp API
Apache License 2.0
45 stars 15 forks source link

Trouble submitting posts since lemmy 0.19 #29

Closed harrr1 closed 7 months ago

harrr1 commented 7 months ago
  File "/path/to/virtualenv/lib/python3.11/site-packages/plemmy/responses.py", line 447, in __init__
    self.post_view = PostView(response.get("post_view"))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/virtualenv/lib/python3.11/site-packages/plemmy/views.py", line 18, in __init__
    self.parse()
  File "/path/to/virtualenv/lib/python3.11/site-packages/plemmy/views.py", line 419, in parse
    self.community = Community(**self._view["community"])
                                 ~~~~~~~~~~^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

If you have any idea but no time to look into it let me know, I can code some Python.

harrr1 commented 7 months ago

Ah, I just see I get a 401 response code from the API. Maybe my auth is broken or the auth mechanism changed.

harrr1 commented 7 months ago

So I get an API token when the code logs in, but the API token is rejected when submitting a post. I tried setting my account to a bot account, that didn't work either. Not sure if the API changed, or if my instance changed its settings.

ihyoudou commented 7 months ago

Hey - what version of lemmy is running on your instance? I think in 0.19 something has changed in authentication API

harrr1 commented 7 months ago

@ihyoudou Yes, it's 0.19.

harrr1 commented 7 months ago

https://github.com/Xyphyn/photon/discussions/152 seems related. Let me see if that helps.

tjkessler commented 7 months ago

@harrr1,

The v19-updates branch has my WIP fix for the authentication issues; it still needs testing, I'm hoping to resolve soon!

Travis

tjkessler commented 7 months ago

@harrr1,

Let me know if the 0.4.0 update fixes things!

harrr1 commented 7 months ago

@tjkessler Everything works, thanks so much!