Code Monkey home page Code Monkey logo

Comments (11)

arvvoid avatar arvvoid commented on May 28, 2024

Hello, thanks for pointing it out. What version of Debian are you referring too? The last time i tested the commands were working with no issues on an OSMC/Raspbian system.

Also pycryptodome and pycryptodomex are 2 different packages.

pycryptodome can be considered a drop-in replacement when migrating from PyCrypto to PyCryptodome.

pycryptodomex is a standalone version of PyCryptodome with a different naming convention; instead of the package Crypto, you have to use Cryptodome. In the case that PyCrypto is required for legacy purposes, pycryptodome should be used.

The add-on uses pycryptodomex, on other platforms is usually available by default or in form of a Kodi script.module available in the official repo.
On Linux systems have to be installed manually, and the procedure and packeges involved can change slightly from distribution to distribution.

from plugin.video.hbogoeu.

arvvoid avatar arvvoid commented on May 28, 2024

In the current install instructions pip is used to install the most recent version of pycyptodomex https://pypi.org/project/pycryptodomex/ , https://pycryptodome.readthedocs.io/en/latest/src/installation.html

from plugin.video.hbogoeu.

atleta avatar atleta commented on May 28, 2024

Hi,

What version of Debian are you referring too? The last time i tested the commands were working with no issues on an OSMC/Raspbian system.

It's a new installation of OSMC, /etc/debian_version says it's 9.9. Also, the package names (python-*) seem pretty consistent with the debian naming conventions, so I'm surprised that your version worked even if on an earlier or newer (unstable/testing?) distro.

On Linux systems have to be installed manually, and the procedure and packeges involved can change slightly from distribution to distribution.

Well, then I don't know if python-pycryptodome is needed (didn't pay attention whether the -ex version was mentioned as an additional requirement being installed on the GUI), but for sure debian doesn't have a package named pycryptodomex and it does have python-pycryptodome. BTW, I don't know too much about the kodi internals, but in general, whenever something is available on PyPI (i.e. installable through pip) it's always better to use that instead of the OS package. Exactly because then you don't have to worry about OS dependent packages (of unknown versions). But even though your install instructions say to install pip, I'm not sure where/when it gets used. (And it's surprising that kodi doesn't make use of it by default.)

Now I've looked into your addon.xml, tried to figure out what these imports mean and also checked out what modules got pip installed. Your addon.xml mentions script.module.pycryptodome v3.4.3 . As far as I can understand, this should come from here: https://github.com/xbmc/repo-scripts/tree/gotham . But it's not there. Also, pip freeze says pycryptodomex==3.6.1 is installed, but (according to dpkg -L) it comes from the python-pycryptodome package. So indeed it seems that

from plugin.video.hbogoeu.

atleta avatar atleta commented on May 28, 2024

In the current install instructions pip is used to install the most recent version of pycyptodomex

I'm sorry I've missed this message. My report is about the apt install instructions in the readme file. You're right, it also does mention that "script.module.pycryptodome 3.4.3+ (should get installed automatically in Kodi 18)", which may mean that the python-pycryptodome (deb) package is not needed at all, but still the instructions in the install section are wrong. (I've just installed it on a second OSMC installation without doing any of the apt installs, but can't fully test it yet as I don't have enough space now to install the widevine thing.

from plugin.video.hbogoeu.

arvvoid avatar arvvoid commented on May 28, 2024

Hello, is entirely possible that on newer OSMC pycryptodomex is preinstalled by default like in LibereElec, CoreElec ecc...
Not sure what python-pycryptodome install (if it actually install the standalone pycryptodomex then doing just apt install python-pycryptodome is enough all the rest is not necessary), according to pycryptodomex documentation pycryptodome is a drop-in replacement for pycrypto while pycryptodomex is a standalone package that don't replace the original pycrypto (less chance do brake stuff that uses pycrypto).

My install instructions use pip not apt to install pycryptodomex i just install the prerequisites via apt to be able to install/compile pycryptodomex via pip.

sudo apt update
sudo apt install python-pip
sudo apt install python-setuptools
sudo apt install build-essential
sudo pip install wheel   #NOTE INSTALLED VIA PIP NOT APT
sudo pip install pycryptodomex #NOTE INSTALLED VIA PIP NOT APT
sudo apt install libnss3 libnspr4    #these are probably already installed on newer systems, used by libwidevine
sudo reboot

The current install instructions worked so far for all users i had contact with missing pycryptodomex on osmc/rapbian/debian (older and newer versions).
But i'm going to remove that section from install instructions, now the add-on will tell the user if pycryptodomex is missing when run, and inform the user of the need to install it manually to use the add-on.
I will move the pycryptodomex install instruction to a dedicated wiki page.
So the user first try to run the add-on witch will run out of the box in most cases, and bother with pycryptodomex only if really needed.

from plugin.video.hbogoeu.

atleta avatar atleta commented on May 28, 2024

Hi,

Ah, sorry, didn't realize that there were two pip install commands buried in the middle :). First I just pasted the above section as is (without the reboot) and it failed. I haven't even read the error message because I knew that the package names were incorrect for apt (but didn't realize that they would be installed with pip). But even then adding all packages into a single apt install call will make things simpler as then apt will only resolve the dependencies once and ask for permission to install these once. Also, wheel and setuptools are dependencies of pip in debian (indeed, pip, debian or not, doesn't work without setuptools), so trying to install them separately won't do anything.

But you're right, I've just checked and the python-pycryptodome package seems to be absent in Raspbian. However, if you do install through pip, I'd suggest you specify and exact version that you do know is working (e.g. you have 3.4.x in your addon.xml, so that would be a good candidate) as otherwise pip will just pull the newest version and that may or may not work with the plugin.

is entirely possible that on newer OSMC pycryptodomex is preinstalled by default

No, it's not. (I've double checked it)

Not sure what python-pycryptodome install

I've checked and it seems to be pycryptodomex 3.6.1 (in case of current OSMC).

from plugin.video.hbogoeu.

arvvoid avatar arvvoid commented on May 28, 2024

No problem happens, I was also reading and answering in a hurry.
All versions from 3.4.3 onward are ok and will work, there is no problem with always installing the latest pycryptodomex the exposed functions should not change, at least what the add-on uses to encrypt the credentials and session data stored on disk should not break with any future updates to the library.

I will try to make the commands more clear.

Then on OSMC apt install python-pycryptodome is all thats needed to make it work :)

from plugin.video.hbogoeu.

atleta avatar atleta commented on May 28, 2024

Then on OSMC apt install python-pycryptodome is all thats needed to make it work :)

I've just finished installing it on a second OSMC installation and I found that indeed python-pycryptodome is not available in the default debian repos used by OSMC. (They use version 9.x/stretch and it became available in v10/buster. Though it's backported to stretch, most people won't have the backports enabled, as it's not added by default.) I don't know what failed on my first attempt, but trying to do a minimal installation on this one confirms that the instructions are correct.

So my comment on the install instruction then is that all the deb package installs could be done with a single apt install call, which looks simpler and results in only one confirmation prompt instead of 4. (You could also install python-wheel via apt instead of pip, but doesn't make much of a difference.) And you don't need the reboot.

from plugin.video.hbogoeu.

arvvoid avatar arvvoid commented on May 28, 2024

Thanks for taking the time to test this.

This are the new install instructions:

  • Download repository.arvvoid-1.0.0.zip and use the install add-on from zip function in Kodi
  • Install the add-on from repository "Kodi ArvVoid Repository"
  • Follow the setup wizard at first add-on run
  • OPTIONAL: Configure additional preferences in the add-on config
  • The Add-on should download the inputstreamhelper Add-on which will handle all the DRM install for you if needed
  • OPTIONAL: On OSMC/Raspbian/Debian/Ubuntu/other Debian derivates you might have to install some dependency manually from shell, but first try to run the add-on, if you get a message informing you that pycryptodomex is missing perform this steps (or consult specific pycryptodomex install instructions for your distribution/platform):
sudo apt update
sudo apt install build-essential python-setuptools python-pip
sudo pip install wheel pycryptodomex

Some libwidevine dependencies on linux (most likely already installed):

sudo apt install libnss3 libnspr4

EDIT:
Actually no need to complicate will simply go with

sudo apt update
sudo apt install build-essential python-setuptools python-pip libnss3 libnspr4
sudo pip install wheel pycryptodomex

from plugin.video.hbogoeu.

arvvoid avatar arvvoid commented on May 28, 2024

@all-contributors please add @atleta for ideas

from plugin.video.hbogoeu.

allcontributors avatar allcontributors commented on May 28, 2024

@arvvoid

I've put up a pull request to add @atleta! 🎉

from plugin.video.hbogoeu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.