From 5f44998dd201beb871f06c0813b3dc69d387f7da Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Tue, 17 Apr 2018 17:49:08 +0200 Subject: First steps to 2.3.0 support --- docs/index.rst | 17 +++++++++++++++-- mastodon/Mastodon.py | 6 ++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index eebe893..436d7cc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -385,10 +385,13 @@ Media dicts 'preview_url': # The URL for the media preview 'text_url': # The display text for the media (what shows up in toots) 'meta': # Dictionary of two image metadata dicts (see below), - # 'original' and 'small' (preview) + # 'original' and 'small' (preview). Either may be empty. + # May additionally contain an "fps" field giving a videos frames per second (possibly + # rounded), and a "length" field giving a videos length in a human-readable format. + # Note that a video may have an image as preview. } - # Metadata dicts: + # Metadata dicts (image) - all fields are optional: { 'width': # Width of the image in pixels 'height': # Height of the image in pixels @@ -396,6 +399,14 @@ Media dicts 'size': # Textual representation of the image size in pixels, e.g. '800x600' } + # Metadata dicts (video, gifv) - all fields are optional: + { + 'width': # Width of the video in pixels + 'heigh': # Height of the video in pixels + 'frame_rate': # Exact frame rate of the video in frames per second + 'duration': # Duration of the video in seconds + 'bitrate': # Average bit-rate of the video in bytes per second + } Card dicts ~~~~~~~~~~ .. _card dict: @@ -452,6 +463,8 @@ Instance dicts 'version': # The instances mastodon version 'urls': # Additional URLs dict, presently only 'streaming_api' with the # stream websocket address. + 'contact_account': # Account dict of the primary contact for the instance. + 'languages': # Array of ISO 6391 language codes the instance has chosen to advertise. } Activity dicts diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1056d7a..5a32be0 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1143,9 +1143,9 @@ class Mastodon: url = '/api/v1/accounts/{0}/unmute'.format(str(id)) return self.__api_request('POST', url) - @api_version("1.1.1", "2.1.0") + @api_version("1.1.1", "2.3.0") def account_update_credentials(self, display_name=None, note=None, - avatar=None, header=None): + avatar=None, header=None, locked=None): """ Update the profile for the currently logged-in user. @@ -1154,6 +1154,8 @@ class Mastodon: 'avatar' and 'header' are images encoded in base64, prepended by a content-type (for example: 'data:image/png;base64,iVBORw0KGgoAAAA[...]') + 'locked' specifies whether the user needs to manually approve follow requests. + Returns the updated `user dict` of the logged-in user. """ params = self.__generate_params(locals()) -- cgit v1.2.3