use v1 API for posting images instead of v2

Apparently even when using the v2 API, which returns image IDs before they're finished processing, you have to wait for them to finish before attaching them to a post, which defeats the purpose. Use v1 API to avoid this.
This commit is contained in:
Kay Faraday 2022-07-03 01:39:58 +00:00
parent 3ed03eaa83
commit 285610667b
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ class Pleroma:
data.add_field('description', description) data.add_field('description', description)
if focus is not None: if focus is not None:
data.add_field(','.join(map(str, focus))) data.add_field(','.join(map(str, focus)))
return await self.request('POST', '/api/v2/media', data=data) return await self.request('POST', '/api/v1/media', data=data)
async def reply(self, to_status, content, *, cw=None): async def reply(self, to_status, content, *, cw=None):
user_id = await self._get_logged_in_id() user_id = await self._get_logged_in_id()