fraschetti/Octoslack

Pushover send error: 400: attachment is too large

andreapede opened this issue · 0 comments

In some case the image size could exceed the maximum allowed for sending 2.5mb
https://blog.pushover.net/posts/pushing-images-with-pushover-30#:~:text=Starting%20today%2C%20these%20e%2Dmails,are%20limited%20to%202.5%20megabytes.

2021-05-04 10:52:26,532 - octoprint.plugins.Octoslack - ERROR - Pushover send error: 400: attachment is too large (2700920 bytes is more than 2621440 limit
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 3729, in send_slack_message
    html=1,
  File "/home/pi/oprint/lib/python3.7/site-packages/pushover_complete/pushover_api.py", line 199, in send_message
    callback_url, timestamp, sound, html)
  File "/home/pi/oprint/lib/python3.7/site-packages/pushover_complete/pushover_api.py", line 154, in _send_message
    return self._generic_post('messages.json', payload=payload, session=session, files=attachment)
  File "/home/pi/oprint/lib/python3.7/site-packages/pushover_complete/pushover_api.py", line 88, in _generic_post
    raise BadAPIRequestError('{}: {}'.format(resp.status_code, ': '.join(resp_body.get('errors'))))
pushover_complete.error.BadAPIRequestError: 400: attachment is too large (2700920 bytes is more than 2621440 limit

It is possible to find some workaround like additional jpg compression or limitating the maximum size?
(great plugin tought)