CastagnaIT / plugin.video.netflix

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

Plugin won't open - error is missing crypto module #1702

Closed bmentink closed 2 weeks ago

bmentink commented 4 weeks ago

Netflix add-on version

latest

Operative systems used

Raspbian

Kodi version used

Kodi 18 (Leia)

Description of the bug

Asin the title, it needs this module, but does not say where to install it from

Steps to reproduce the behavior

  1. Install plugin.
  2. Open plugin - got error

Debug log - mandatory

asdasdasd

Possible fix

no

Additional context

no

Screenshots

No response

bmentink commented 4 weeks ago

I tried adding module pycryptodomex, but I get this:

sudo pip3 install pycryptodomex
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

I am on Raspian rpi and actually I am on the latest Kodi 21

bmentink commented 3 weeks ago

This is the error in the log file:

2024-06-08 16:37:23.785 T:1202    error <general>: [plugin.video.netflix (0)] Background services do not start due to the following error
2024-06-08 16:37:23.799 T:1202    error <general>: [plugin.video.netflix (0)] Traceback (most recent call last):
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/default_crypto.py", line 16, in <module>
                                                       from Cryptodome.Hash import HMAC, SHA256
                                                   ModuleNotFoundError: No module named 'Cryptodome'

                                                   During handling of the above exception, another exception occurred:

                                                   Traceback (most recent call last):
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/run_service.py", line 38, in init_servers
                                                       self.nf_server_instance = NFThreadedTCPServer((self.HOST_ADDRESS, select_port('NF_SERVER')))
                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 68, in __init__
                                                       self.netflix_session = NetflixSession()
                                                                              ^^^^^^^^^^^^^^^^
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/nfsession.py", line 28, in __init__
                                                       self.msl_handler = MSLHandler(self.nfsession)
                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_handler.py", line 47, in __init__
                                                       self._init_msl_handler()
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_handler.py", line 62, in _init_msl_handler
                                                       self.msl_requests = MSLRequests(msl_data, self.nfsession)
                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_requests.py", line 42, in __init__
                                                       super().__init__(nfsession)
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_request_builder.py", line 38, in __init__
                                                       from .default_crypto import DefaultMSLCrypto as MSLCrypto
                                                     File "/home/bmentink/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/default_crypto.py", line 22, in <module>
                                                       from Crypto.Hash import HMAC, SHA256
                                                   ModuleNotFoundError: No module named 'Crypto'

2024-06-08
bmentink commented 3 weeks ago

Ok, I have got a little further. I upgraded everything, now I get the plugin wanting the authentification key, as It won't accept email/password anymore. I read the readme on this site, but have issues installing the pip packages, i.e:

pip install pycryptodomex (or pip3)
pip install websocket-client (or pip3)

I get the following error and none of the suggestions work:

pip3 install websocket-client
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>
bmentink commented 3 weeks ago

SO I found away to install the required files, See here: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3


...  but now I have this error with NFAuthenticationKey.py

python3 NFAuthenticationKey.py

NFAuthentication Key for Linux/MacOS (Version 1.1.8)

Disclaimer:
This script and source code available on GitHub are provided "as is" without warranty of any kind, either express or implied. Use at your own risk. The use of the software is done at your own discretion and risk with the agreement that you will be solely responsible for any damage resulting from such activities and you are solely responsible for adequate data protection.

Press "ENTER" key to accept the disclaimer and start, or "CTRL+C" to cancel
Browser startup... (/Applications/Brave Browser.app/Contents/MacOS/Brave Browser) please wait
Establish connection with the browser... please wait
Opening login webpage... please wait
Please login in to website now ...waiting for you to finish...
No event data received from browser

I logged into Netfix fine in Brave ..

bmentink commented 3 weeks ago

Ok, after logging in 3 times, it finally produced the key file and a pin. Plugging that into netflix plugin got me a working system ....

I hope this helps someone else.

deathplaybanjo commented 3 weeks ago

while it didnt actually help me, i was also setting up netflix add-on on my raspad tonight.

bmentink commented 3 weeks ago

So if it did not help you, what is your point?

On Sun, 9 Jun 2024, 2:24 pm deathplaybanjo, @.***> wrote:

while it didnt actually help me, i was also setting up netflix add-on on my raspad tonight.

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

kfu02 commented 1 week ago

I am also having this issue!

kfu02 commented 1 week ago

https://github.com/CastagnaIT/plugin.video.netflix/issues/1294#issuecomment-1586997485

This fixed it for me