diff options
author | James Moore <[email protected]> | 2017-11-09 11:55:13 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-09 11:55:13 -0800 |
commit | 23d57587e4c95f6a944ae9531d716d39b1d0206a (patch) | |
tree | 91f0319511bcd477d74e2ab640443b95f04d6af1 | |
parent | 61552f9f84c736d447e0fccd54040d3b956a83e9 (diff) | |
download | mastodon.py-23d57587e4c95f6a944ae9531d716d39b1d0206a.tar.gz |
Added optional media description
This works with the new alt text support in mastodon 2.0.
-rw-r--r-- | mastodon/Mastodon.py | 5 |
1 files 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: | |||
776 | ### | 776 | ### |
777 | # Writing data: Media | 777 | # Writing data: Media |
778 | ### | 778 | ### |
779 | def media_post(self, media_file, mime_type=None): | 779 | def media_post(self, media_file, mime_type=None, description=None): |
780 | """ | 780 | """ |
781 | Post an image. media_file can either be image data or | 781 | Post an image. media_file can either be image data or |
782 | a file name. If image data is passed directly, the mime | 782 | a file name. If image data is passed directly, the mime |
@@ -804,7 +804,8 @@ class Mastodon: | |||
804 | 804 | ||
805 | media_file_description = (file_name, media_file, mime_type) | 805 | media_file_description = (file_name, media_file, mime_type) |
806 | return self.__api_request('POST', '/api/v1/media', | 806 | return self.__api_request('POST', '/api/v1/media', |
807 | files={'file': media_file_description}) | 807 | files={'file': media_file_description}, |
808 | params={'description': description}) | ||
808 | 809 | ||
809 | ### | 810 | ### |
810 | # Writing data: Domain blocks | 811 | # Writing data: Domain blocks |