Code: Select all
from twython import Twython
from auth import (
consumer_key,
consumer_secret,
access_token,
access_token_secret
)
twitter = Twython(
consumer_key,
consumer_secret,
access_token,
access_token_secret
)
def main():
video = open('/home/pi/Downloads/sample_mpeg4.mp4', 'rb')
response = twitter.upload_video(media=video, media_type='video/mp4')
twitter.update_status(status='Testing upload', media_ids=[response['media_id']])
if __name__ == '__main__':
main()
Can anyone help me with this? I'm using documentation from Twython at https://github.com/ryanmcgrath/twython/tree/master/docs and using aspects of another project at https://www.raspberrypi.org/learning/tweeting-babbage/Traceback (most recent call last):
File "/home/pi/tweeting-timelapse/tweet.py", line 22, in <module>
main()
File "/home/pi/tweeting-timelapse/tweet.py", line 18, in main
response = twitter.upload_video(media=video, media_type='video/mp4')
AttributeError: 'Twython' object has no attribute 'upload_video'