rmcrackan / AudibleApi

Audible API in C#
GNU Affero General Public License v3.0
50 stars 11 forks source link

CookieException #53

Open darman96 opened 1 week ago

darman96 commented 1 week ago

I get a CookieException when trying to login;

System.Net.CookieException: The 'Domain'='.amazon.' part of the cookie is invalid. at System.Net.Cookie.VerifySetDefaults(CookieVariant variant, Uri uri, Boolean isLocalDomain, String localDomain, Boolean setDefault, Boolean shouldThrow) at System.Net.CookieContainer.Add(Cookie cookie) at System.Net.CookieContainer.Add(CookieCollection cookies) at AudibleApi.Authentication.Authenticate.initClientState() in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 47 at AudibleApi.Authentication.Authenticate..ctor(Locale locale, String deviceName, IHttpClient client, ISystemDateTime systemDateTime) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 34 at AudibleApi.Authentication.Authenticate..ctor(Locale locale, String deviceName) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 21 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(Locale locale, String deviceName, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 55

darman96 commented 1 week ago

Oh I got the locale wrong. I passed "de" instead of "germany".

But now I get a LoginFailedException:

AudibleApi.Authentication.LoginFailedException: No matching result page type at AudibleApi.Authentication.LoginResultRunner.getResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpResponseMessage response) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 48 at AudibleApi.Authentication.LoginResultRunner.GetResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpMethod method, String url) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 26 at AudibleApi.Authentication.CredentialsPage.SubmitAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/CredentialsPage.cs:line 22 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 85 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(Locale locale, String deviceName, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 56

It seems that the captcha page matching doesn't work. The content of the request response is a captcha page but the CaptchaPageFactory _isMatchAsync implementation seems to be wrong.

Here's the content of the captcha page: https://pastebin.com/7iLguayE