scotttherobot/PyEcho

Error 200 on every login

Opened this issue · 21 comments

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.

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.

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.

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?

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?

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 commented

Same issue. Login fail. Using py version 2.7.10.

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

jezzz commented

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.

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

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

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

jezzz commented

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 commented

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

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 commented

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.

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 commented

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

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"

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

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 commented

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.