Merge pull request #1 from foozmeat/foozmeat-alt-text-patch
Added optional media description
This commit is contained in:
commit
611d335780
S'han modificat 1 arxius amb 3 adicions i 2 eliminacions
|
@ -776,7 +776,7 @@ class Mastodon:
|
||||||
###
|
###
|
||||||
# Writing data: Media
|
# 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
|
Post an image. media_file can either be image data or
|
||||||
a file name. If image data is passed directly, the mime
|
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)
|
media_file_description = (file_name, media_file, mime_type)
|
||||||
return self.__api_request('POST', '/api/v1/media',
|
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
|
# Writing data: Domain blocks
|
||||||
|
|
Loading…
Referencia en una nova incidència