Closed lu-po82 closed 5 months ago
This is a common issue since recent Netflix password sharing crackdown. There are a few similar closed issues on this repo (e.g. #1615). @CastagnaIT commented that there isn't much that can be reliably done, unfortunately.
That being said I've found a workaround that may or may not work for you. It requires modifying the auth key generator, but I'll share it anyway.
I've noticed that I can login and watch videos in Chrome without a problem, and I stay logged in for a very long time even when inactive. But when I generate auth key from the same browser I can login to my profile in Kodi but get logged out as soon as I attempt to play a video.
Currently auth script starts incognito chrome process with a disposable profile that is completely removed after the key is generated. I've modified it to use existing cookies from my main profile. If I play a video first in browser and then in Kodi it just works. And I only had to do it once, so far I'm still logged in.
Of course this might stop working at any point. If this happen to work for most people with this issue this workaround could become a command line option. Additionally I'm not sure about security ramifications. Here's my hack of the original script:
diff --git a/NFAuthenticationKey.py b/NFAuthenticationKey.py
index 9265ea2..4eb24d5 100644
--- a/NFAuthenticationKey.py
+++ b/NFAuthenticationKey.py
@@ -47,7 +47,7 @@ class Main(object):
_msg_id = 0
_ws = None
- def __init__(self, browser_temp_path):
+ def __init__(self):
show_msg('')
show_msg(TextFormat.BOLD + 'NFAuthentication Key for Linux/MacOS (Version {})'.format(self.app_version),
TextFormat.COL_LIGHT_BLUE)
@@ -59,18 +59,14 @@ class Main(object):
browser_proc = None
try:
input_msg('Press "ENTER" key to accept the disclaimer and start, or "CTRL+C" to cancel', TextFormat.BOLD)
- browser_proc = open_browser(browser_temp_path)
+ browser_proc = open_browser()
self.operations()
except Warning as exc:
show_msg(str(exc), TextFormat.COL_LIGHT_RED)
- if browser_proc:
- browser_proc.terminate()
except Exception as exc:
show_msg('An error is occurred:\r\n' + str(exc), TextFormat.COL_LIGHT_RED)
import traceback
show_msg(traceback.format_exc())
- if browser_proc:
- browser_proc.terminate()
finally:
try:
if self._ws:
@@ -88,12 +84,6 @@ class Main(object):
self.ws_wait_event('Page.domContentEventFired') # Wait loading DOM (document.onDOMContentLoaded event)
- show_msg('Please login in to website now ...waiting for you to finish...', TextFormat.COL_LIGHT_BLUE)
- if not self.wait_user_logged():
- raise Warning('You have exceeded the time available for the login. Restart the operations.')
-
- self.ws_wait_event('Page.domContentEventFired') # Wait loading DOM (document.onDOMContentLoaded event)
-
# Verify that falcorCache data exist, this data exist only when logged
show_msg('Verification of data in progress... please wait')
html_page = self.ws_request('Runtime.evaluate', {'expression': 'document.documentElement.outerHTML'})['result']['value']
@@ -131,8 +121,6 @@ class Main(object):
}
# Save the "NFAuthentication.key" file
save_data(data, pin)
- # Close the browser
- self.ws_request('Browser.close')
show_msg('Operations completed!\r\nThe "NFAuthentication.key" file has been saved in current folder.\r\nYour PIN protection is: {}'.format(pin),
TextFormat.COL_BLUE)
@@ -214,13 +202,9 @@ class TextFormat:
END = '\033[0m'
-def open_browser(browser_temp_path):
- params = ['--incognito',
- '--user-data-dir={}'.format(browser_temp_path),
- '--remote-debugging-port={}'.format(DEBUG_PORT),
- '--remote-allow-origins=*',
- '--no-first-run',
- '--no-default-browser-check']
+def open_browser():
+ params = ['--remote-debugging-port={}'.format(DEBUG_PORT),
+ '--remote-allow-origins=*',]
dev_null = open(os.devnull, 'wb')
try:
browser_path = get_browser_path()
@@ -303,9 +287,8 @@ def input_msg(text, text_format=None):
if __name__ == '__main__':
- temp_path = tempfile.mkdtemp()
try:
- Main(temp_path)
+ Main()
except KeyboardInterrupt:
show_msg('\r\nOperations cancelled')
finally:
Thanks @slukovic ! I had to tweak the script a bit from your change too as it was not navigating to Netflix:
Just tried this... But still I'm getting kicked out 🤕
I'm not sure about the "kicked out" yet, but the creation of the authentication key worked with an adjusted version of @slukovic's patch for me, also on Win32 (see attachment below for a download; @CastagnaIT feel free to include any of those changes):
chrome
as a binary nameTo use that:
pip3 install pycryptodomex websocket-client
python3 NFAuthenticationKey.py
I added a script for firefox see https://github.com/CastagnaIT/plugin.video.netflix/discussions/1632
This is a super plugin, great work!
@GitMensch thanks for your input, I was indeed able to get the key there (as I could with firefox script too), but once I log in I get logged out (as per #1615).
Is there way to get the NFAuthentication.key without a laptop?
interesting solution https://github.com/CastagnaIT/plugin.video.netflix/discussions/1632 But i prefer to have a common solution for only supported browsers
Netflix add-on version
1.18.8+matrix.1
Operative systems used
Android
Kodi version used
Kodi 19 (Matrix)
Description of the bug
Hi,
I followed the instructions on this page https://github.com/CastagnaIT/plugin.video.netflix/wiki/Login-with-Authentication-key to create a NFAuthentication.key and the PIN. I did this several times since it happened that Netflix required again the authentication. However, this time after having added the PIN and the password the Netflix add-on confirmed I did log in successfully, but when I chose a video from the list it showed a message error saying more or less this "MSLError; username or password uncorrected. More info in the log".
I use KODI on MoGo Pro projector.
Any help? ;-)
Steps to reproduce the behavior
No response
Debug log - mandatory
no log created when i look for it
Possible fix
No response
Additional context
No response
Screenshots
No response