Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'updates_response' bot.py line 27 #52

Open
ShaneIsrael opened this issue Mar 20, 2015 · 24 comments
Open

KeyError: 'updates_response' bot.py line 27 #52

ShaneIsrael opened this issue Mar 20, 2015 · 24 comments

Comments

@ShaneIsrael
Copy link

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.

@ShaneIsrael
Copy link
Author

I'm guessing Snapchat made another change on their end, I installed the latest pysnap and still get the issue.

@agermanidis
Copy link
Owner

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.

@mavieth
Copy link

mavieth commented Mar 22, 2015

Has there been any updates on how we could go about fixing this?

@N07070
Copy link
Contributor

N07070 commented Mar 23, 2015

Also had this error.

@phemaa
Copy link

phemaa commented Mar 24, 2015

Is there a way I can bypass this problem until someone fixes it?

@N07070
Copy link
Contributor

N07070 commented Mar 24, 2015

Not really, we need to wait for @agermanidis to fix it. Want dogecoin ?

@jcherrera
Copy link

@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?

@mavieth
Copy link

mavieth commented Mar 24, 2015

...So what now?

@agermanidis
Copy link
Owner

I'll take a look and try to figure out how to solve it when I find the time.

@misingnoglic
Copy link

I am still getting this issue now

@vampjaz
Copy link

vampjaz commented Apr 15, 2015

Dang it, Snapchat! Why do you have to do this to me???

@jfach
Copy link
Contributor

jfach commented Apr 18, 2015

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

@jcherrera
Copy link

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.

@sverrejb
Copy link

Is this fixed? I got this error today, but I might have done something else wrong.

@vampjaz
Copy link

vampjaz commented May 11, 2015

As has been pointed out, Snapchat is likely actively changing their api to prevent us from using it.

@krissrex
Copy link
Contributor

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.

@N07070
Copy link
Contributor

N07070 commented May 22, 2015

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
#52 (comment).

@krissrex
Copy link
Contributor

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.

@N07070
Copy link
Contributor

N07070 commented May 23, 2015

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
#52 (comment).

@krissrex
Copy link
Contributor

@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).

@krissrex
Copy link
Contributor

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.

@N07070
Copy link
Contributor

N07070 commented May 23, 2015

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
JorgenPhi/php-snapchat#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
#52 (comment).

@N07070
Copy link
Contributor

N07070 commented May 27, 2015

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 ?

@brorbw
Copy link

brorbw commented Sep 26, 2017

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests