From b040ac8c7753c50d5aeabc1fada02de38d264f4e Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 19 Feb 2021 10:51:58 -0600 Subject: [PATCH] Add media_category and additional_owners parameters for API.media_upload --- tweepy/api.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index d18c331..114cdba 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -334,7 +334,8 @@ class API: ) def media_upload(self, filename, file=None, chunked=False, - *args, **kwargs): + media_category=None, additional_owners=None, *args, + **kwargs): """ :reference: https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload """ h = None @@ -349,10 +350,16 @@ class API: file_type = mimetypes.guess_type(filename)[0] if chunked or file_type.startswith('video/'): - return self.chunked_upload(filename, file=file, - file_type=file_type, **kwargs) + return self.chunked_upload( + filename, file=file, file_type=file_type, + media_category=media_category, + additional_owners=additional_owners, **kwargs + ) else: - return self.simple_upload(filename, file=file, **kwargs) + return self.simple_upload( + filename, file=file, media_category=media_category, + additional_owners=additional_owners, **kwargs + ) @payload('media') def simple_upload(self, filename, *, file=None, media_category=None, -- 2.25.1