Warning: although the set of instructions following below in this post does produce a working result, it is explicitly not recommended by the author of the Netflix plugin, @
CastagnaIT . I leave it here for the sake of documentation and providing additional help, should the officially recommended manual not work for some reason on your QNAP system.
But if you want to do it the right way, please follow the revised instructions outlined in this permanent post:
https://forum.kodi.tv/showthread.php?tid...pid2975994
Old and outdated text starting here:
Just for the sake of completion and to help other people struggling with the installation of the Netflix plugin for KODI 18 on their QNAP, here is the set of instructions how to get there.
I start with the assumption that you managed to install HD Station on your QNAP and then install KODI 18 by adding the QNAP Club repository in your App Center. I also assume that you're capable of logging into your QNAP as admin using telnet or ssh.
This breakthrough was only possible, because @
thomas.rehberg gave me the crucial hint that HD Station is a chroot subsystem based on Ubutun 18.04 residing within QTS.
Since QNAP is updating their Firmware very frequently (with all the advantages and disadvantages), this manual is only guaranteed to work for QTS 4.4.3 running HD Station 4.0.10 and KODI 18.0.0.5.
Chances are good that it might work with older or newer releases, but for example KODI 19 is a completely different animal since it is based on Python3 (while KODI 18 still runs ons Python 2.7).
The following instructions also assume that the HD Station’s chroot is based in the same folder as it is the case on my QNAP (which was the standard path after installing HD Station through the App Center):
/share/CACHEDEV1_DATA/.qpkg/HD_Station
It might be in a different folder in your case (I am running a TBS-453DX with a single 1TB SSD from WD RED SA500). During my googling sessions I’ve seen instructions and logfiles based on the premise of the HD Station folder being located for example here:
/share/MD0_DATA/.qpkg/HD_Station
So maybe check first, if you can cd or ls your way into the folder
/share/CACHEDEV1_DATA/.qpkg/HD_Station
and if that fails, try to find out where your HD Station is located instead in your QTS.
Now come the steps to install the Crypto package to your HD Station that took me quite some time to figure out:
Log into QNAP command line interface (via ssh or telnet) as admin and then execute the following commands:
chroot /share/CACHEDEV1_DATA/.qpkg/HD_Station
Now you’re located in the HD Station sub-environment as root, which is basically an Ubutunu 18.04 within QNAP’s QTS and gives you access to the usual commands and package managers like apt, pip etc. and now you can easily execute what CastagnaIT has suggested (which you cannot when just logging into your QNAP as admin, because there isn't even a package manager available). In case you’re not very familiar with Linux (like I am), here are the Baby steps
apt update (to update the dependencies and repositories in your system)
apt upgrade (
you can - and probably should! - skip that command, because it updates everything in your local Ubuntu 18.04 environment, which takes some time. Since I was already frustrated and didn’t care much anymore, I did it nonetheless and couldn’t see any bad consequences (or any difference to be honest except a newer version of the Chrome browser) later when using HD station. I uninstalled HD Station some time later and re-installed it and skipped the apt upgrade and everything worked fine as well. So run this command at your own risk and if in doubt, just skip it.
apt install build-essential
apt install python-dev
apt install python-pip
apt install python-setuptools
often a message like "python-dev is already the newest version" will be the result. Which is fine, because most packages are probably already included and up to date on your HD Station.
Now comes the most important command installing the missing Crypto library on your system:
pip install --user pycryptodomex
So now you might think you’re done. And there is nothing wrong with giving KODI another try before continuing these instructions. In my case though the Netflix plugin still produced an error popup and the same error text (No module named 'Cryptodome') persisted in the logfile. 😱
But again my hours of googling had produced some ideas, which I explored and step by step brought me closer to my goal.
In my case, the pycryptodomex package had only created a folder called “Crypto” in /usr/lib…
But as
someone else had already found out, the system seems to expect the library in the folder Cryptodome instead. So I added a symbolic link using the following command:
ln -s /usr/lib/python2.7/dist-packages/Crypto /usr/lib/python2.7/dist-packages/Cryptodome
(That basically just kind of mirrors the content of /Crypto to a virtual folder called /Cryptodome in the same directory).
So I gave KODI another try. And still got greeted by the “Netflix plugin failed” message. 🤪
I checked out the extended error logfile of KODI again and this time the error message had changed from “No module named 'Cryptodome'” to “Error Contents: cannot import name Padding”
Ahhh… something new to research. First I thought, installing the Padding package might solve this issue. The command for this is the following (but the installation probably isn't necessary, because it didn't really help and another step was necessary to resolve the situation. But just in case the following step should not work on its own, I leave this command in this description):
pip install Padding
But of course the error message persisted. 🙄
So again another post in
the github thread mentioned before came to my rescue. This time in the form of this solution:
The installed Cryptodome(x) module for 2.7 does not ship with the Padding.py module. Therefore, download it manually from
https://raw.githubusercontent.com/dlitz/...Padding.py into the folder
/usr/lib/python2.7/dist-packages/Crypto/Util
(You can test from the Python prompt (invoked by executing the command python in your command line) whether "from Crypto.Util import Padding" works. But you can also skip this step).
Being lazy, I installed the Padding.py file by starting Chrome on my HD Station, surfing
to this post on github and clicking on the download link provided and then saving the Padding.py file to the location provided above.
Then of course I remembered that I need to save the Padding.py file to the chroot location of the HD Station instead. And tried to save the Padding.py a 2nd time to this location:
/share/CACHEDEV1_DATA/.qpkg/HD_Station/usr/lib/python2.7/dist-packages/Crypto/Util
Funny enough, there was already the file Padding.py to be found in that location with a file date of a few minutes before. So I guess parts of the QTS environment are mirrored to the HD Station Ubuntu environment and I had been too prescient for the first time in my odyssey to get the Netflix plugin running on my QNAP.
Anyhow, after starting KODI again, the Netflix plugin behaved for the first time like it did after installing it on my Anroid TV and on my Linux station.
I did not have any troubles logging into Netflix using my email address and password. So I did not need the new alternative login method.
After accessing the first video on Netflix, KODI asked me “Would you like to enable inputstream.adaptive?”. After accepting to enable it, KODI also asked me to install something called “Widevine”, which after accepting that, happened fortunately fully automatically. And as a result everything works now.
The only thing that is annoying: Netflix treats the KODI plugin like the Netflix App on Android TV. As a result streaming content from other countries by using a VPN to obtain a US based IP address is blocked with a specific error message.
So while you can use a VPN connection to watch Netflix series limited to other countries on your Kindle or Laptop, QNAP does not seem to be a solution. At least not for VPNs that have been already identified as VPN IPs by the Netflix service servers. So either switch to a different provider (which would then probably also work directly on your Smart TV) or switch to a regular Windows based Laptop.
And no, running Windows 7 or Windows 10 in a virtual machine on your QNAP is not a working solution. At least not on a TBS-453DX with a Celeron J4115 processor and similar NAS systems. Because the virtualization layer eats up too much of the processor power to provide a smooth video playback. You may be lucky on a stronger QNAP NAS.