diff --git a/addon.xml b/addon.xml index 0f8061b0..213b3d1e 100644 --- a/addon.xml +++ b/addon.xml @@ -19,6 +19,7 @@ [fix] fix Premiere's exiting after 5 seconds |contrib: jpfox156| [fix] playlists over json-rpc |contrib: JasperE84| [lang] de_de strings |contrib: tweimer| +[lang] el_gr strings |contrib: twilight0| [lang] es_es strings |contrib: roliverosc| [lang] pt_pt strings |contrib: daniel3x| diff --git a/changelog.txt b/changelog.txt index 3be42ea5..43782a55 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ [fix] fix Premiere's exiting after 5 seconds |contrib: jpfox156| [fix] playlists over json-rpc |contrib: JasperE84| [lang] de_de strings |contrib: tweimer| +[lang] el_gr strings |contrib: twilight0| [lang] es_es strings |contrib: roliverosc| [lang] pt_pt strings |contrib: daniel3x| diff --git a/resources/lib/youtube_plugin/youtube/client/__config__.py b/resources/lib/youtube_plugin/youtube/client/__config__.py index 5397ac48..ca3959ec 100644 --- a/resources/lib/youtube_plugin/youtube/client/__config__.py +++ b/resources/lib/youtube_plugin/youtube/client/__config__.py @@ -40,6 +40,15 @@ def _on_init(self): j_id = self._json_api['keys']['personal'].get('client_id', '') j_secret = self._json_api['keys']['personal'].get('client_secret', '') + if j_key and j_id and j_secret: + # users are now pasting keys into api_keys.json + # try stripping whitespace and .apps.googleusercontent.com from keys and saving the result if they differ + stripped_key, stripped_id, stripped_secret = self._strip_api_keys(j_key, j_id, j_secret) + if stripped_key and stripped_id and stripped_secret: + if (j_key != stripped_key) or (j_id != stripped_id) or (j_secret != stripped_secret): + self._json_api['keys']['personal'] = {'api_key': stripped_key, 'client_id': stripped_id, 'client_secret': stripped_secret} + self._api_jstore.save(self._json_api) + original_key = self._settings.get_string('youtube.api.key') original_id = self._settings.get_string('youtube.api.id') original_secret = self._settings.get_string('youtube.api.secret')