Closed jkaberg closed 5 years ago
This is also now confirmed by
{u'message': u'Visit https://snapchat.com/download to update Snapchat to the latest version to be able to log in.', u'logged': False}
This would be to do with the user agent that is used when sending the request. It is stated as an iphone that is running an older ios. It should be fine as we are using the latest endpoints. The servers just think you're running an older version. Just ignore the message and continue
It does still let you log in through the bot right? or not?
Works fine for me. Its just telling you to update your Apple Snapchat app
@danwatco No the bot cannot login, the above msg
{u'message': u'Visit https://snapchat.com/download to update Snapchat to the latest version to be able to log in.', u'logged': False}
is what I get when trying to login. I added a print result here https://github.com/Rob--/SnapWrap/blob/master/SnapWrap/Client/__init__.py#L138 to be able to see it
Also it throws an exception:
Traceback (most recent call last): File "snapbot.py", line 14, in
bot = CustomBot(*["xxxx", "xxxx"]) File "/opt/snapbot/SnapWrap/snapchat.py", line 12, in init info = self.client.login(username, password) File "/opt/snapbot/SnapWrap/Client/init.py", line 141, in login if 'auth_token' in result['updates_response']: KeyError: 'updates_response'
I'm also getting this error now, tried to change the user-agent to a higher version
'User-Agent': 'Snapchat/8.3.1 (iPhone5,1; iOS 6.1.4; gzip)'
instead of
'User-Agent': 'Snapchat/8.2.1 (iPhone5,1; iOS 6.1.4; gzip)'
and it seems to pass the login but isn't downloading snaps anymore
@ObjectiveTruth I tried changing the User-Agent aswell but still getting the same error
Meh, I'll look into this soon - if Snapchat are updating the app they might be changing some endpoints such as bq/login
. I'll wait to see if they release an update.
@Rob-- they released an update today (android), verision 9.4.1.0
I think this is more complicated that a simple endpoint change. As I read on an issue on the repo php-snapchat, it looks like they have a new api more secure and just stopped supporting the old one.
Sifting through it all heres what I've found:
Login is fine, because the get_updates returns valid JSON data with the expected information
The issue I believe is with get_blob()
specifically on this line's call to decrypt()
According to this documentation, the response is only 200 OK
if the id provided is valid, which it does.
You can check by extracting out the self._request()
into an object and viewing the status_code
attribute
@ObjectiveTruth You sure your not using the login token somehow(cache)? I'm getting the update message no matter what user-agent I use
EDIT: Sorry about that instead of editing Client/init.py I edited the header parms in Client/utils.py and now I'm getting unauthorized
Seems these guys got it going again, https://github.com/mgp25/Snap-API
I'm not to familiar with PHP tho :-/
Do you know what they did to make it work? Was there a specific commit? @jkaberg
@danwatco No, didn't notice any specific commit. However it does work, did a test run earlier today.
Snap-API is working because they are using the Android endpoints. An Android user's Snapchat account is authenticated against their Google Account. This function is generating the Google OAuth token.
From what I can tell, Snapchat's iOS app doesn't work this way, they have opted for a more similar approach to their originally security, but with new (possibly rotating keys). Still looking into that one.
This library also uses the Android endpoints - that function is implemented into this library as it is required for the loq
login endpoint.
does your lib work right now ? @Rob--
It is indeed broken right now :(
It seems as though it is still possible to use Snapchat's API albeit very hard. If you decompile the APK you can find all the endpoints and you can see how the requests formed. From a quick look I can see how the login request is formed: return LoginTask.this.mGoogleAuthManager.a(LoginTask.this.mLoginName, LoginTask.this.mPassword, this.val$payload.timestamp, LoginTask.PATH);
. But it's incredibly hard to read the obfuscated code, and Snapchat seem to detect when a fake certificate is being used (even if trusted by the device) so I can't even use a proxy. Not sure if anyone else has any other suggestions?
@Rob-- Are you interested in continuing development on the Snapchat API? Hit me up.
@bsforza70 I'd be interested if @Rob-- isn't, do you have any info - as far as I know there is no working APIs at the moment.
Logging into my bot account today I noticed this;
Running the very latest git source of SnapWrap