Pass json_payload argument directly in API.create_media_metadata
authorHarmon <Harmon758@gmail.com>
Wed, 10 Feb 2021 03:56:21 +0000 (21:56 -0600)
committerHarmon <Harmon758@gmail.com>
Wed, 10 Feb 2021 03:56:21 +0000 (21:56 -0600)
Pass json_payload argument directly to API.request in API.create_media_metadata

tweepy/api.py

index 3c5ac35f5f6b22739afc1299905f37b36adc3c40..7ea796891e71b1c83d1ce46d7e38df9eaebbafe8 100644 (file)
@@ -364,13 +364,13 @@ class API:
     def create_media_metadata(self, media_id, alt_text, *args, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-metadata-create
         """
-        kwargs['json_payload'] = {
+        json_payload = {
             'media_id': media_id,
             'alt_text': {'text': alt_text}
         }
 
         return self.request(
-            'POST', 'media/metadata/create', *args,
+            'POST', 'media/metadata/create', *args, json_payload=json_payload,
             upload_api=True, **kwargs
         )