Skip to content

Updated instructions for creating an API key and OAuth credentials #1095

Description

@MoojMidge

First ensure that you have updated to the latest version of the addon, available here:
https://github.com/anxdpanic/plugin.video.youtube/releases/

The current latest version is
v7.4.2

Then follow these instructions for creating and using an API key and OAuth credentials:

Originally posted by @smortex in #1376

  1. Sign in to Google and access https://console.cloud.google.com/cloud-resource-manager
  2. Click on Create project: Image
  3. Click on Create: Image
  4. Wait for the project to be created, then click on Select Project: Image
  5. Click on APIs & Services: Image
  6. Click on Enable APIs and services: Image
  7. You are presented with a search form: Image
  8. Search for YouTube Data API v3, and select it: Image
  9. Click on Enable: Image
  10. Click on Create credentials: Image
  11. Fill-in the form and click Next: Image
  12. Take note of your API Key 🎉, then click Done: Image
  13. Click on OAuth consent screen: Image
  14. Click on Get started: Image
  15. Fill-in the app name and e-mail address, then click Next: Image
  16. Select External and click Next: Image
  17. Fill-in e-mail address and click Next: Image
  18. Agree with user data policy and click Next: Image
  19. Click on Create: Image
  20. Click on Create OAuth client: Image
  21. Select TV and Limited Input devices as the device type, type-in a name and click Create: Image
  22. Take note of your Client ID 🎉 and Client secret 🎉 and click OK: Image
  23. Click on Audience: Image
  24. Under "Test users" click on Add users: Image
  25. Fill-in your e-mail address and click Save: Image

You now have the 3 required items 🎉:

  • An API key
  • An OAuth Client ID
  • An OAuth Client Secret

The easiest way to pass them to the plugin is to enable the API configuration page (from the plugin configuration page / API), and access it from http://<kodi-ip-address>:50152/youtube/api. There you can copy and paste the values you collected.


Older instructions for previous version of the Google Cloud Console:

Originally posted by @damnms in #1086

So for anyone else encountering this, I created a little "tutorial". This was not from scratch and i already had some things set up, so maybe a step might be missing. If so, please let me know and i add it! Be sure to follow each step. If you encounter an error, stop and fix that first! If you already have a shared key/api set up and it stopped working suddenly, maybe you did not login, see Step 12

  1. Go to https://console.cloud.google.com/cloud-resource-manager?hl=de&inv=1&invt=Abnytg

  2. Click on "CREATE PROJECT" in the upper line
    Image

  3. It doesnt matter what you write in there, just click on "Create". I labeled mine "Youtube".
    Image

  4. Easiest is now to go to https://console.cloud.google.com again, you will automatically land in the correct page for the project.
    Image

  5. Click on "APIs & Services".

  6. Click on "YouTube Data API v3" and click on "Activate"
    Image

  7. Click on "Credentials"
    Image

  8. Now click on "CREATE CREDENTIALS"

    8.1 Select "API Key", wait a moment and then click again "CREATE CREDENTIALS" again

    8.2 Select "Oauth-Client"

    8.3 Select "TVs and limited Input" for the "Application Type" selection. Click create and you should see it now like on the screenshot in Step 7 with one API Key and one OAuth 2.0 Client ID.

  9. Now go to "Oauth Consent Screen" and add your account to the test users (recommended) OR click on "Publish" (not recommended)
    Image

Now you are done with YouTubes annoying setup. You have the credentials you need now. They must be used in kodi’s youtube plugin. The simplest way is to turn on the youtube configuration web function like documented in Step 10. Do NOT edit the files manually with an editor coz they will be overwritten when the youtube plugin runs!

  1. Open the settings of the YouTube addon and go to "API" and select "Enable API Configuration Page" (this was translated by myself, in german it says "API-Einrichtungsseite aktivieren").

  2. After enabling that, go with a browser to http://$KODI_IP:50152/youtube/api and fill in the informations.

Image
(thanks to @slax57 from #439 (comment))

  1. The last step is to login with the youtube plugin.
    To do so, open the youtube app in kodi and select "Login". There should be a popup telling you to go to google.com/device and enter a code. Unfortunately, i did not make screenshots but it should be very self explanating. After entering the code, i had to enter another code and click on some warnings, because the api has full access. After allowing that, the youtube plugin works again. Thanks @MoojMidge for this great plugin and shame on you youtube for forcing this sh.t.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions