Note:
The current plugin 5.1.20.5 uses the same API keys for all version, which is why the quota ran out so quickly. I'm going to try and fix that one first as it's a game changer.
if you want to create your own API keys:
Quote:You need to edit the "key", "id" and "secret" numbers below with the ones you generate in the Google developers console located at https://console.developers.google.com/apis . The credentials you need to create are :
'key' = Browser key
'Id' = OAuth 2.0 client ID
'secret' = OAuth 2.0 client secret
Then go to the add-on settings and select the last tab and put in your API key,ID,secret in there.
For versions before that it's a little more detailed as you will have to edit the main file.
This is from the other thread at
2196528 (post) if you would like to see the original post and context.
Code:
For Openelec users, this file is located here : ~/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py . You will need to ssh into your openelec server in order to access this file, as its not exposed over SMB. Use putty or the like if you are on windows, or the built in ssh client if you are on linux or mac. The default login is : root / openelec. The file can be edited by nano.
You need to edit the "key", "id" and "secret" numbers below with the ones you generate in the Google developers console located at https://console.developers.google.com/apis . The credentials you need to create are :
'key' = Browser key
'Id' = OAuth 2.0 client ID
'secret' = OAuth 2.0 client secret
I've copied the relevant sections of the file below so you know what to edit. You should be able to just edit the key for your current version of XBMC, but Im still testing to see if this is the case.
*EDIT : DO NOT CHANGE the 'youtube-tv' credentials at the top of the file ( the first entry):
{
'youtube-tv': {
'system': 'All',
'key': 'AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA',
'id': '861556708454-d6dlm3lh05idd8npek18k6be8ba3oc68.apps.googleusercontent.com',
'secret': 'SboVhoG9s0rNafixCSGGKXAT'
},
This controls the "my subscriptions" feed, and will break it, as the part of the app that streams that will not be correctly authorized. This is the first app you authorize when you sign into the plugin for the first time. You can change all of the other credentials to your new info without issue. They should all match when you are done. Make sure you dont miss any punctuation, as this will cause the app to fail.
After you are finished, sign out of the app and sign back in. This will use the new credentials.
__author__ = 'bromix'
import time
import urlparse
from resources.lib.kodion import simple_requests as requests
from resources.lib.youtube.youtube_exceptions import LoginException
class LoginClient(object):
CONFIGS = {
'youtube-tv': {
'system': 'All',
'key': 'AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA',
'id': '861556708454-d6dlm3lh05idd8npek18k6be8ba3oc68.apps.googleusercontent.com',
'secret': 'SboVhoG9s0rNafixCSGGKXAT'
},
# API KEY for search and channel infos. These should work most of the time without login to safe some quota
'youtube-for-kodi-quota': {
'token-allowed': False,
'system': 'All',
'key': 'AIzaSyA7v1QOHz8Q4my5J8uGSpr0zRrntRjnMmk',
'id': '597640352045-7um2gr1v5rgobm5bf07ebesm3er48286.apps.googleusercontent.com',
'secret': 'VmyQ12KkJ_N3yegu4Y-VGCXd'
},
'youtube-for-kodi-fallback': {
'token-allowed': False,
'system': 'Fallback!',
'key': 'AIzaSyBEvxICg_E5g8mfndYjWHH4WEDF2fN_zXM',
'id': '705000440035-f7v8mhn75udt6l20r75ko7f15c39ns1c.apps.googleusercontent.com',
'secret': 'XeLKD8o_mdzEBDy9Nw5KMKbr'
},
'youtube-for-kodi-12': {
'system': 'Frodo',
'key': 'AIzaSyB6-pMlWO_XmgdM15VKGeLH4QsipdToBas',
'id': '131835494776-s0ef9jorci9vl0kaa5sqslupqvlku6ej.apps.googleusercontent.com',
'secret': 'Fz9nnfVGoH6jiLc0iefvzZYM'
},
'youtube-for-kodi-13': {
'system': 'Gotham',
'key': 'AIzaSyB6-pMlWO_XmgdM15VKGeLH4QsipdToBas',
'id': '131835494776-s0ef9jorci9vl0kaa5sqslupqvlku6ej.apps.googleusercontent.com',
'secret': 'Fz9nnfVGoH6jiLc0iefvzZYM'
},
'youtube-for-kodi-14': {
'system': 'Helix',
'key': 'AIzaSyCOxb_JvsI1-ZneJ2SXTkwZvW3fdtaR3bg',
'id': '45906745725-ucn38a9eumqcgfkmv14th17s0eq8kt5f.apps.googleusercontent.com',
'secret': 'sK6GK-ZhzgXWehCdjaGybHRi'
},
'youtube-for-kodi-15': {
'system': 'Isengard',
'key': 'AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E',
'id': '988476436049-l9sfcivj4jtm1f2ppcvvbgsli6kvtis0.apps.googleusercontent.com',
'secret': '_BEENv-a3-egDz_QKo5pGZCK'
},
'youtube-for-kodi-16': {
'system': 'Jarvis',
'key': 'AIzaSyBbgC4PZ2_hUdqqX7MIgdg2fK1nohv1jrw',
'id': '17932591024-8jruv1v7s78gipo7s17c91bnk26rqgpf.apps.googleusercontent.com',
'secret': 'bK9T234WWhqzYdcQLif1L35K'
}
}
Thank you,
Jeff