diff options
-rw-r--r-- | mastodon/Mastodon.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index eeb0b48..874d925 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -893,9 +893,12 @@ class Mastodon: | |||
893 | sensitive=False, visibility='', spoiler_text=None): | 893 | sensitive=False, visibility='', spoiler_text=None): |
894 | """ | 894 | """ |
895 | Post a status. Can optionally be in reply to another status and contain | 895 | Post a status. Can optionally be in reply to another status and contain |
896 | up to four pieces of media (Uploaded via `media_post()`_). media_ids can | 896 | media. |
897 | also be the `media dicts`_ returned by `media_post()`_ - they are unpacked | 897 | |
898 | automatically. | 898 | `media_ids` should be a list. (If it's not, the function will turn it |
899 | into one.) It can contain up to four pieces of media (uploaded via | ||
900 | `media_post()`_). `media_ids` can also be the `media dicts`_ returned | ||
901 | by `media_post()`_ - they are unpacked automatically. | ||
899 | 902 | ||
900 | The `sensitive` boolean decides whether or not media attached to the post | 903 | The `sensitive` boolean decides whether or not media attached to the post |
901 | should be marked as sensitive, which hides it by default on the Mastodon | 904 | should be marked as sensitive, which hides it by default on the Mastodon |
@@ -936,6 +939,8 @@ class Mastodon: | |||
936 | if media_ids is not None: | 939 | if media_ids is not None: |
937 | try: | 940 | try: |
938 | media_ids_proper = [] | 941 | media_ids_proper = [] |
942 | if not isinstance(media_ids, (list, tuple)): | ||
943 | media_ids = [media_ids] | ||
939 | for media_id in media_ids: | 944 | for media_id in media_ids: |
940 | if isinstance(media_id, dict): | 945 | if isinstance(media_id, dict): |
941 | media_ids_proper.append(media_id["id"]) | 946 | media_ids_proper.append(media_id["id"]) |