CastagnaIT / plugin.video.netflix

InputStream based Netflix plugin for Kodi
MIT License
1.89k stars 258 forks source link

I'm unable to login with my valid credentials getting "loginContext" error. #1674

Closed ghost closed 2 weeks ago

ghost commented 5 months ago

Netflix add-on version

1.23.2

Operative systems used

Linux (Ubuntu / Mint / ...)

Kodi version used

Kodi 19 (Matrix)

Description of the bug

I'm unable to login with my valid credentials getting "loginContext" error.

Steps to reproduce the behavior

No response

Debug log - mandatory

https://paste.kodi.tv/azejucatit

Possible fix

No response

Additional context

No response

Screenshots

No response

ccoenen commented 5 months ago

I believe I'm seeing the same problem. Password used to work for years. Password hasn't changed. Re-entering password did not solve the problem for me.

huaak commented 5 months ago

I guess I face the same problem. Did a fresh install of libreelec on TV box, generated NFAuth-key, but neither with E-Mail & Password (here comes the "loginContext" error) nor with the NFkey (here I get "Email field not found" Error) I can log in.

MauriceW67 commented 5 months ago

I have the same issue as @huaak on my Nvidia Shield.

Logging in with the NFAuthentication.key prompts me for the PIN and then my password. Then the error "WebSiteParsingError: E-mail field not found" is displayed.

Logging in with ony e-mail and password gives me the loginContext error.

Note: I started the login process because the addon would not play content anymore (yesterday it was still working).

MauriceW67 commented 5 months ago

@CastagnaIT I believe this is no longer working because Netflix changed the layout of the Account page. The e-mail address of the account is no longer visible on the main Overview page. You now need to go to the Security sub-section to see the e-mail address.

If I look at what's going on in access.py I think the WebSiteParsingError is being raised because the addon cannot find the e-mail address anymore.

CastagnaIT commented 5 months ago

to me still works correctly so i think netflix website is not updated for all countries or they have reverted changes on these last days idk...

the only errors found are what shown in the log above that i have just fixed i will wait some days to see if also in my country change email position on the webpage

huaak commented 5 months ago

..here in Germany the new Layout on homepage is still active (for me) Bildschirmfoto_2024-02-04_15-31-27 ..on those devices I already setup the netflix addon it still works like a charm, but I could not get any new device like laptop (linux) or tv box (libreelec) to log in via kodi..

MauriceW67 commented 5 months ago

..on those devices I already setup the netflix addon it still works like a charm, but I could not get any new device like laptop (linux) or tv box (libreelec) to log in via kodi..

Same for me on the Dutch Netflix Account page.

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

ghost commented 5 months ago

Is that worked ?

On Sun, Feb 4, 2024, 9:45 AM MauriceW67 @.***> wrote:

..on those devices I already setup the netflix addon it still works like a charm, but I could not get any new device like laptop (linux) or tv box (libreelec) to log in via kodi..

Same for me on the Dutch Netflix Account page.

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925799936, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC5SVQD4UGXYJ3BYUC3YR6UIJAVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVG44TSOJTGY . You are receiving this because you authored the thread.Message ID: @.***>

huaak commented 5 months ago

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

Thank you very much-that saved my day..could now watch netflix on tv box in other room too..nice! :+1:

ghost commented 5 months ago

I haven't located the access.py under ~/.Kodi/addons/plugin.video.netflix No access.py.

On Sun, Feb 4, 2024, 10:09 AM huaak @.***> wrote:

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

Thank you very much-that saved my day..could now watch netflix on tv box in other room too..nice! 👍

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925808027, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC2DSFYYFRQ56G6WR63YR6XEVAVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHAYDQMBSG4 . You are receiving this because you authored the thread.Message ID: @.***>

ghost commented 5 months ago

Okay checked the logs one more time. I've found the location of the file. Thanks 👍

On Sun, Feb 4, 2024, 10:36 AM Erdem Yurtcuoglu @.***> wrote:

I haven't located the access.py under ~/.Kodi/addons/plugin.video.netflix No access.py.

On Sun, Feb 4, 2024, 10:09 AM huaak @.***> wrote:

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

Thank you very much-that saved my day..could now watch netflix on tv box in other room too..nice! 👍

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925808027, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC2DSFYYFRQ56G6WR63YR6XEVAVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHAYDQMBSG4 . You are receiving this because you authored the thread.Message ID: @.***>

anyc commented 5 months ago

It works for me too with the change in access.py. Thank you

ghost commented 5 months ago

Uh, I'm probably doing something wrong.

On Sun, Feb 4, 2024, 1:39 PM anyc @.***> wrote:

It works for me too with the change in access.py. Thank you

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925892811, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC37EDSQZ7G6LPOG2G3YR7PXZAVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHA4TEOBRGE . You are receiving this because you authored the thread.Message ID: @.***>

huaak commented 5 months ago

Uh, I'm probably doing something wrong.

..if you found the access.py file in /.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/ just delete the email_match.group(1).strip() if email_match else None part,

and enter your Netflix-Account-Email with straight, single quotation mark ' (no ` ´ or ") before and after the address and it should work..

MauriceW67 commented 5 months ago

@yurtcuogluer Note: My workaround only works for the login method with the .key file, not with e-mail/password.

ghost commented 5 months ago

Thanks, I'll check it out!

On Sun, Feb 4, 2024, 3:15 PM huaak @.***> wrote:

Uh, I'm probably doing something wrong.

..if you found the access.py file in /.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/ just delete the email = email_match.group(1).strip() if email_match else None part,

and enter your Netflix-Account-Email with straight, single quotation mark ' (no ` ´ or ") before and after the address and it should work..

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925916559, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC6ZDVDDN4ZPJJS46FLYR73A3AVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHEYTMNJVHE . You are receiving this because you authored the thread.Message ID: @.***>

ghost commented 5 months ago

Oh how can I do it on Fedora should I need to install another tool?

On Sun, Feb 4, 2024, 3:40 PM MauriceW67 @.***> wrote:

@yurtcuogluer https://github.com/yurtcuogluer Note: My workaround only works for the login method with the .key file, not with e-mail/password.

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1925929742, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQCZA4G655BSRK6OLLWTYR7543AVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVHEZDSNZUGI . You are receiving this because you were mentioned.Message ID: @.***>

huaak commented 5 months ago

..the only things you need(besides kodi, netflix addon, and chrome or chromium browser) are written in the description: https://github.com/CastagnaIT/plugin.video.netflix/wiki/Login-with-Authentication-key

MauriceW67 commented 5 months ago

@huaak Not sure what happened, but the link you posted is somehow corrupt. Retry here:

https://github.com/CastagnaIT/plugin.video.netflix/wiki/Login-with-Authentication-key

moderaterocker commented 5 months ago

same issue here on my Ubuntu media server with Kodi 20.2.

This is the verbose log:

https://paste.kodi.tv/pibidenaqi

trying to apply the Maurice's workaround...

moderaterocker commented 5 months ago

Confirmed: the workaround... works! Thanks @MauriceW67

yabba222 commented 5 months ago

..on those devices I already setup the netflix addon it still works like a charm, but I could not get any new device like laptop (linux) or tv box (libreelec) to log in via kodi..

Same for me on the Dutch Netflix Account page.

As a workaround I temporarily changed line 127 in the access.py file from this:

email = email_match.group(1).strip() if email_match else None

to this:

email = 'your e-mail address here'

How doing this in Nvidia Shield TV Pro ? I can't login in my Netflix account and under official app is only 540p output.

ccoenen commented 5 months ago

Will there be a fix for those of us who don't want to tinker with the plugin manually?

MauriceW67 commented 5 months ago

How doing this in Nvidia Shield TV Pro ?

Enable file sharing on your Nvidia Shield and then from a Windows PC in File Explorer browse to:

\\internal\Android\data\org.xbmc.kodi\files.kodi\addons\plugin.video.netflix\resources\lib\services\nfsession\session

I can't login in my Netflix account and under official app is only 540p output.

Did you ever copy your ESN from the official app to the Kodi addon? I made the mistake of doing that and since that time my official ESN has been blocked / resricted to 540p 😦

yabba222 commented 5 months ago

How doing this in Nvidia Shield TV Pro ?

Enable file sharing on your Nvidia Shield and then from a Windows PC in File Explorer browse to:

\internal\Android\data\org.xbmc.kodi\files.kodi\addons\plugin.video.netflix\resources\lib\services\nfsession\session

I can't login in my Netflix account and under official app is only 540p output.

Did you ever copy your ESN from the official app to the Kodi addon? I made the mistake of doing that and since that time my official ESN has been blocked / resricted to 540p 😦

Thank's for help - but this metod not work for me. I must lover my plan to HD because 4K on my shield don't work anymore.

HyknuF commented 5 months ago

Damn, tinkered with the workaround on a rpi 3 with libreelec, but couldn't get it to work. did every step very carefully. still got error "WebSiteParsingError: E-mail field not found". do you guys do something after changing the access.py? like clear cache of netflix addon, reboot or something? i also tried completely reinstall of netflixaddon and reboot etc. etc. so far, it won't work.

MauriceW67 commented 5 months ago

@HyknuF Are you sure the access.py file that you changed is in this location:

.kodi\addons\plugin.video.netflix\resources\lib\services\nfsession\session

Also, you could try clearing the pycache sub-directory to force a recompile of the .py files.

HyknuF commented 5 months ago

@MauriceW67 yes, path confirmed. i changed it via ssh. honestly, no idea how to clear the cache. have to look for it. thanks for reply!

MauriceW67 commented 5 months ago

@HyknuF Hmm I see that GitHub changed the spelling of pycache that I typed.

Each directory that contains .py files also contains a directory called __pycache__

You can enter that with ssh and delete all the files in it.

Also, make sure you are using the login method with the .key file. Not the username/password method.

HyknuF commented 5 months ago

@MauriceW67 thanks for clarifying, will try that. yes i tried with keyfile.

HyknuF commented 5 months ago

@MauriceW67 Ok, tested again but unfortunately same error. damn :-/

MauriceW67 commented 5 months ago

@HyknuF Can you show how you edited the file? It should look like this (e-mail anonymized):

# Get the account e-mail
page_response = self.get('your_account').decode('utf-8')
email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response)
email = 'xxxxx.yyyyy@gmail.com'
if not email:
raise WebsiteParsingError('E-mail field not found')
HyknuF commented 5 months ago

@HyknuF Can you show how you edited the file? It should look like this (e-mail anonymized):

# Get the account e-mail
page_response = self.get('your_account').decode('utf-8')
email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response)
email = 'xxxxx.yyyyy@gmail.com'
if not email:
raise WebsiteParsingError('E-mail field not found')

@MauriceW67 The part in my access.py looks identical:

page_response = self.get('your_account').decode('utf-8') email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response) email = 'my@email.com' if not email: raise WebsiteParsingError('E-mail field not found')

i really don't get it why it don't work for me because as i read the workaround the first time it seemed to be clear that this should work straight.

rockabillycat666 commented 4 months ago

@HyknuF Can you show how you edited the file? It should look like this (e-mail anonymized):

# Get the account e-mail
page_response = self.get('your_account').decode('utf-8')
email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response)
email = 'xxxxx.yyyyy@gmail.com'
if not email:
raise WebsiteParsingError('E-mail field not found')

@MauriceW67 The part in my access.py looks identical:

page_response = self.get('your_account').decode('utf-8') email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response) email = 'my@email.com' if not email: raise WebsiteParsingError('E-mail field not found')

i really don't get it why it don't work for me because as i read the workaround the first time it seemed to be clear that this should work straight.

Tried this and yeah... not working for me.. it gives also the loginContext error...

MauriceW67 commented 4 months ago

@rockabillycat666 Did you try the workaround while using the authentication method with the .key file?

Vincento00 commented 4 months ago

Does anyone know how to find and edit the access.py file in firestick 4k?

ghost commented 4 months ago

if there's ssh server up and running u can make a ssh connection to your device.

On Fri, Feb 9, 2024, 3:34 AM Vincento00 @.***> wrote:

Does anyone know how to find and edit the access.py file in firestick 4k?

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1674#issuecomment-1935599323, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD5FQC2MTSYQC7C5UFG6IK3YSXURRAVCNFSM6AAAAABCOKYQHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGU4TSMZSGM . You are receiving this because you were mentioned.Message ID: @.***>

Vincento00 commented 4 months ago

Could you please tell me how to start the ssh server. Maybe there is another way to get to the firestick files? Please help.

WildPenquin commented 4 months ago

The workaround described here does not work for me. I get the contextError and I am using the key log in method. Curiously, the account page has not been changed in my location (Finland), but still has the email on the front, there is no "security" subsection. I have also deleted all pycache.

I presume the errors I get are somewhat different and seem to point out at some localization part has broken:

2024-02-14 00:05:26.748 T:16661    info <general>: Loading skin file: MyVideoNav.xml, load type: KEEP_IN_MEMORY                                                                                                    
2024-02-14 00:05:26.858 T:16767    info <general>: [plugin.video.netflix (1)] The debug logging is set as DISABLED                                                                                                 
2024-02-14 00:05:27.195 T:16769   error <general>: [plugin.video.netflix (0)] IPC callback raised exception:                                                                                                       
2024-02-14 00:05:27.199 T:16769   error <general>: [plugin.video.netflix (0)] Traceback (most recent call last):                                                                                                   
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/cache_management.py", line 167, in get                                              
                                                       cache_entry = self._get_cache_bucket(bucket['name'])[identifier]                                                                                            
                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^                                                                                            
                                                   KeyError: 'IEUWXOYKNJEIJO5IBHGTOBKHKA_loco_list'                                                                                                                

                                                   The above exception was the direct cause of the following exception:                                                                                            

                                                   Traceback (most recent call last):                                                                                                                              
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/cache_utils.py", line 70, in wrapper                                                  
                                                       return G.CACHE.get(_bucket, identifier)                                                                                                                     
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                     
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/cache_management.py", line 175, in get                                              
                                                       raise CacheMiss from exc                                                                                                                                    
                                                   resources.lib.common.exceptions.CacheMiss                                                                                                                       

                                                   During handling of the above exception, another exception occurred:                                                                                             

                                                   Traceback (most recent call last):                                                                                                                              
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 105, in handle_request                                        
                                                       ret_data = _call_func(func, pickle.loads(data))                                                                                                             
                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                             
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 161, in _call_func                                            
                                                       return func(**data)                                                                                                                                         
                                                              ^^^^^^^^^^^^                                                                                                                                         
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper                                               
                                                       return func(*args, **kwargs)                                                                                                                                
                                                              ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/directorybuilder/dir_builder.py", line 80, in get_video_list              
                                                       list_id = self.get_loco_list_id_by_context(menu_data['loco_contexts'][0])                                                                                   
                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                   
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py", line 90, in get_loco_list_id_by_co
ntext                                                                                                                                                                                                              
                                                       return next(iter(self.req_loco_list_root().lists_by_context([context], True)))[0]                                                                           
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                  
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/cache_utils.py", line 72, in wrapper                                                  
                                                       output = func(*args, **kwargs)                                                                                                                              
                                                                ^^^^^^^^^^^^^^^^^^^^^                                                                                                                              
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/directorybuilder/dir_path_requests.py", line 66, in req_loco_list_root    
                                                       path_response = self.nfsession.path_request(**call_args)                                                                                                    
                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                    
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper                                               
                                                       return func(*args, **kwargs)                                                                                                                                
                                                              ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/path_requests.py", line 30, in path_request                       
                                                       response = self.post_safe(                                                                                                                                  
                                                                  ^^^^^^^^^^^^^^^                                                                                                                                  
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 75, in post_safe                                 
                                                       self.assert_logged_in()                                                                                                                                     
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 56, in assert_logged_in                          
                                                       raise NotLoggedInError                                                                                                                                      
                                                   resources.lib.common.exceptions.NotLoggedInError                                                                                                                

2024-02-14 00:05:27.691 T:16772   error <general>: [plugin.video.netflix (0)] Traceback (most recent call last):                                                                                                   
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 163, in login                                    
                                                       headers={'Accept-Language': _get_accept_language_string(react_context)},                                                                                    
                                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                      
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 263, in _get_accept_language_string              
                                                       supported_locales = react_context['models']['loginContext']['data']['geo']['supportedLocales']                                                              
                                                                           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^                                                                                                 
                                                   KeyError: 'loginContext'                                                                                                                                        

2024-02-14 00:05:27.691 T:16772   error <general>: [plugin.video.netflix (0)] IPC callback raised exception: 'loginContext'                                                                                        
2024-02-14 00:05:27.693 T:16772   error <general>: [plugin.video.netflix (0)] Traceback (most recent call last):                                                                                                   
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 105, in handle_request                                        
                                                       ret_data = _call_func(func, pickle.loads(data))                                                                                                             
                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                             
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 164, in _call_func                                            
                                                       return func()                                                                                                                                               
                                                              ^^^^^^                                                                                                                                               
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper                                               
                                                       return func(*args, **kwargs)                                                                                                                                
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 163, in login
                                                       headers={'Accept-Language': _get_accept_language_string(react_context)},
                                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 263, in _get_accept_language_string
                                                       supported_locales = react_context['models']['loginContext']['data']['geo']['supportedLocales']
                                                                           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                                   KeyError: 'loginContext'

2024-02-14 00:05:27.700 T:16767   error <general>: [plugin.video.netflix (1)] Traceback (most recent call last):
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 90, in lazy_login_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 130, in route
                                                       _execute(nav_handler, pathitems[1:], G.REQUEST_PARAMS, root_handler)
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 159, in _execute
                                                       executor(pathitems=pathitems)
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/navigation/directory_utils.py", line 28, in set_custom_viewmode
                                                       override_content_type = func(*args, **kwargs)
                                                                               ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/navigation/directory.py", line 164, in video_list
                                                       dir_items, extra_data = common.make_call('get_video_list', call_args)
                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 94, in make_call
                                                       return make_http_call(endpoint, func_name, data)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 117, in make_http_call
                                                       raise _data
                                                   resources.lib.common.exceptions.NotLoggedInError

                                                   During handling of the above exception, another exception occurred:

                                                   Traceback (most recent call last):
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 29, in wrapper
                                                       func(*args, **kwargs)
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 265, in run
                                                       success = route(pathitems)
                                                                 ^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 97, in lazy_login_wrapper
                                                       if login(ask_credentials=not check_credentials()): 
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/api_requests.py", line 42, in login
                                                       if common.make_call('login', credentials):
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 94, in make_call
                                                       return make_http_call(endpoint, func_name, data)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/kodi/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 117, in make_http_call
                                                       raise _data
                                                   KeyError: 'loginContext'

This is with the fix in place, but the error seems similar when there was no fix in place (I didn't scrutinize thoroughly).

WildPenquin commented 4 months ago

I realized I'm having a different error than the email parsing error (loginContext error is not enough to determine for sure what is going on).

Deducing from the log and commit messages I realized I need the change from commit feb1351. After applying it I needed to relogin. I do not need the email fix.

HyknuF commented 4 months ago

@WildPenquin @MauriceW67

Just tried the change of the commit, and now it works for me as well. But i was forced to use authentication key. mail/password still didn't work. thanks for your help guys!

WildPenquin commented 4 months ago

I've never used email/pw login, and judging from the wiki it is discouraged (IIRC I may have tried it a few years ago and it didn't work even back then for me).

I suppose Netflix service is under some refactoring, and we need to wait until things settle down and a new release is made.

omalaspinas commented 4 months ago

Hello,

I'm having the same error and the email fix does not work. I really don't understand what is happening because even if I remove the raise statement after the check for the email the exact same error persists... In the logs

I'm using the .key authentification, and also tried to clear the pycache directories.

The code below without the if not mail to show the very weird error i get as you can see in the logs below. The error points to the commented code... Any ideas?

    email='aaa@bbb.com'
    # Verify the password (with parental control api)
        try:

The logs I have :

2024-02-15 08:41:52.736 T:835      info <general>: CActiveAESink::OpenSink - initialize sink
2024-02-15 08:41:52.736 T:835      info <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=vc4hdmi0,DEV=0"
2024-02-15 08:41:52.738 T:835      info <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=vc4hdmi0,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00"
2024-02-15 08:41:52.738 T:835      info <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2024-02-15 08:41:52.738 T:835      info <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE3
2024-02-15 08:41:52.986 T:3078    error <general>: GetDirectory - Error getting plugin://plugin.video.netflix/
2024-02-15 08:41:53.003 T:827     error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.netflix/) failed
2024-02-15 08:41:54.703 T:827      info <general>: Loading skin file: FileBrowser.xml, load type: KEEP_IN_MEMORY
2024-02-15 08:42:07.098 T:3129    error <general>: [plugin.video.netflix (0)] IPC callback raised exception: E-mail field not found
2024-02-15 08:42:07.100 T:3129    error <general>: [plugin.video.netflix (0)] Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 105, in handle_request
                                                       ret_data = _call_func(func, pickle.loads(data))
                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 161, in _call_func
                                                       return func(**data)
                                                              ^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py", line 129, in login_auth_data
                                                       # Verify the password (with parental control api)
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   resources.lib.common.exceptions.WebsiteParsingError: E-mail field not found

2024-02-15 08:42:07.101 T:2963    error <general>: [plugin.video.netflix (6)] Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 29, in wrapper
                                                       func(*args, **kwargs)
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 265, in run
                                                       success = route(pathitems)
                                                                 ^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 88, in lazy_login_wrapper
                                                       if G.REQUEST_PARAMS.get('ignore_login') or _check_valid_credentials():
                                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 73, in _check_valid_credentials
                                                       if not login():
                                                              ^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/utils/api_requests.py", line 49, in login
                                                       if password and common.make_call('login_auth_data', {'data': data, 'password': password}):
                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/utils/logging.py", line 139, in timing_wrapper
                                                       return func(*args, **kwargs)
                                                              ^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 94, in make_call
                                                       return make_http_call(endpoint, func_name, data)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/ipc.py", line 117, in make_http_call
                                                       raise _data
                                                   resources.lib.common.exceptions.WebsiteParsingError: E-mail field not found

2024-02-15 08:42:09.486 T:3110    error <general>: GetDirectory - Error getting plugin://plugin.video.netflix/
2024-02-15 08:42:09.503 T:827     error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.netflix/) failed
Konrades commented 4 months ago

As a workaround I temporarily changed line 127 in the access.py file from this: email = email_match.group(1).strip() if email_match else None to this: email = 'your e-mail address here'

Many thanks from me too. Netflix will be discontinued for my Sony Bravia TV at the end of February and so yesterday I have tried my Raspberry 3B (updated to Libreelec 11, Kodi 20) using the plugin and NFAuth key. Same error "email field not found" with German Netflix account - changing the access.py line 127 today was the solution. Thanks again!

maverickkk12 commented 4 months ago

Hola ¿me podriais explicar para un novato como llegar aqui? /.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/ tengo una tvbox tmax 95 Gracias

crocketear commented 4 months ago

Bonjour, Sur Libreelec depuis Raspberry, j'arrive bien à trouver le répertoire /.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/ et le fichier acces.py mais je ne sais pas comment le modifier. Je n'ai pas d'option pour cela : je peux le lire, le renommer, le supprimer mais pas le modifier. Merci de votre aide. PS : /.kodi n'apparait pas dans le répertoire storage depuis un PC connecté en réseau à kodi.

JungleJim42 commented 4 months ago

Hi Croketear! You must have admin privileges to modify this file. Try this command: sudo gedit /.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py You might have to change the "gedit" part depending on your text editor.

I can also confirm that the "access.py" modification resolved the problem for me (using the access token). On Ubuntu 22.04.

theoden11 commented 4 months ago

Bonsoir. La manip de modif du fichier access.py, même après purge des caches, ne fonctionne pas. L'erreur "login context" reste identique, tant sur Kodi sous Windows 11 que sous Librelec installé sur une machine de salon autre que Raspberry. Dsl.

Lsantag commented 4 months ago

Does anyone know how to find and edit the access.py file in firestick 4k?

kodi 19.5 Spanish . firetvstick 4k like yours Vicento00 Close kodi. You need some (good) file manager for firetv. I installed free "x-plore" app from amazon store. It has ftp and smb support* ("lan, ad server,scan" ). xplore "show hidden " (important). Found access.py -->

/storage/emulated/0/Android/data/org.xbmc.Kodi/files/.Kodi/addons/plugin.video.netflix/resources/access.py (it´s a 12kb file)

X-plore let you open the file "as text" and even edit it. BUT, I wasn´t able to (no keyboard, no idea how to do it).

So, I *copied original access.py to a seagate lan disk (any other smb or usb will be ok) and edit it in mi mac. Copy the edited file to smb disk again. And overwrite original using x-plore . (by the way I used smb disk to store generated NFAuthenticationKey.py too ). Nothing else . it works. sorry for my english.

jgavirias13 commented 4 months ago

Steps worked for me:

  1. Connect to your Kodi server using ssh
  2. Go to ~/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/access.py
  3. Edit the file (you can use gedit, nano, vi or the editor you have on your server)
  4. Change the line 127 to: email = 'example@example.com'
  5. Save the file and exit the editor
  6. Remove the content of ~/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/session/pycache/
  7. Restart your kodi instance
  8. Try to login again on netflix add-on using NFAuthenticationKey