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

Fail to login. #83

Open
Scape373 opened this issue Jan 11, 2015 · 19 comments
Open

Fail to login. #83

Scape373 opened this issue Jan 11, 2015 · 19 comments

Comments

@Scape373
Copy link

No matter what it wont log in.... Im trying to get it to login and send a snap, but cant even get it to log in first.

Where am i supposed to find my auth token also?

just keep getting this:

We logged in the old fashioned way! :(
Could not log into snapchat!

', PHP_EOL; } else { //Log in the old fashioned way. $snapchat = new Snapchat($username, $password); echo 'We logged in the old fashioned way! :(
', PHP_EOL; } //Check if we failed to log in succesfully if(!$snapchat->isLoggedIn()) { die("Could not log into snapchat!"); } //Store the auth token on disk so we don't have to log in again and again. file_put_contents($authFilePath, $snapchat->getAuthToken()); // Get your information. $snaps = $snapchat->getUpdates(); var_dump($snaps); //If you want to see the raw data echo 'Your birthday is: ', $snaps->birthday, '
', PHP_EOL; ?>
@Dubz
Copy link

Dubz commented Jan 12, 2015

I'm getting the same issue here as well. My iPad seems to work fine, I can login and see snaps/stories with no issue.

EDIT
I also created a new account just to make sure it wasn't account related or anything and got the same results. I can still send snaps as well so the issue is with the source of the script.

@realmuster
Copy link

Hello together, I just had to register to GitHub, wasn't using it until today. But I am currently using the php-snapchat Library for my own small client. I have the same issue described here for about two or three days. Not possible to login into Snapchat anymore. I will try to investigate for the problem, but if anyone has found the problem yet, please let me know.

EDIT: Well, the return of the Snapchat API is the following:

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>400 BAD_REQUEST</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: BAD_REQUEST</h1>
</body></html>

and with the curl_getinfo() function I can't get any more information. Any Ideas?

@Snowlav
Copy link

Snowlav commented Jan 12, 2015

@realmuster looks like snapchat blocked the network you are trying to connect from.

@Dubz
Copy link

Dubz commented Jan 14, 2015

@Snowlav I've tested this on multiple networks/accounts and I get blocked out too for no reason. I can also login to my account from my iPad with no issues so the account and network aren't the issue.

@Snowlav
Copy link

Snowlav commented Jan 14, 2015

@Dubz what is the error you are getting?
If you accounts aren't locked and your network is not blocked, it must be the code.

@Dubz
Copy link

Dubz commented Jan 14, 2015

@Snowlav That's what I'm saying. I don't know what it's saying, it just fails. I haven't added any debug code of any type to the code to print anything out.

I did an export of the snapchat object after logging in and it has the username and auth_token both false.

EDIT
I added the debug and got a 400 bad request as well. Any idea on a fix? I've tried multiple accounts and networks. My iPad works just fine on the same network (with the same account).

@realmuster
Copy link

Hey together. I found my problem. It was not the problem that the IP was blocked. It was the Problem that my account was blocked. I had to visit the url snapchat.com/locked to unlock my account. And if you visit this url you can read a text about using third-party applications.

I think someone needs to investigate the actual data that is sending to snapchat. We need to know what snapchat gets to know so we can send it as well and they do not see where the request exactly comes from.

@Dubz
Copy link

Dubz commented Jan 14, 2015

Tried the above just now, nothing. I'm still being blocked form the script only.

@Snowlav
Copy link

Snowlav commented Jan 14, 2015

This is strange, you sure it's a 400 bad request and not a 401?
are you running your script from a local IP or from a webhost?
@Dubz

@Dubz
Copy link

Dubz commented Jan 15, 2015

Logging in...
'< html>< head>
< meta http-equiv="content-type" content="text/html;charset=utf-8">
< title>400 BAD_REQUEST< /title>
< /head>
< body text=#000000 bgcolor=#ffffff>
< h1>Error: BAD_REQUEST< /h1>
< /body>< /html>
'
failed!

Straight from the post function. I added the following code between lines 316 and 317 in snapchat_agent.php:
var_export($result);

The "Logging in..." and "failed!" are from the console in the code I created with this source. I've tried it with multiple accounts and IP's as well as the same IP/account combination that my iPad worked with without errors.

I had to add a space after each < in the html to keep it from rendering to HTML in the comments.

@Snowlav
Copy link

Snowlav commented Jan 15, 2015

@Dubz refer to my previous question, are you running this from local server (with the same IP as your ipad etc) or from a remote server / webhost? (with an other IP)

If it's the latter, then this all makes sense, the IP your webhost is using is banned.
Try a proxy.

@Voiceeeeee
Copy link

Same thing here, unable to login to ANY accounts, while I can using my iPod, I'm locally hosted.
Edit: Fixed it by using this pull. #80

@Dubz
Copy link

Dubz commented Jan 17, 2015

Thanks for the tip @Voiceeeeee, that seemed to work for me. Guess these have to stay up to date.

@j0rd
Copy link

j0rd commented Jan 20, 2015

#80 worked for me.

@Dubz
Copy link

Dubz commented Jan 20, 2015

I just got an email from snapchat warning me not to use third party applications. I run this script on localhost so there must still be something in the code that tips them off, or they've been checking this repo now. Seems like this needs some more randomization of some type.

@Voiceeeeee
Copy link

My account got locked for "repeatedly using third-part applications", I'm also on localhost, not sure why this is happening.
But it's easy to get it unlocked here, http://snapchat.com/locked, but I don't know if it's a one time thing.

@Dubz
Copy link

Dubz commented Jan 20, 2015

@Voiceeeeee I did that, it didn't fix my initial problem, probably because it wasn't locked at all. Issue #80 did fix it, but it seems like it's not going to last long.

@Voiceeeeee
Copy link

Yea, there probably is something other than #80, but I have no idea what it is, everything seems to be right.

@Snowlav
Copy link

Snowlav commented Jan 21, 2015

http://puu.sh/eO5nV/6b4e58fb0d.png
"If you believe you received the notification in error, it may be because you are using an old version of Snapchat. Please make sure you have the most recent version of the app downloaded."

Makes me believe it's a combination of the right headers and endpoints.
Since the newer version of snapchat uses new endpoints and the current php lib does not.

Using a header / user-agent with the latest version but old endpoints is an easy giveaway.

While managing a single account, new endpoints, new headers I have not yet been locked.
While managing multiple accounts, so far only the network has been blocked for approx 48 hours every time.

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

6 participants