Add additional_owners parameter for API.simple_upload
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:12:59 +0000 (10:12 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:12:59 +0000 (10:12 -0600)
tweepy/api.py

index a452f825642bc994b28a5bc07de775f9785245bc..7373948937fcd585eef87dbcc5a2786fa25c52ce 100644 (file)
@@ -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