The matrix media api used in matrix-nio v0.24 is deprecated.
smbl can't download media files on homeservers that implement matrix v1.11.
It is fixed in matrix-nio v0.25: https://github.com/matrix-nio/matrix-nio/pull/520
This PR will allow both matrix-nio ^0.24 and ^0.25.
code to reproduce the download error:
import nio
@bot.listener.on_custom_event(nio.RoomMessage)
async def on_message(room, event):
if not isinstance(event, (nio.RoomMessageAudio,
nio.RoomEncryptedAudio,
nio.RoomMessageVideo,
nio.RoomEncryptedVideo)):
return
response = await bot.async_client.download(mxc=event.url)
if isinstance(response, nio.responses.DownloadError):
print(response)
else:
print("You aren't running a recent matrix homeserver")
There are mentions of breaking changes in the matrix-nio changelog: https://github.com/matrix-nio/matrix-nio/blob/main/CHANGELOG.md