'Upload a media file to Twitter in one request. Used for small file
uploads that do not require chunked uploads.
Args:
media:
File-like object to upload.
additional_owners: additional Twitter users that are allowed to use
The uploaded media. Should be a list of integers. Maximum
number of additional owners is capped at 100 by Twitter.
media_category:
Category with which to identify media upload. Only use with Ads
API & video files.
Returns:
media_id:
ID of the uploaded media returned by the Twitter API or 0.'

def UploadMediaSimple(self, media, additional_owners=None, media_category=None):

    url = ('%s/media/upload.json' % self.upload_url)
    parameters = {}
    (media_fp, filename, file_size, media_type) = parse_media_file(media)
    parameters['media'] = media_fp.read()
    if (additional_owners and (len(additional_owners) > 100)):
        raise TwitterError({'message': 'Maximum    of    100    additional    owners    may    be    specified    for    a    Media    object'})
    if additional_owners:
        parameters['additional_owners'] = additional_owners
    if media_category:
        parameters['media_category'] = media_category
    resp = self._RequestUrl(url, 'POST', data=parameters)
    data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
    try:
        return data['media_id']
    except KeyError:
        raise TwitterError({'message': 'Media    could    not    be    uploaded.'})
