Wednesday 27 December 2017

Watching Amazon Prime using a Raspberry Pi & KODI


updated 29 Deccember 2019

Fed up having to slog my laptop to the living room to watch Amazon PrimeVideo, I pressed a spare Raspberry Pi into service.
The most recent release of the open source multimedia centre, libreElec Kodi 18, for RPi has the required streaming service and Amazon Add-on which once again allows Amazon Prime (and many others) to run perfectly.

With great thanks to Sandmann79 & Varstahl who build this Add-on.

I will show here how to do a complete new, clean install from scratch, using a windows10 PC to download and install the libreELEC Kodi media center for the Raspberry Pi. I use a Raspi 3.

This install was originally done on in December 2017, but requires the occasional update if/when Amazon changes (regularly) their settings or something. About once a year I just do a completely fresh install just to keep up with the changes.
My latest, completely fresh, install is now 29th December 2019 (LibreElec 9.2.0,  Kodi 18.5 compiled 2019-11-23). 



15 April 2019: Amazon incorporated a major security update earlier this month, requiring build-in encryption chips, which does not work with Kodi in HD. However, it will still play Standard Definition (960x540). If you had Kodi installed I recommend a complete fresh update, as the new version also includes automatic updates.
This large update of the blog now also includes a much much simpler way to install the add-ons, using directly accessible repositories and no longer needs remote access to the Pi.
For those interested, here is the old (manual, no longer working) setup.

Updates: 

Amazon regularly changes things, some break this setup. SO... If you find the player not working for whatever reason, it can usually be fixed by updating to the latest LibreELEC, Kodi and Prime Addon. 


NOTES
  1. Available in all countries where Amazon PrimeVideo is available (since version 0.5.0).
  2. Doing this installation from an Mac or Linux shouldn't be much different, but you'll have to work out your own details. Afraid I can't help there.
  3. This install turns your RPi into a dedicated KODI system, so you won't be using it for anything else (to install KODI on a general purpose RPi, see this KODI how-to)
  4. Disclaimer: It is your responsibility to comply within your locations legal requirements for streaming content.
You need
  • one Raspberry Pi, version 2 or 3,
  • micro-SD card, at least 8Mb
    • after the install you need to have 2+ Gb left for the widevine decoder extraction to happen.
  • HDMI cable (to connect Raspberry to your TV or monitor) ,
  • PC to download files and load to SD card, and
  • a valid, working Amazon Prime account
    • this is not a free-to-view hack
    • should work in all countries where AmazonPrime Video is available.

Steps: 

1. Download and install LibreELEC for Raspberry pi

On your PC 

Go to https://libreelec.tv/downloads/ and go to the downloads_new pages. (i'm leaving it like this in case the 'downloads_new' becomes the normal).
  • Download the libreELEC USB-SD Creator app, and open it.

libreELEC USB-SD Creator
  •  In (1) select your version: I am using a Raspberry Pi 3 so selected version 'Raspberry Pi 2 and 3'
  • In (2) select 'Download' button and a window pops up where you select your directory where you want the file to go. Once you select the folder, the Creator will immediately download the file and you should see it in the bar
 
  • If not already done, connect your Raspberry's microSD card to your PC (you may need a MicroSD to USB converter).
  • In (3) select your microSD card location (in my case E:\)
  • In (4) hit Write, and sit back.

  • When the write is complete, close the Creator, and eject your SD card. 

2. Raspberry Pi  KODI Setup

On your Raspberry Pi

  • Insert the SD card into your Raspberry Pi.
  • Hook up RPi to your TV  (or monitor)
  • Hook up a keyboard (and mouse) to your Raspberry: this is for this installation only, although might be handy later also.
  • Fire up your Raspberry.  You should now see the libreELEC setup screen. 
  • Hit 'Next' and you'll go to the Interface window
  • Interface window: Give your Raspberry libreELEC a name for identification on the network. 
  • In the network screen select your network and, if using Wifi, select your wifi network and enter your wifi code. 
  • I called mine 'kodi'. Hit 'Next' to set up Sharing and remote access.

  •  Sharing and Remote Access: To install Kodi, for now you must allow both SSH and SMB ('samba') in order to remotely drop further files from your pc to the RPi after the initial boot. (we will shut down SSH again at the end of the install).
  • If you want to be able to access your Kodi from remote, allow Samba and/or SSH (SSH for advanced users only).
  • Change the SSH password as recommended; by trial and error I found it must be over 8 characters long and have both uppercase letters and numbers.
  •  Hit 'Next' and you'll find yourself in the KODI main menu.

(for those who have been here before, the rest is now much more straight forward )


    3. Install repository and Add-ons


    Go to the KODI >Main Menu. 
    • Go to the >Add-on menu
    • Select the Search box and enter "kodinerds". 
    • From the search results, select & install
      "Add-on repository - Kodinerds Add-ons" (kodinerds.net 9.0.103.103)
    • Go back to the main Add-ons menu 
    from the Add-on browser menu, select > Install from repository
    • select  'Kodinerds Add-ons'.
    • select 'Add-on repository'
    • you should now see your Sandmann79s Repository. Select it and install it.
    • Go back up to Add-ons/Install from repositories. This should now also have the Sandmann79s repository.
    • In Sandmans repository, select > Video add-ons > Amazon VOD (the second one down)
    • Install it (accept additional add-ons to be installed also).
    You should now have Amazon VOD in the main Add-on menu. Yeah!

    Almost time to go enjoy yourself.

    • Open Amazon
    • Open the Amazon VOD menu (left side) and select > Connection
    • Select > Sign in ... and enter your Amazon Prime membership details.

    • The first time you select a video/movie to play, Kodi will tell you it needs to download "inputstream adaptive". Select "yes".
    • Also let it extract and install Widevine. Accept this and accept the Google terms. You must have at least 2Gb of free space for this to work.
    • This will take several minutes. 
    • After you have done this, if your movie/video does not play immediately reboot and try again.
    Note: Titles in the lists shown in red are not available under prime free, so these won't play irrespective. 
    Note2: search doesn't always work, and also saving in the Watchlist doesn't seem to work anymore. I found saving it to Favourites works. You can then find your movies/shows not in Amazon VOD but in the KODI main menu Favourites.

      The big Small Print: By entering your login details for Amazon you assume a certain risk in doing so. Sandmann has been active with Kodi for a long time. The source code for the software is open source and has been checked by security paranoid folk. The add-ons do not store login data, just an authentication cookie. Even so, the risk is all yours.

      You should now have Amazon up and running !

        ENJOY

      links:


      12 comments:

      1. Hi ! Thank you for this tutorial.
        Everything seems to work fine but... After some minutes of watching a movie, I experience lags, sound and image shifts. The movie stops 3 seconds and goes on. I'm using a connection by cable. My download speed is good (I watch Amazon movies on my laptop without lag). Is my Raspberry 2 not powerful enough ? Thank you.

        ReplyDelete
        Replies
        1. My raspi every now and then suffers similar. I thought it was my wifi connection but since you are cabled, maybe it is the raspi's struggling.
          If it really crashes, I find a (hard) reboot usually does the trick.

          Delete
        2. And I use a RP 3b so might well be that a 2 just hasn't got the power. Let us all know if you find out.

          Delete
        3. I've reduced framerate to 420p, no more lag or temporary freeze... Sure a 3b will be better ! Thx.

          Delete
      2. Hi,
        Thank you very much, I followed your instructions and I succeed in installing Amazone prime on my Raspberry 3.
        There were some changes and I needed to search a little bit but quite everything you indicate is accurate.
        So : "Big Up" and thank you very much!!!
        I can now enjoy watching my series and movies on my big TV screen ! Great job guy !

        ReplyDelete
      3. Installed following your instructions and it works perfect.

        Just one small issue...while watching it keeps on alerting the videos it has found...a small notification on top right side...Is there any way i can download the complete list of videos available ?

        ReplyDelete
        Replies
        1. Hi Jason, Glad you're enjoying it :-)
          I don't have your issue, so can you describe some more please. I only, occasionally, get a warning at top when I start streaming but I believe that is when I select a HD version so the player first get's an error (as Raspi can no longer play HD) and then falls back to playing SD.
          I am not aware of ability to download list as this is the streaming version. Maybe ask on Sandman's Github page.
          All the best,
          Robbes

          Delete
      4. Hi, thank you for this precious tutorial. I've managed to correctly install everything but I still have a problem. I can't see anything on Movies or TV Series list, but I can find and play any of them with a simple search. Am I missing something?

        ReplyDelete
      5. Hello,
        It looks like this already out of date. I've completed steps 1 and 2 but the menu for 3 is different to the instructions. I've hunted around but can't find "kodinerds" anywhere. I've got build 18.6 Leia. Any suggestions?

        ReplyDelete
        Replies
        1. See below post. Both Leia and Kodi changes daily, so menus will change a bit. If you're willing to mess with a raspi and apps, you'll have to be willing to do some 'hunting' yourself. Thanks.

          Delete
      6. Ok. I got this working with leia but I had to SSH and install sandman from a zip. The rest was pretty much through Kodi GUI.

        ReplyDelete
        Replies
        1. Hi there. Glad you got it working, although surprised you had to revert to SSH and zip again (per my 'old' post). Leia and Kodi change daily, so the exact steps in this blog will likely be a bit different from this blog (although I try to update it everytime Amazon breaks something and i'm forced to do a fresh install)

          Delete

      I'd love to hear how you like my blog, find it useful or have questions!
      (please note that in order to avoid spam abuse comments are moderated before being posted and that may take a while).