Uploads media file to Twitter servers. The file will be available to be attached to a status for 60 minutes. To attach to a update, pass a list of returned media ids to the :meth:`update_status` method using the ``media_ids`` param. Docs: https://developer.twitter.co
(self, **params)
| 147 | return self.post('statuses/update_with_media', params=params) |
| 148 | |
| 149 | def upload_media(self, **params): |
| 150 | """Uploads media file to Twitter servers. The file will be available to be attached |
| 151 | to a status for 60 minutes. To attach to a update, pass a list of returned media ids |
| 152 | to the :meth:`update_status` method using the ``media_ids`` param. |
| 153 | |
| 154 | Docs: |
| 155 | https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload |
| 156 | |
| 157 | """ |
| 158 | # https://developer.twitter.com/en/docs/media/upload-media/api-reference/get-media-upload-status |
| 159 | if params and params.get('command', '') == 'STATUS': |
| 160 | return self.get('https://upload.twitter.com/1.1/media/upload.json', params=params) |
| 161 | |
| 162 | return self.post('https://upload.twitter.com/1.1/media/upload.json', params=params) |
| 163 | |
| 164 | def create_metadata(self, **params): |
| 165 | """ Adds metadata to a media element, such as image descriptions for visually impaired. |