If you followed the previous post and started using Kodi, you might be wondering what else you can do with it other than sharing videos over the network. Kodi has great community support and offers many add-ons. One of those add-ons is for YouTube. The setup process can be tricky for some users, so I’d recommend reviewing the pros & cons at the end of the article. Also, skim through the steps involved before you start to have a good idea of what you are getting into.
Let’s get started with the installation.
Part 1: Install YouTube Add-On on Kodi
Step 1: Select Add-ons on the left menu.

Step 2: Click the Enter add-on browser button in the middle of the screen.

Step 3: Scroll down and click on the YouTube add-on.

Step 4: Click the Install button at the bottom right of the screen.

Step 5: If prompted to install additional add-ons such as InputStream Helper, click OK.

Step 6: Wait for the installation to complete.

Step 7: When prompted to Execute setup-wizard, select Yes.

- Select your language and region
- Decide if you want to perform geolocation. This is used in My Location settings.
Step 8: You should see a checkmark next to the YouTube add-on indicating that it has been successfully installed.

Step 9: Test your installation by clicking on Add-ons on the left menu and YouTube add-on. You should see a home screen like this:

Now that you have the YouTube add-on running on your Kodi let’s set up your Google account to generate API keys.
Part 2: Create YouTube API Keys
YouTube add-on requires you to enter your own API keys. This way, all the API calls the add-on makes will be made with your keys.
Step 1: Sign in to Google Cloud Platform with your Google account (If this is your first time, agree to the Terms and Conditions and continue).

Step 2: Click the Create Project button at the top right:

Step 3: Give your project a descriptive name and click Create.

Step 4: Click APIs & Services → Library on the left menu
Step 5: Search YouTube Data API in the API Library and select the first item in the auto-complete (youtube data api v3 in this example)

Step 6: Click on YouTube Data API v3 again

Step 7: Click the Enable button

Step 8: Click Credentials on the left menu
Step 9: Click Create Credentials and select API key

Step 10: Note down your API key and click the Edit API key button.

Step 11: As per the warning above, the key is unrestricted by default. Click on Restrict key option, select YouTube Data API v3 and click Save

Step 12: Click OAuth consent screen on the left menu
Step 13: Select External and click Create.

Step 14: Give a descriptive name to the app, such as Kodi YouTube AddOn and select your email as the User support email.

Then scroll down to the bottom and enter your email address again as Developer contact information, and click Save and Continue.

Step 14: Click Save and Continue on the Scopes and Test users pages and click the Back to dashboard button on the Summary page.
Step 15: Click Credentials again and Create Credentials. This time select OAuth client ID from the menu.

Step 16: Select TVs and Limited Input Devices from the list. give it a name (such as your Kodi instance name) and click Create.

Step 17: Note down your client ID and client secret. Then, click OK.

The next step is to enter the API key and the OAuth credentials in your YouTube Add-On. Since the add-on is running on your Raspberry Pi, entering these long random values is not easy. The easiest way to do that is to enter it by using the HTTP server. In the next part, you will configure your add-on and set up your user.
Part 3: Configure YouTube Add-On
Step 1: Enable the API configuration page by turning it on Settings → API

Step 2: Then, click HTTP server and note the port it’s running on.

Step 3: On your computer, go to the URL: http://{Kodi IP}:{HTTP Server Port}/api
You should see a page like this:

Enter your API key, client ID (as API Id) and client secret (as API secret). Then, click Save.

Step 4: Now, go back to your Kodi instance and open the add-on. Click Sign In.

Step 5: As the message says, you must sign in twice. Click OK to dismiss the message.

Step 6: You should see a code on your Kodi screen.

Go to google.com/device and enter the code on your computer.

Step 7: Select the account to use

Step 8: Click Allow

Step 9: You should see a successful connection message

Step 10: You should see a new code on your Kodi screen. Repeat steps 6 – 9 to authorize the app again. If all goes well, you should now see more items in the YouTube menu, such as My Subscriptions. You can now browse your videos, channels etc. 🎉

Troubleshooting Second Authorization: 403 Access Denied Error
If you got an error during the 2nd authorization that looks like this

Then, you have to follow the steps below:
Step 1: Click APIs & Services → OAuth Consent Screen. Your app should be in Testing status.

Step 2: Click Publish App and confirm when asked to Push to Production

Step 3: Go to google.com/device and enter the code again.
Step 4: You will see a warning message saying Google hasn’t verified this app. Click the Advanced link.

Step 5: Click Go to {YOUR APP NAME} (unsafe) link

You should now see on your Kodi screen that you are logged in and see My Subscriptions in the menu.
Part 4: Usage and Review
Congratulations on completing a lengthy setup. See below a list of pros and cons based on the setup and initial usage experience:
Pros & Cons
✅ Pros
- No ads (If you tried to get rid of in-video Youtube ads by using a Pi Hole, it looks like it doesn’t work: How do I block ads on YouTube?)
- No need for a separate streaming device
❌ Cons
- Setup is cumbersome
- User experience could be better
Even though the user experience feels a bit different initially, I hope it will grow on me.
👍 Multiple Users
You can create multiple users and easily switch between the users. You can create a new user by clicking Settings → Users → Add a user. Adding a new user involves Steps 4 – 10 of Part 3.

Then, you can easily switch between accounts by using the Switch User option.

Even though you sign in to a different YouTube account, it still uses the same API key to fetch your content, so you won’t have to generate new keys.
Conclusion
Setting up a home lab requires some work and maintenance, but in the end, it’s rewarding as well. In this tutorial, you learned how to install the YouTube add-on on Kodi and how to configure Google API to access your YouTube account. I hope you enjoyed it. See you in the next post.