RPi streaming station with Amazon Instant Video and Netflix

With Kodi 18 and inputstream, we can finally use DRM protected streams like used by Amazon and Netflix!

Get Kodi 18

First install OSMC on your rpi2 or rpi3 (those addons will not work on rpi1 or zero). You will need to purchase license keys for high-quality video streams and add them to your /boot/config.txt.

Log in via ssh and update your system

~$ sudo apt-get update && sudo apt-get dist-upgrade

Most likely you are on Kodi version 17 (how to check?). We need Kodi 18 to work properly with Netflix and Amazon Instant Video, since from this version DRM and input stream are properly supported.

If you are still on version 17, add this line to /etc/apt/sources.list to install the Kodi 18 test builds for OSMC.

deb http://download.osmc.tv/dev/gmc-18 ./

Make sure you backup your system before proceeding. Check here for the necessary steps to upgrade. Reboot after the process has finished. You should be now on Kodi 18. Download now the repository zip-files for the Netflix Addon by asciidisco and the Instant Video Addon by Sandmann79.

~$ wget https://github.com/Sandmann79/xbmc/releases/download/v1.0.2/repository.sandmann79.plugins-1.0.2.zip
~$ wget 
https://github.com/kodinerds/repo/raw/master/repository.netflix/repository.netflix-1.0.1.zip

and go to Settings -> Addons -> Install from zip file. After that you can install the two video addons from their respective repositories.

Amazon Instant Video

Setup the Amazon-Addon by choosing “Playback with” as “Input Stream” and adding your login data in “Connection”.  Within the Inputstream Settings set the streaming quality to “1080p” instead of “Max”. The Addon may be unresponsible at first, since there will be a database created that takes a lot of computing power. If it crashes, try again after rebooting.

Netflix

For Netflix to work, we have to add some crypto-package (pycryptodomex) that should usually be installable with python-pip. However this did not work for me, so I fumbled a bit, to add the dependency differently. But maybe they fixed this issue now. Just open the kodi log in you SSH session

~$ tail -f /home/osmc/.kodi/temp/kodi.log

and run the addon (you will have to add an account first). If everything is fine, enjoy. If on the other hand a python error is logged that tells you something about a not found Cryptodome, proceed as follows. First, we install the general crypto-package:

~$ sudo apt-get install python-crypto

Somehow the Padding.py file is requested by the Netflix-Addon, but is not installed by python-crypto, so we add it manually:

~$ wget https://pypi.python.org/packages/d6/99/56ac930e35394c93440f1a6e254cf4573098503ff4c1851e820600a46a85/pycryptodomex-3.4.7.tar.gz
~$ tar -xvf pycryptodomex-3.4.7.tar.gz
~$ sudo cp pycryptodomex-3.4.7/lib/Crypto/Util/Padding.py /usr/lib/python2.7/dist-packages/Crypto/Util/

At the end, we create a symbolic link “Cryptodome” because the files are expected to be there:
~$ sudo ln -s /usr/lib/python2.7/dist-packages/Crypto /usr/lib/python2.7/dist-packages/Cryptodome

You should now got rid of errors and your Netflix addon yould be able to set your account data and watch the content.

Enjoy!

Advertisements
About

Peter Pan. Kann fliegen mit Feenstaub.

Tagged with: , , ,
Posted in Raspberry Pi
10 comments on “RPi streaming station with Amazon Instant Video and Netflix
  1. […] ja früher schon über meine Liebe zum Music Player Daemon, mein Command-Keypad und jüngst über Netflix & Amazon Instant Video Addons berichtet. Ein weiterer Baustein ist die Funktionalität als HDTV Streaming Plattform.  Mein […]

  2. laclaro says:

    I just noticed, that the two repositories are also included in the kodinerds repository, so you can also add that one from zip (e.g. 1.1.9) as a starting point.
    https://github.com/kodinerds/repo/tree/master/repository.kodinerds

  3. Anonymous says:

    Hi
    I always have a netflix error.

    maybe you know how to solve this.,

    see log

    from resources.lib.KodiHelper import KodiHelper
    File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/KodiHelper.py”, line 13, in
    from Cryptodome import Random
    File “/usr/lib/python2.7/dist-packages/Cryptodome/Random/__init__.py”, line 28, in
    from Crypto.Random import OSRNG
    ImportError: cannot import name OSRNG
    –>End of Python script error report<–
    18:21:37.461 T:1957359616 ERROR: GetDirectory – Error getting plugin://plugin.video.netflix/
    18:21:37.464 T:1957359616 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.netflix/) failed
    18:23:08.691 T:1957359616 NOTICE: Samba is idle. Closing the remaining connections

    thanks

    • Anonymous says:

      some more details in the log.
      this might help to analyze the problem:

      12:20:28.841 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: loading setting definitions
      12:20:28.841 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: trying to load setting definitions from old format…
      12:20:28.847 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: loading setting values
      12:20:28.925 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: loading setting definitions
      12:20:28.926 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: trying to load setting definitions from old format…
      12:20:28.934 T:1122427888 DEBUG: CAddonSettings[plugin.video.netflix]: loading setting values
      12:20:28.978 T:1122427888 ERROR: EXCEPTION Thrown (PythonToCppException) : –>Python callback/script returned the following error<–
      Error Type:
      Error Contents:
      File “/home/osmc/.kodi/addons/plugin.video.netflix/addon.py”, line 42, in
      File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/utils.py”, line 45, in wrapped
      File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py”, line 85, in router
      File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/utils.py”, line 45, in wrapped
      File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py”, line 708, in before_routing_action
      File “/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py”, line 883, in call_netflix_service
      raise URLError(err)
      URLError:
      –>End of Python script error report<–
      12:20:29.067 T:1957122048 ERROR: GetDirectory – Error getting plugin://plugin.video.netflix/
      12:20:29.073 T:1957122048 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.netflix/) failed

      thanks T

  4. laclaro says:

    Seems that you are missing a component in the Python Crypto package (OSRNG). Were you able to resolve the issue? Which system are you running on? Upgrading system and netflix Addon might also help.
    Did you check https://github.com/asciidisco/plugin.video.netflix/issues?

    Best regards

    Henning

  5. Hi, justed tried this. I’m using a Kodi 18 Build of libreelec and the playback stutters, but I didnt buy the license keys yet. Will the playback be improved if i buy the keys?

  6. Robert Spierenburg says:

    I have it all installed and it seems to almost work, except when I play a movie it just plays a garbage green screen with some audio behind it.

    • Robert Spierenburg says:

      So it seems it has something to do with omxplayer. If I disable it in Player Settings then I can see video but it stutters like crazy as it is using SW decoding. Anyone else have this issue?

      • wessi2912 says:

        You need to purchase the license keys like mentioned in the tutorial…

      • Robert Spierenburg says:

        I had already purchased both of the keys. All other videos play without any issues, just not Netflix. Do you know if perhaps the addon is only valid in some countries? I’m in Canada.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Posts by topic…
…by month
Have a look at…


%d bloggers like this: