SnapchatBot
SnapchatBot copied to clipboard
KeyError: 'updates_response' bot.py line 27
I suddenly started getting this error today and I haven't made any changes to the code. My bot has been running fine for quite a while until I tried to restart it today and now it gets that error.
http://i.imgur.com/jEq3koR.png
Any account I try to log in with the bot gets that error.
I'm guessing Snapchat made another change on their end, I installed the latest pysnap and still get the issue.
Yeah, definitely a change on Snapchat's end -- probably some additional fields that weren't required by /loq/login
before now are. We need to completely document the new API to make sure we're making the right requests.
Has there been any updates on how we could go about fixing this?
Also had this error.
Is there a way I can bypass this problem until someone fixes it?
Not really, we need to wait for @agermanidis to fix it. Want dogecoin ?
@koushag @N07070 I had it working last night and this morning, and it was until Today that I started getting this error.
I tried running it on a linux vm and on mac osx and had the same problem, is snapchat filtering specific accounts?
...So what now?
I'll take a look and try to figure out how to solve it when I find the time.
I am still getting this issue now
Dang it, Snapchat! Why do you have to do this to me???
I think there should be some sort of failing tag added to the repo, unless anyone is successfully running it without getting the updates_response error. This would prevent the unnecessary duplicates from being opened
I went into the snapchat account I was using with this bot, and I had a message from snapchat saying that I was putting myself and others at risk for using a third-party application to access SC.
Is this fixed? I got this error today, but I might have done something else wrong.
As has been pointed out, Snapchat is likely actively changing their api to prevent us from using it.
The issue may be simpler than we think. The key updates_response
does not exist, because snapchat replies with:
{u'message': u"You're using a version of Snapchat or operating system that's no longer supported. Please upgrade your device's operating system and update to the newest app version to use Snapchat. Thanks!", u'logged': False}
I will try updating the client header and see how this goes.
Edit: I dont know the iPhone user-agent header field, so I tried changing the number to 9.8.0 and got
{u'status': -103, u'message': u"Oh no! You're trying to access Snapchat through a third-party app! Please use the official Snapchat app instead. \U0001f47b", u'logged': False}
Could someone supply the correct user agent for Snapchat on iOS?
Edit2: It seems iOS has a hash it sends when you log in, and no one has reversed the iOS-app to obtain the hash algorithm yet. Android uses Google servers and device ID to authorize on snapchat. This might not be easy after all.
They might be a solution after all ?
On 22/05/2015 18:39, Kristian Rekstad wrote:
The issue may be simpler than we think. The key |updates_response| does not exist, because snapchat replies with:
{u'message': u"You're using a version of Snapchat or operating system that's no longer supported. Please upgrade your device's operating system and update to the newest app version to use Snapchat. Thanks!", u'logged': False}
I will try updating the client header and see how this goes.
— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/52#issuecomment-104708074.
Yes, there is a solution, but it is not easy. Either use the android system and generate the required keys, or reverse engineer the iOS-app to discover how the hash is computed. I see some PHP-libraries used the android-solution.
Should I just try random user-agents ? Also, do you have an ideal of how to use the android system and generate the required keys ?
On 22/05/2015 23:17, Kristian Rekstad wrote:
Yes, there is a solution, but it is not easy. Either use the android system and generate the required keys, or reverse engineer the iOS-app for discover how the hash is computed. I see some PHP-libraries used the android-solution.
— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/52#issuecomment-104772597.
@N07070
Should I just try random user-agents ?
That would not work. Either you use an old one, to which Snapchat API responds with "too old client", or you use a new one which requires more info.
Also, do you have an ideal of how to use the android system and generate the required keys ?
You would need to use a google account to send a request for OAuth2 tokens, using snapchats package name, I believe.
I read about this in another github issue for the PHP library. They said that once you had a request, it was easy to repeat it and generate new keys for that specific user in the future. They discussed this around January to March 2015. Link to discussion
However, this requires you to own an android phone (or possibly use an emulator? They all share device ID though. Perhaps it can be changed?), and you must have a google account (gmail).
The iOS way of authentication is perhaps easier from both a python and user perspective, as it only requires a hash. However, iOS apps are encrypted, and most likely reversed to an assembly-like language. This makes it hard to discover how the hash is generated in the first place.
And we ultimately dont know what the hash consists of. It is based on guesses that it only uses user/password/tokens from the Snapchat API alone.
I have an Android Phone at my disposal. Now, as for the OAuth part, I would need more info, because I am good with python, but Java and Android, not so much....
On 23/05/2015 20:38, Kristian Rekstad wrote:
@N07070 https://github.com/N07070
Should I just try random user-agents ?
That would not work. Either you use an old one, to which Snapchat API responds with "too old client", or you use a new one which requires more info.
Also, do you have an ideal of how to use the android system and generate the required keys ?
You would need to use a google account to send a request for OAuth2 tokens, using snapchats package name, I believe.
I read about this in another github issue for the PHP library. They said that once you had a request, it was easy to repeat it and generate new keys for that specific user in the future. They discussed this around January to March 2015. Link to discussion https://github.com/JorgenPhi/php-snapchat/issues/89
However, this requires you to own an android phone (or possibly use an emulator? They all share device ID though. Perhaps it can be changed?), and you must have a google account (gmail).
— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/52#issuecomment-104935669.
Okay, I looked through the php code. So, now, could @agermanidis make an update as the provided solution seems to work in php, could you port it to python ?
I get a 403 on the login request
[2017-09-26 19:58:56,005] Starting new HTTPS connection (1): feelinsonice-hrd.appspot.com
[2017-09-26 19:58:56,392] https://feelinsonice-hrd.appspot.com:443 "POST /loq/login HTTP/1.1" 403 None
Traceback (most recent call last):
File "storifierbot.py", line 16, in <module>
bot = StorifierBot(args.username, args.password)
File "/usr/local/lib/python2.7/dist-packages/snapchat_bots/bot.py", line 27, in __init__
self.auth_token = result['updates_response']['auth_token']
KeyError: 'updates_response'