richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

Was working fine, now #126

Closed JeffWScott closed 6 years ago

JeffWScott commented 6 years ago

Everything was working great for the last month but now I can't send a push. This is the error I get when I try:

Traceback (most recent call last): File "test_ST.py", line 11, in push = pb.push_note('TEST','') File "/usr/local/lib/python2.7/dist-packages/pushbullet/pushbullet.py", line 286, in push_note return self._push(data) File "/usr/local/lib/python2.7/dist-packages/pushbullet/pushbullet.py", line 309, in _push raise PushError(r.text) pushbullet.errors.PushError: <exception str() failed>

This is the simple test code: from pushbullet import Pushbullet api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXx" pb = Pushbullet(api_key) push = pb.push_note('test','test')

I'm at a loss as to what is wrong. I can't see an error code anywhere to be able to match to the PushBullet API site.

Any help would be appreciated!

Thanks,

simonporter007 commented 6 years ago

From the stack trace it looks like your body of the note is empty? Yet your sample code includes it. Are you certain that the body is included in your sample? The error that it's throwing is because the push to pushbullet's endpoint is not returning an "OK" response. So it's throwing the exception of str() failed.

JeffWScott commented 6 years ago

Yeah I mean the string is there, if it's not included you get a compile error to the effect of not enough arguments supplied to the function, as you know.

Is there a limit on pushes you can make in a month? I'm wondering if I hit on some kind of api limit or something. I see that is one of the return codes. Can your API print the return code?

simonporter007 commented 6 years ago

If you try to push via the command line, do you get an error that you have gone over your limit? I've looked at the docs and there's no real explanation of what the error is when it does go over the free limit. Something like the example:

curl --header 'Access-Token: <your_access_token_here>' \
     --header 'Content-Type: application/json' \
     --data-binary '{"body":"Space Elevator, Mars Hyperloop, Space Model S (Model Space?)","title":"Space Travel Ideas","type":"note"}' \
     --request POST \
     https://api.pushbullet.com/v2/pushes

It would be interesting to see if you have, then I imagine its fairly simple to add the check into pushbullet.py

For what its worth, its not my API - I just help out where I can :)

JeffWScott commented 6 years ago

Hey, looks like it's working again. I dunno. Maybe just a glitch in the matrix.

I appreciate all the work you have done on the wrapper. It's really great stuff!

skreza commented 6 years ago

Looks like I'm having the same issue as above, has been working perfectly for months then all of a sudden stopped. Same error with same lines of code.

Anyone else seeing this?

skreza commented 6 years ago

Looks like something went wrong with my PushBullet account. Deleting and recreating my account account fixed this issue.