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

Error 200 on every login #4

Open
lucastcox opened this issue Jun 11, 2015 · 21 comments
Open

Error 200 on every login #4

lucastcox opened this issue Jun 11, 2015 · 21 comments

Comments

@lucastcox
Copy link

I'm not sure if the login page changed, but I suddenly started getting:

"logging in...
Error logging in! Got status 200"

Whenever I attempt to use: echo = PyEcho.PyEcho("my_amazon_email_address", "my_amazone_password")

I re-downloaded your code to verify that I hadn't accidentally edited it, but it still has the issue. This issue started two days ago.

@MarkMcKinney
Copy link

I have had this same issue. Not sure what the problem is; I've reinstalled the PyEcho as well as several required modules but nothing has changed. I've also been receiving these errors:

InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

Not sure if that's causing some of the problems. I would really like to get this figured out ASAP.

@scotttherobot
Copy link
Owner

Hmm, I was able to reproduce this on my machine, too. Thanks for the tip. I will dig into the echo login page and see if they changed how login works.

@kendricklau
Copy link

I encountered the same problem too. I pulled this from the link:

Certain Python platforms (specifically, versions of Python earlier than 2.7.9) have restrictions in their ssl module that limit the configuration that urllib3 can apply. In particular, this can cause HTTPS requests that would succeed on more featureful platforms to fail, and can cause certain security features to be unavailable.

If you encounter this warning, it is strongly recommended you upgrade to a newer Python version, or that you use pyOpenSSL as described in the OpenSSL / PyOpenSSL section.

Maybe as simple as a python version upgrade?

@MarkMcKinney
Copy link

Thanks for the suggestions. Is installing and setting up the packages you noted easier than upgrading to Python 3 in the long run? I've heard many modules do not work with Python 3, although I could be wrong?

@lucastcox
Copy link
Author

Mark,

You don't need to upgrade to 3. Instead, just upgrade to something greater than or equal to 2.7.9. (Current 2.7* version is 2.7.10) https://www.python.org/downloads/

@jezzz
Copy link

jezzz commented Jun 22, 2015

Same issue. Login fail. Using py version 2.7.10.

@MarkMcKinney
Copy link

Hmmmm...have you tried Python 3 on your machine?

@jezzz
Copy link

jezzz commented Jun 22, 2015

Did some testing. Looks like Amazon doesn't like the user agent in PyEcho.py line 129. I changed this value to another ubiquitous one and it logged in without issue. Hope that helps.

@MarkMcKinney
Copy link

Nice catch, which one User-Agent did you use in particular?

@scotttherobot
Copy link
Owner

!!!!!! @jezzz Wow, thank you for figuring that out!!!!! That's very odd. I just changed my user agent to match Safari 7.0.3, and it worked. I wonder why this behavior changed, maybe Amazon doesn't like our little extracurricular activities. @MarkMcKinney and @locustcox, I hope this fixes your issues too.

Here's the user agent string I just used successfully: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A. I'll push a commit to the repo now with the change. (See: c35a230)

scotttherobot added a commit that referenced this issue Jun 23, 2015
Well, apparently, the user agent string that had been used was no longer liked
by Amazon. When using it, login was failing. Suspicious. Thans to @jezzz for
figuring that out. See issue #4 for more info.
@MarkMcKinney
Copy link

Yup, just used that one and it worked! Thanks!

@jezzz
Copy link

jezzz commented Jun 23, 2015

No problem. Happy to help. I presume if you overlap a very common user agent, then amazon is not likely to block it. However, that may prompt them to implement other, more complicated methods to block this type of activity. Or ... the issue could be unrelated entirely to this (and similar) code bases. Time will tell.

@jezzz
Copy link

jezzz commented Jun 23, 2015

On a semi-related note, has anyone researched the thresholds at which Amazon gets upset? Ie. queries per second/hour/day, etc?

@scotttherobot
Copy link
Owner

Or ... the issue could be unrelated entirely to this (and similar) code bases. Time will tell.

I also had the thought that they simply dropped support for the browser with that user agent. I once tried to visit the echo webapp from an odd browser on one of my Linux machines and I was redirected to a "sorry, get a real browser" type page. Who knows.

On a semi-related note, has anyone researched the thresholds at which Amazon gets upset?

I have not run into this. It'd be nice to implement a WebSocket client into this project instead of polling the API. That'd make events even more realtime, and our usage would look a lot more like a regular browser as a bonus since we wouldn't have to constantly make queries.

@jezzz
Copy link

jezzz commented Jun 23, 2015

Excellent. Didn't realize amazon had any websockets. I've written lots of websocket stuff in python. Servers, clients, etc. Happy to contribute here if desired.

@scotttherobot
Copy link
Owner

Yeah, their webapp at echo.amazon.com is made realtime by websockets. Other projects have figured out how to piggyback off of them by injecting some javascript to fire off requests to external APIs, but that requires leaving a browser open all the time. If we could connect to those websockets directly it'd be helpful. If you want to take a crack at connecting to them, I welcome you! I'm unfortunately pretty busy currently so it's lower on my priority list.

@jezzz
Copy link

jezzz commented Jun 23, 2015

Yep. Thought maybe they had public ones. I'll tinker with it in my bunches of spare time :)

@rafale77
Copy link

Had the same problem and had to update the user agent to my current to make it work "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"

@saqebakhter
Copy link

I'm still getting an Error logging in message - any idea guys ?

@robross0606
Copy link

Also still getting this error even after changing to "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7". Is there a new user agent string that works?

@tgarc
Copy link

tgarc commented Mar 29, 2017

This doesn't work for me either, even trying the most recent popular user agents. Has anyone found any alternatives to accessing the pitangui api? I even tried setting up a developer account with amazon. But even being authenticated with a valid access token and passing it in the header like so:

{ 'Authorization': 'Bearer %s' % access_token }

Just sends me back to the login page.

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

9 participants