Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photo Upload stopped working #511

Open
janbuhh opened this issue Feb 26, 2019 · 0 comments
Open

Photo Upload stopped working #511

janbuhh opened this issue Feb 26, 2019 · 0 comments

Comments

@janbuhh
Copy link

janbuhh commented Feb 26, 2019

Photo Upload worked fine, I changed nothing in the script... but now I receive following error:

Traceback (most recent call last):
File "tweet_photo1.py", line 16, in
media_uploaded = twyapi.upload_media(media=photo)
File "/usr/lib/python2.7/dist-packages/twython/endpoints.py", line 145, in upload_media
return self.post('https://upload.twitter.com/1.1/media/upload.json', params=params)
File "/usr/lib/python2.7/dist-packages/twython/api.py", line 268, in post
return self.request(endpoint, 'POST', params=params, version=version)
File "/usr/lib/python2.7/dist-packages/twython/api.py", line 258, in request
api_call=url)
File "/usr/lib/python2.7/dist-packages/twython/api.py", line 194, in _request
retry_after=response.headers.get('X-Rate-Limit-Reset'))
twython.exceptions.TwythonError: An error occurred processing your request.

Do you know what could be the problem?

Here is my script:

import modules

import datetime
import random
import sys
import requests
from twython import Twython

CONSUMER_KEY = 'xxxxx'
CONSUMER_SECRET = 'xxxxx'
OAUTH_TOKEN = 'xxxxxx-xxxxxx'
OAUTH_TOKEN_SECRET = 'xxxxxxx'
twyapi = Twython(CONSUMER_KEY,CONSUMER_SECRET,OAUTH_TOKEN,OAUTH_TOKEN_SECRET)

path = "/home/pi/Projekt2019/HDR/001.jpg"
photo = open(path, 'rb')
media_uploaded = twyapi.upload_media(media=photo)
media_id = media_uploaded['media_id']
response = twyapi.update_status(status=('New Picture'), media_ids=media_uploaded['media_id'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant