FYI- This looks really convoluted and time consuming but it is not.
There is more text to read than the actual steps to do the work.
I have assimilated the information from a lot of webpages outside but the most detailed and comprehensive one was created by kodi forums member activoice
Before you start, remove Youtube add-on and any associated files/settings so we have a clean start.
Re-install youtube (current vesion as of Mar 2016 is 5.1.17) but don’t login at this time.
Login to https://console.developers.google.com/apis/
Click on Credentials (left hand side).
Create a project, follow the prompts to name and create your key (you can define your region in the world under advanced option) - (You don’t need to remember name of your project for future use but I stored it just in case …).
We need to create two credentials, an “API key” credential and an “0Auth client ID” credential for this method to work.
API Key:
Click on the button “create credentials” and then “API Key” and then click on “Browser key”.
Assign a name and click create.
Copy the key as displayed and keep it safe somehwere for later use.
0Auth client ID:
Click on the button “create credentials” and then “0Auth client ID” and then “configure consent screen”.
Add a random name to the Product name box and save your settings.
Click “other” for application type, assign name and create the key.
Save your client ID and client secret for later use.
On the screen that you land, verify that you have an API Key and a 0Auth client ID keys.
Click on API manager on the top left hand side of the screen.
Click on “YouTube Data API v3” and then click on Enable in the resulting screen.
If you don’t see the YouTube Data API key at the above locvation the go to https://console.developers.google.com/apis/library, click on the key and enable it.
Now that we have created our own personal set of keys we can add them to the YouTube add-on.
ssh to the pi
Verify the version of kodi you are using.
osmc@lab1:~$ grep Kodi .kodi/temp/kodi.log | head -3
Search for file login_client.py (should be located at /home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client).
We need to replace a few keys in this file with ones that we created earlier.
Make a copy of the file by running the following command.
osmc@lab1:~$ cd ./home/osmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client
osmc@lab1:~$ sudo cp login_client.py ./login_client.py.orig
osmc@lab1:~$ sudo chown osmc login_client.py.orig
osmc@lab1:~$ sudo chgrp osmc login_client.py.orig
Now that we have a backup of the original file, open the file in an editor and locate the section that corresponds to the version of KODI that you’re using in the file, for me it is ver 16 (example below references that).
osmc@lab1:~$ sudo nano ./.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py
Ver 16 section of the file that needs to be edited should look like this
‘youtube-for-kodi-16’: {
‘system’: ‘Jarvis’,
‘key’: ‘AIzaSyBbgC4PZ2_hUdqqX7MIgdg2fK1nohv1jrw’,
‘id’: ‘17932591024-8jruv1v7s78gipo7s17c91bnk26rqgpf.apps.googleusercontent.com’,
‘secret’: ‘bK9T234WWhqzYdcQLif1L35K’
Replace key in the file with the “API Key” that you created earlier.
Replace id with the “id” from “OAuth client ID” that you created earlier.
Replace secret with the “secret” from “OAuth client ID” that you created earlier.
Save and exit the file by pressing the following key strokes.
###Ctrl-O, ENTER, & Ctrl-X to save the file and exit the file
Restart Kodi or if you are like me, reboot the device.
Either way, login to YouTube and do the double signin/auth by typing in the displayed code at Connexion : comptes Google.
Hope this method works for you also as it hasworked for me and a few other machines that I have done it on so far