agermanidis / SnapchatBot

[deprecated] Python library for building bots that live on Snapchat
MIT License
517 stars 105 forks source link

requests.exceptions.HTTPError: 400 Client Error: Bad Request #39

Closed larserikfagernaes closed 9 years ago

larserikfagernaes commented 9 years ago

I keep on getting this error, anny idea what it is?

Rob-- commented 9 years ago

It means the request was badly formed, probably due to either malformed JSON or potentially the token used when sending the request. It might have to do with the logging in request. When do you receive the error?

larserikfagernaes commented 9 years ago

Hmm, i get the error when logging in. Here is more of the error message: File "build/bdist.macosx-10.9-intel/egg/pysnap/utils.py", line 88, in request File "/Library/Python/2.7/site-packages/requests-2.5.3-py2.7.egg/requests/models.py", line 831, in raise_for_status raise HTTPError(http_error_msg, response=self) The bot was working before, i dont know what happend.

Rob-- commented 9 years ago

The error is occurring when sending the request, this doesn't really help. Does it occur when the log in request is sent?

larserikfagernaes commented 9 years ago

i belive so, but im not too good at programming, here is the whole error so you can see for yourself: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/larserik/PycharmProjects/Koding/init.py [2015-03-13 12:27:45,045] Starting new HTTPS connection (1): feelinsonice-hrd.appspot.com [2015-03-13 12:27:45,339] "POST /bq/login HTTP/1.1" 400 None Traceback (most recent call last): File "/Users/larserik/PycharmProjects/Koding/init.py", line 41, in bot = StorifierBot("xxxx", "xxxxx") File "build/bdist.macosx-10.9-intel/egg/snapchat_bots/bot.py", line 20, in init File "build/bdist.macosx-10.9-intel/egg/pysnap/init.py", line 100, in login

File "build/bdist.macosx-10.9-intel/egg/pysnap/init.py", line 83, in _request

File "build/bdist.macosx-10.9-intel/egg/pysnap/utils.py", line 88, in request File "/Library/Python/2.7/site-packages/requests-2.5.3-py2.7.egg/requests/models.py", line 831, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request requests.exceptions.HTTPError: 400 Client Error: Bad Request

larserikfagernaes commented 9 years ago

i also get this error: [2015-03-13 13:38:43,461] Starting new HTTPS connection (1): feelinsonice-hrd.appspot.com [2015-03-13 13:38:44,573] "POST /loq/login HTTP/1.1" 403 434 Traceback (most recent call last): File "/Users/larserik/Desktop/PycharmProjects/untitled/NTNUsnap-master/nfp.py", line 78, in bot = StorifierBot("instaqwerty", "aXXo1212") File "build/bdist.macosx-10.10-intel/egg/snapchat_bots/bot.py", line 26, in init File "/Library/Python/2.7/site-packages/requests-2.5.3-py2.7.egg/requests/models.py", line 799, in json return json.loads(self.text, kwargs) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init**.py", line 338, in loads return _default_decoder.decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

larserikfagernaes commented 9 years ago

i think i solved it my going through proxies.

agermanidis commented 9 years ago

Yeah, your IP was probably banned, not much to do from the library's side, except maybe better error reporting :)

bsr4mpune commented 6 years ago

larserikfagernaes Can you please share the details what exactly you did to solve this from proxies side?