From 23d57587e4c95f6a944ae9531d716d39b1d0206a Mon Sep 17 00:00:00 2001 From: James Moore Date: Thu, 9 Nov 2017 11:55:13 -0800 Subject: [PATCH] Added optional media description This works with the new alt text support in mastodon 2.0. --- mastodon/Mastodon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index b118421..8c2bf8c 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -776,7 +776,7 @@ class Mastodon: ### # Writing data: Media ### - def media_post(self, media_file, mime_type=None): + def media_post(self, media_file, mime_type=None, description=None): """ Post an image. media_file can either be image data or a file name. If image data is passed directly, the mime @@ -804,7 +804,8 @@ class Mastodon: media_file_description = (file_name, media_file, mime_type) return self.__api_request('POST', '/api/v1/media', - files={'file': media_file_description}) + files={'file': media_file_description}, + params={'description': description}) ### # Writing data: Domain blocks