Skip to content

Photo Upload stopped working #511

@janbuhh

Description

@janbuhh

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'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions