From bfb06b59a1f3e54ce5140aa2f03443dda8959fa0 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 19 Feb 2021 10:12:59 -0600 Subject: [PATCH] Add additional_owners parameter for API.simple_upload --- tweepy/api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index a452f82..7373948 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -356,14 +356,20 @@ class API: @payload('media') def simple_upload(self, filename, file=None, media_category=None, - *args, **kwargs): + additional_owners=None, *args, **kwargs): """ :reference: https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload """ if file is not None: files = {'media': (filename, file)} else: files = {'media': open(filename, 'rb')} - post_data = {'media_category': media_category} + + post_data = {} + if media_category is not None: + post_data['media_category'] = media_category + if additional_owners is not None: + post_data['additional_owners'] = additional_owners + return self.request( 'POST', 'media/upload', *args, post_data=post_data, files=files, upload_api=True, **kwargs -- 2.25.1