Sandmann79 / xbmc

Prime Video Addon for Kodi Media Center
https://forum.kodi.tv/showthread.php?tid=349255
GNU General Public License v3.0
761 stars 192 forks source link

Amazon Prime on Raspberry PI 3 and Kodi Login Problem #318

Closed kdebinder closed 4 years ago

kdebinder commented 5 years ago

I installed the add-on for Amazon Prime and followed the instructions in configuring it. I enter the Amazon User ID and Password and "Sign In". It displays a screen asking to re-enter the password and "Enter the characters as the are given in the challenge." I to this and "Sign In". This process repeats over and over. I have check the Amazon credentials and they are correct. HELP...

Varstahl commented 5 years ago

It sounds like a problem with the captcha:

  1. where are you from?
  2. which addon are you using?
kdebinder commented 5 years ago

Hey Bruno,

Thanks for the response. I am in Knoxville, TN.

I am using:

I figured the same but I am not getting any message to that effect. Is there any way around it that you know of…???

Thanks, Kevin

Varstahl commented 5 years ago

Hmm, there's no such thing, so I'm assuming you're using Amazon, the problem though is that it only works for DE. You should grab Amazon VOD and try with that. It's from the same repository, just uninstall Amazon and install the VOD one and it should work.

Note that for everything not primevideo.com (so US, JP, UK and DE) the addon takes a few hours to bootstrap, just leave it on in the background while it builds the initial catalogue.

kdebinder commented 5 years ago

Sorry, I didn’t understand the question…

I am in the US. I installed Amazon VOD (I installed Amazon first but then realized it was in German). I am using Version 0.7.4.

I just uninstalled, reinstalled and tried again. No luck. Same problem…

This is breaking my heart…

Varstahl commented 5 years ago

I'm not the dev responsible for the amazon.TLDs so I'm unsure of the way to go from here. I remember people having problems with 2FA and captchas. Judging by #169 and what little I remember, you could have some more information on the logs.

Just to cover a few bases, going off memory:

Finally, a bit unrelated but I'll mention it anyway: several people having problems with OSMC found their problems gone moving to LibreElec.

If you can investigate a little, I'll try to help as best I can.

Varstahl commented 5 years ago

Ah, I'll just post again instead of editing to make sure it reaches you: if you have a mistake in your password, amazon won't tell you. It might reach the captcha with the problem being incorrect password. Of course, it might also be a password-encoding problem, but I thought I'd specify.

carenrose commented 5 years ago

I'm also having this issue. After one reboot, I managed to get it to sign in successfully. After a bit it started prompting again. After another reboot, I got it to attempt to play a video and install widevine, then prompted again. Still haven't gotten it to play.

My password is correct and has no special characters.

Varstahl commented 5 years ago

@carenrose which country are you trying it from, and what platform?

carenrose commented 5 years ago

United States Built into OSMC on Raspberry Pi 3

Last night after a couple tries it did eventually accept the captcha and I was able to stream video.

kdebinder commented 5 years ago

Still having the samer problem. Any suggestions...??? Can I turn off the process of re-prompting for my password and entering the kaptcha? That is getting EXTREMELY annoying. Not sure if donating to something or someone would help but this is an important step to cord cutting and I would love to get it working.

Varstahl commented 5 years ago

@kdebinder I understand, but that portion of code was not built by me so I'm not 100% sure. Some people fixed it by trying to log in after a day or two, some people temporarily disabled 2FA, some deleted all cache and cookies and then it worked. One of the main problems out of this is Amazon not telling people why it failed (due to security concerns), just that it did. It's hard to pinpoint the causes exactly while it works for so much people.

A few common points of failure to check:

  1. the account is not the main account, but a linked one with limited privileges;
  2. network/proxy/vpn problems. At times we found out some Kodi installation using something it wasn't supposed to, causing havoc with Amazon's geofencing;
  3. password mismatch, cookie issue, disabled TLS verification security.

In any case, if you want to try, you can clean everything and then follow these steps:

  1. enable verbose logging at miscellaneous settings;
  2. login again;
  3. locate amazon-login.log located at /storage/.kodi/temp, or where appropriate on your distro;
  4. remove your username/email from it since it contains the login html response, and upload it somewhere.

I'll try to check it if/when I can, but I'm already very time constricted.

eto- commented 5 years ago

Same problem here. I tried disabling 2FA but did not change. Running OSMC from Italy.

avod-login.log: https://pastebin.com/3yKGB5TG

Thunderbird2086 commented 4 years ago

First of all, I'm using OSMC and iMac, and am living in Japan. I found two issues for network.py, and it seems Unicode Decoding issue.

  1. L568
    568            self.head = head.p.renderContents().strip().encode('utf-8')

    I changed encode to decode

  2. L489
    489            useMFA = 'otpCode' in str(list(br.forms())[0])

    It seems to check variable name in HTML form, but list(br.forms()) becomes [<mechanize._form.HTMLForm instance at 0x600002499660>]. I simply change it to below as I don't see optCode in the actual HTML source.

       useMFA = False

I am not sure above are correct fix for the issue, but I was able to login from my iMac after changed code.

On the other hand, UnicodeDecodeError happened at L375 on my osmc.

375                    br[choices[sel][1]] = [choices[sel][2]]

So, I changed to

375                    br[choices[sel][1]] = [choices[sel][2].encode('utf-8')]

Then, I was able to login from my osmc.

SasakiSadako commented 4 years ago

i was follwing the instructions and finally could see the captcha on my osmc device. then i entered my password again, and entered the capchta. i instantly get an error message.

here is my logfile from the addon. i hope it helps. https://pastebin.com/zTuWbrvh

and this is the error from the kodi logfile i get after i entered the captcha https://pastebin.com/Usa2M20H im living in japan, and tried to connect to my amazonjp account with this. but even when i connect to my vpn, and try to login to my amazon.com account (which i use on my notebook) i get the same errors

thk12 commented 4 years ago

got the same issue, RasPi3 + OSMC. seems to be an UTF8 issue with the password including an umlaut 'ö':

File "/usr/lib/python2.7/urllib.py", line 1343, in urlencode v = quote_plus(str(v)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 3: ordinal not in range(128) -->End of Python script error report<--

full backtrace: https://pastebin.com/Z9dLrUn7

SasakiSadako commented 4 years ago

For me I don't have an "umlaut" in my password. I just use an _ inside my password

pcs3rd commented 4 years ago

With @Thunderbird2086 edit at L375 in network.py on OSMC pi3b+, this is my dump,
https://pastebin.com/GkTzGGzw
Does not seem to work for me, still can't continue past recapta

SasakiSadako commented 4 years ago

For me it's the same the edit is not helping for passing the captcha. Only for showing the captcha

Varstahl commented 4 years ago

I don't know if there is an issue with mechanize which we recently replaced with MechanicalSoup, but there are some pretty heavy changes coming to the addon. If you guys want to tinker/test, you can grab the latest version of plugin.video.amazon-test from the add-py3 branch, plus script.module.mechanicalsoup. You also need to install BeautifulSoup4.

Most of the errors I have seen of this kind over the years were caused by standard python libraries or particular distro flavours, which I haven't managed to reproduce, but if this is still an issue I'm looking forward to fixing it once and for all, if you help.

pcs3rd commented 4 years ago

Will try, will it update the existing plugin or should it be uninstalled before installing this?

SasakiSadako commented 4 years ago

Thank you :) I will try it too :)

I could not install the test addon. he said there is an error in the plugin structure. Maybe a mistake by myself. But i installed mechanical soup from there, and the Beautifulsoup4 Than i deinstalled my amazon VOD and reinstalled it again. I just wanted to try it. I could enter my login data, he send me an email with a code, and he said im logged in now. Now the addon loads, so i think i have to wait, but its a new step i never reached before.

Varstahl commented 4 years ago

@pcs3rd you can just install it over, but I've been notified that in primevideo playback won't start because… err… I forgot to check if playback worked on the new system. I should get it fixed today.

@SasakiSadako I'll take a wild guess saying that you're a DE/JP/UK/US user as I've never heard of e-Mail confirmations before. I'm not 100% sure, it usually takes a few hours to build the catalog and then you can use it, iirc.

SasakiSadako commented 4 years ago

@Varstahl I have the confirmation email sometimes on my pc, but never pass it on my Raspberry pi.

It works now, thank you for that. Is it possible to use my amazon.com and my amazon.co.jp account at once? i tried them each, and they worked with my vpn. But is it possible with the multiple user function, so i just have to change the vpn connection.

Varstahl commented 4 years ago

Is it possible to use my amazon.com and my amazon.co.jp account at once?

Yes, you can enable Multi User in the Connection options of Amazon VOD addon. Then you can add any number of accounts, even from the same area. I don't think that multi user is supported on exported library yet, though, but while using the addon you can select which account to use and browse the catalog of that specific area.

MithrasPan commented 4 years ago

Kodi (OSMC) on a pi3... USA... Amazon VOD 0.7.4... getting errors when entering my signin info...

...question- would periods in a user name (email address) be something that could cause the addon to fail?

Varstahl commented 4 years ago

Technically no, but there have been a number of changes recently, it's possible that 0.7.4 no longer works.

dplagge commented 4 years ago

I had a similar issue where the login did not work. It turned out that with my current Python 2 installation on RPi3 an insecure connection to Amazon (TLS1) is not allowed anymore. A workaround is to allow such insecure connections in the openssl configuration (/etc/ssl/openssl.cnf):

[system_default_sect]
#MinProtocol = TLSv1.2
#CipherString = DEFAULT@SECLEVEL=2
MinProtocol = None
CipherString = DEFAULT

The commented out values are the previous (secure) settings.

Now I can log in but see no entries due to 410 errors... But that's not part of this ticket.

Varstahl commented 4 years ago

Latest version is out, if you still have login problems with the new version, let me know.

kkarnatak commented 4 years ago

I installed the latest version from Kodi and have the same issue. I entered my credentials and captcha. I got 2FA code, entered it as well and it asked me what name I want for this login. I chose and my name was on top right. But, then again it keeps on asking me to login. I checked the added users list and my name is still there. I tried to login 4 or 5 times more, but same issues. Its very annoying as the keyboard does not work on kodi and have to use mouse to enter login details.

Shall I use release from git or from kodi is the same version?

I am using Jessie with 3B+. Its a google AIY project image so python packages are updated to the latest.

Varstahl commented 4 years ago

You need to upload the logs somewhere. You can find on the Wiki FAQ what to enable and where to get the files.

kkarnatak commented 4 years ago

I installed the latest version from Kodi and have the same issue. I entered my credentials and captcha. I got 2FA code, entered it as well and it asked me what name I want for this login. I chose and my name was on top right. But, then again it keeps on asking me to login. I checked the added users list and my name is still there. I tried to login 4 or 5 times more, but same issues. Its very annoying as the keyboard does not work on kodi and have to use mouse to enter login details.

Shall I use release from git or from kodi is the same version?

I am using Jessie with 3B+. Its a google AIY project image so python packages are updated to the latest.

So, I updated my OS and libraries and now I have different issues.

  1. With normal user login, I can't even sign in. I checked the logs, it shows SSL error. The logs are here: https://drive.google.com/open?id=1sauw9gQ15ekZSpokMgcsCqE_UHj4sAbT

  2. then I tried with root. With root, I can log in and browse through my watch list or the media content on my account. However, when I play a selection, it does not do anything. the logs are here; https://drive.google.com/open?id=1T8lv6jlX_SjfW5VFILD6z-ZWfFQQ52UI Search for "Gold"; name of one of the episodes.

Sandmann79 commented 4 years ago

@kkarnatak 2019-11-19 22:48:34.604 T:1599582432 NOTICE: [Amazon VOD] InputStream.Adaptive addon is not installed To play content, you should install InputStream Adaptive Addon from Kodi repo. Via user login, you have to enable Bypass ssl certificat verification at settings.

Varstahl commented 4 years ago

@kkarnatak:

ERROR: [Amazon VOD] Error reason: HTTPSConnectionPool(host='na.api.amazonvideo.com', port=443): Max retries exceeded with url: […] (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')],)",),)) (SSLError)

looks like a misconfiguration for TLS on the user level. While on root there must be a permission problem because the addon tries to install InputStream.Adaptive for you but fails. I couldn't see any problem addon side, looks like misconfiguration.

kkarnatak commented 4 years ago

@kkarnatak:

ERROR: [Amazon VOD] Error reason: HTTPSConnectionPool(host='na.api.amazonvideo.com', port=443): Max retries exceeded with url: […] (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')],)",),)) (SSLError)

looks like a misconfiguration for TLS on the user level. While on root there must be a permission problem because the addon tries to install InputStream.Adaptive for you but fails. I couldn't see any problem addon side, looks like misconfiguration.

Thanks for reply. How can I configure TLS correctly? I tried to bypass ssl certificate via settings but no change, on the contrary, when I exit kodi now, it crashes with core dump. I tried to install Inputstream Adaptive using zip file, it fails. I cannot see it present in my kodi repository

Varstahl commented 4 years ago

IS.A is present in the repo since Kodi 18, I really don't know where the problem lies. There might be no linux binaries for arm cores? Not sure, but fairly probable. So you'd either have to replace Jessie with something like LibreElec or forget to use our addon in the standard streamlined way. If you're able to use a browser on your custom linux build, you might configure the addon to use browser's kiosk mode instead of IS.A.

Your problem is a bit too specific, I don't have an easy answer to that. You might try to compile it yourself if it's not already ARM packed.

kkarnatak commented 4 years ago

@Varstahl Thanks for the reply and info. I will try to compile it to me and see how it goes. Thank you for prompt replies.