M
M
Maxim2016-10-16 15:20:49
Python
Maxim, 2016-10-16 15:20:49

How to upload a video to twitter?

I use the tweepy library to work with a tweet, there is no way to post a video
there is a Fork on this case, the
type seems to have filed an appled, in general, copied and pasted the changes and such a thing falls

Traceback (most recent call last):
  File "E:/Work/IDLE/tw_video.py", line 13, in <module>
    api.video_upload('E:\\777.mp4')
  File "C:\Python34\lib\site-packages\tweepy\api.py", line 221, in video_upload
    headers, post_data, fp = API._chunk_video('init', filename, 15360, form_field='media', f=f)
  File "C:\Python34\lib\site-packages\tweepy\api.py", line 1491, in _chunk_video
    body = b'\r\n'.join(body)
TypeError: sequence item 0: expected a bytes-like object, str found

The list consists of both a string and bytes, how can this be combined?
Or maybe someone implemented in a native way?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question