Kodi Community Forum

Full Version: YouTube Plug-in Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Folks,

I have been using the 5.3.6 jdf76 youtube plugin for quite some time. I ended up doing a clean install of librelec on one of my boxes and when I went to add the youtube plug-in, I'm getting an error. I don't doubt it's my fault and I'm not following the steps properly, but I will say I have done this before for two different machines without issue. In any case, I noticed an exception is thrown in the kodi log which I have listed below.

I removed all settings and the plugin, reinstalled from the repo, and tried to sign-in and immediately I'm greeted with the error and this exception is thrown:

PHP Code:
18:05:36.764 T:140123599083264  NOTICE: [plugin.video.youtubeRunningYouTube (5.3.6on Krypton (17.0with Python 2.7.13
18
:05:40.533 T:140123599083264  NOTICEPrevious line repeats 1 times.
18:05:40.534 T:140123599083264   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <class 'urllib2.URLError'>
                                            
Error Contents: <urlopen error EOF occurred in violation of protocol (_ssl.c:661)>
                                            
Traceback (most recent call last):
                                              
File "/storage/.kodi/addons/plugin.video.youtube/default.py"line 7in <module>
                                                
runner.run(__provider__)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/runner.py"line 32in run
                                                __RUNNER__
.run(providercontext)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/impl/xbmc/xbmc_runner.py"line 23in run
                                                results 
provider.navigate(context)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/abstract_provider.py"line 93in navigate
                                                result 
method(contextre_match)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/register_provider_path.py"line 12in wrapper
                                                
return func(*args, **kwargs)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/provider.py"line 426in _on_sign
                                                yt_login
.process(modeselfcontextre_matchcontext.get_settings().requires_dual_login())
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py"line 88in process
                                                access_token_tv
expires_in_tvrefresh_token_tv _do_login(_for_tv=True)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py"line 11in _do_login
                                                json_data 
_client.generate_user_code_tv()
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py"line 172in generate_user_code_tv
                                                
return self.generate_user_code(client_id=client_id)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py"line 196in generate_user_code
                                                result 
requests.post(urldata=post_dataheaders=headersverify=False)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py"line 194in post
                                                
return _request('POST'urldata=datajson=json, **kwargs)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py"line 165in _request
                                                response 
opener.open(request)
                                              
File "/usr/lib/python2.7/urllib2.py"line 429in open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 447in _open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 407in _call_chain
                                              File 
"/usr/lib/python2.7/urllib2.py"line 1241in https_open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 1198in do_open
                                            URLError
: <urlopen error EOF occurred in violation of protocol (_ssl.c:661)>
                                            -->
End of Python script error report<--
18:05:40.593 T:140123778557056   ERRORGetDirectory Error getting plugin://plugin.video.youtube/sign/in/
18:05:40.594 T:140123778557056   ERRORCGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/sign/in/) failed
18:05:40.814 T:140123599083264  NOTICE: [plugin.video.youtubeRunningYouTube (5.3.6on Krypton (17.0with Python 2.7.13 



http://pastebin.com/texkrzuM
(2016-12-28, 20:22)mklein49 Wrote: [ -> ]Hi Folks,

I have been using the 5.3.6 jdf76 youtube plugin for quite some time. I ended up doing a clean install of librelec on one of my boxes and when I went to add the youtube plug-in, I'm getting an error. I don't doubt it's my fault and I'm not following the steps properly, but I will say I have done this before for two different machines without issue. In any case, I noticed an exception is thrown in the kodi log which I have listed below.

I removed all settings and the plugin, reinstalled from the repo, and tried to sign-in and immediately I'm greeted with the error and this exception is thrown:

PHP Code:
18:05:36.764 T:140123599083264  NOTICE: [plugin.video.youtubeRunningYouTube (5.3.6on Krypton (17.0with Python 2.7.13
18
:05:40.533 T:140123599083264  NOTICEPrevious line repeats 1 times.
18:05:40.534 T:140123599083264   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <class 'urllib2.URLError'>
                                            
Error Contents: <urlopen error EOF occurred in violation of protocol (_ssl.c:661)>
                                            
Traceback (most recent call last):
                                              
File "/storage/.kodi/addons/plugin.video.youtube/default.py"line 7in <module>
                                                
runner.run(__provider__)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/runner.py"line 32in run
                                                __RUNNER__
.run(providercontext)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/impl/xbmc/xbmc_runner.py"line 23in run
                                                results 
provider.navigate(context)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/abstract_provider.py"line 93in navigate
                                                result 
method(contextre_match)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/register_provider_path.py"line 12in wrapper
                                                
return func(*args, **kwargs)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/provider.py"line 426in _on_sign
                                                yt_login
.process(modeselfcontextre_matchcontext.get_settings().requires_dual_login())
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py"line 88in process
                                                access_token_tv
expires_in_tvrefresh_token_tv _do_login(_for_tv=True)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py"line 11in _do_login
                                                json_data 
_client.generate_user_code_tv()
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py"line 172in generate_user_code_tv
                                                
return self.generate_user_code(client_id=client_id)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py"line 196in generate_user_code
                                                result 
requests.post(urldata=post_dataheaders=headersverify=False)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py"line 194in post
                                                
return _request('POST'urldata=datajson=json, **kwargs)
                                              
File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py"line 165in _request
                                                response 
opener.open(request)
                                              
File "/usr/lib/python2.7/urllib2.py"line 429in open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 447in _open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 407in _call_chain
                                              File 
"/usr/lib/python2.7/urllib2.py"line 1241in https_open
                                              File 
"/usr/lib/python2.7/urllib2.py"line 1198in do_open
                                            URLError
: <urlopen error EOF occurred in violation of protocol (_ssl.c:661)>
                                            -->
End of Python script error report<--
18:05:40.593 T:140123778557056   ERRORGetDirectory Error getting plugin://plugin.video.youtube/sign/in/
18:05:40.594 T:140123778557056   ERRORCGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/sign/in/) failed
18:05:40.814 T:140123599083264  NOTICE: [plugin.video.youtubeRunningYouTube (5.3.6on Krypton (17.0with Python 2.7.13 



http://pastebin.com/texkrzuM

Looks like a failed login to me.

18:05:40.593 T:140123778557056 ERROR: GetDirectory - Error getting plugin://plugin.video.youtube/sign/in/
18:05:40.594 T:140123778557056 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/sign/in/) failed

I'd check on the API key make sure you didn't typo it in. May want to copy your settings.xml from your other boxes to this one.

Jeff
I can confirm, same error as mklein49. Happens when trying to sign in as well. Tested on two devices.

I'm on LibreELEC too, I've tried rebuilding with Python downgraded to 2.7.12 also no go. Tried upgrading LibreSSL to 2.5 same. Tried adding ndg-httpsclient as it was recommended somewhere on the web, still no success. I think there must have been something in the latest Kodi betas, because it was working recently with few other changes.
It's entirely possible because there has been no code changes since 5.3.6 except for that guy who did the 5.3.7 which i took out.

Jeff
(2016-12-29, 17:27)arokh Wrote: [ -> ]I can confirm, same error as mklein49. Happens when trying to sign in as well. Tested on two devices.

I'm on LibreELEC too, I've tried rebuilding with Python downgraded to 2.7.12 also no go. Tried upgrading LibreSSL to 2.5 same. Tried adding ndg-httpsclient as it was recommended somewhere on the web, still no success. I think there must have been something in the latest Kodi betas, because it was working recently with few other changes.

No issues here signing in on 17.0 beta 7 ubuntu (actual beta 7, not nightly based on beta 7)
What settings to use in inputstream so that stream is limited to 1080p i have some videos that have 4k max resolution and pi try to run them
The inputstream addon is /disabled by default/ and needs to be enabled for MPEG-DASH to work. I was scratching my head wondering why the checkbox was disabled, and then I read the first post Smile Don't make my mistake, enable the inputstream addon! Go to addons->my addons->all addons->Inputstream and ENABLE it
Anybody figured how to enable MPEG DASH using Fedora 25 or SUSE? I coudn't find any kodi-addons-inputstream-mpd package in RPM format anywhere.

Fedora 25 + RPMFusion give Kodi 17Beta6

Addon browser > All addons : does NOT show the Videostream inputstream adaptive addon anywhere (nor similar)

Found this - https://github.com/peak3d/inputstream.mpd

Tried to build it manually but running into all kinds of errors
(2016-12-28, 14:41)jdf76 Wrote: [ -> ]Login failed message means your API Key has a typo or was not set up correctly.

I'm guessing that the login authorization process is actually done twice... Once for each time the authorization code is displayed ?
If my guess is correct, then a login error can occur both times the addon tries to authorize itself ?

I also noticed that my client ID key contains .apps.googleusercontent.com, but the addon itself doesn't use it (In settings I noticed that the key is truncated, with that portion removed, after I saved the xml file and ran the addon). ?


JUST A REMINDER TO EVERYONE TO CHECK THE FIRST POST OF THE THREAD, IN CASE THE STEPS TO GET THE PLUGIN WORKING, HAVE CHANGED.
Wink
(2016-12-30, 03:23)htpcero Wrote: [ -> ]Anybody figured how to enable MPEG DASH using Fedora 25 or SUSE? I coudn't find any kodi-addons-inputstream-mpd package in RPM format anywhere.

Fedora 25 + RPMFusion give Kodi 17Beta6

Addon browser > All addons : does NOT show the Videostream inputstream adaptive addon anywhere (nor similar)

Found this - https://github.com/peak3d/inputstream.mpd

Tried to build it manually but running into all kinds of errors

Inputstream.mpd is obsolete and not really used anymore. use inputstream.adaptive.

Try asking in the linux forum.
(2016-12-30, 04:53)Spinner65 Wrote: [ -> ]
(2016-12-28, 14:41)jdf76 Wrote: [ -> ]Login failed message means your API Key has a typo or was not set up correctly.

I'm guessing that the login authorization process is actually done twice... Once for each time the authorization code is displayed ?
If my guess is correct, then a login error can occur both times the addon tries to authorize itself ?

I also noticed that my client ID key contains .apps.googleusercontent.com, but the addon itself doesn't use it (In settings I noticed that the key is truncated, with that portion removed, after I saved the xml file and ran the addon). ?


JUST A REMINDER TO EVERYONE TO CHECK THE FIRST POST OF THE THREAD, IN CASE THE STEPS TO GET THE PLUGIN WORKING, HAVE CHANGED.
Wink

The apps.googleusercontent.com is added in the script automatically by the plugin. if you put it in, it'll strip it out anyways otherwise it'll say apps.googleusercontent.com.apps.googleusercontent.com.

Here is what my basic settings.xml looks like. It has 4 comments in it. It also has never been logged in because i don't have a dummy youtube account. They keys work but if you use them, it's not my problem if they break. They are tied to the same account i do testing on.

PHP Code:
<settings>
    <
setting id="kodion.access_token" value="" />
    <
setting id="kodion.cache.size" value="5" />
    <
setting id="kodion.content.max_per_page" value="9" />
    <
setting id="kodion.fanart.show" value="true" />
    <
setting id="kodion.login.hash" value="d41d8cd98f00b204e9800998ecf8427e" />
    <
setting id="kodion.maintain.clear.func" value="" />
    <
setting id="kodion.maintain.clear.search" value="" />
    <
setting id="kodion.maintain.delete.func" value="" />
    <
setting id="kodion.maintain.delete.search" value="" />
    <
setting id="kodion.maintain.delete.settings" value="" />
    <
setting id="kodion.search.size" value="1" />
    <
setting id="kodion.setup_wizard" value="false" />
    <
setting id="kodion.subtitle.languages" value="0" />
    <
setting id="kodion.support.alternative_player" value="false" />
    <
setting id="kodion.video.quality" value="3" />
    <
setting id="kodion.video.quality.ask" value="false" />
    <
setting id="kodion.video.quality.mpd" value="false" />
    <
setting id="kodion.video.quality.mpd.configure" value="" />
    <
setting id="kodion.video.support.mpd.addon" value="false" />
    <
setting id="kodion.video.support.mpd.builtin" value="false" />
    <
setting id="simple.requests.ssl.verify" value="false" />
    <
setting id="youtube.api.enable" value="true" />. <!-- This is turned on -->
    <
setting id="youtube.api.id" value="89701247165-4ro19r2rl71drb4jgrie5lfndiucn8a4" />. <!-- Client ID89701247165-4ro19r2rl71drb4jgrie5lfndiucn8a4.apps.googleusercontent.com -->
    <
setting id="youtube.api.key" value="AIzaSyD8z21m74tjFoEWSaeS7-xakusrbAvf1RQ" /> <!-- API keyAIzaSyD8z21m74tjFoEWSaeS7-xakusrbAvf1RQ -->
    <
setting id="youtube.api.key.switch" value="own" />
    <
setting id="youtube.api.key.switch.use" value="own" />
    <
setting id="youtube.api.last.hash" value="deb4a29d403887dc53133df59624e934" />
    <
setting id="youtube.api.last.switch" value="own" />
    <
setting id="youtube.api.secret" value="PPMrJ-SqiWO142ewoa6E15nz" />. <!-- Client secretPPMrJ-SqiWO142ewoa6E15nz -->
    <
setting id="youtube.channel.fanart.show" value="true" />
    <
setting id="youtube.folder.browse_channels.show" value="true" />
    <
setting id="youtube.folder.disliked_videos.show" value="true" />
    <
setting id="youtube.folder.history.playlist" value="" />
    <
setting id="youtube.folder.history.show" value="false" />
    <
setting id="youtube.folder.liked_videos.show" value="true" />
    <
setting id="youtube.folder.live.show" value="true" />
    <
setting id="youtube.folder.my_channel.show" value="true" />
    <
setting id="youtube.folder.my_subscriptions.show" value="true" />
    <
setting id="youtube.folder.playlists.show" value="true" />
    <
setting id="youtube.folder.popular_right_now.show" value="true" />
    <
setting id="youtube.folder.recommendations.show" value="true" />
    <
setting id="youtube.folder.settings.show" value="true" />
    <
setting id="youtube.folder.sign.in.show" value="true" />
    <
setting id="youtube.folder.sign.out.show" value="true" />
    <
setting id="youtube.folder.subscriptions.show" value="true" />
    <
setting id="youtube.folder.watch_later.playlist" value="" />
    <
setting id="youtube.folder.watch_later.show" value="false" />
    <
setting id="youtube.language" value="en-US" />
    <
setting id="youtube.playlist.watchlater.autoremove" value="true" />
    <
setting id="youtube.region" value="US" />
    <
setting id="youtube.view.description.show_channel_name" value="true" />
</
settings

I hope this helps.

Jeff
(2016-12-30, 02:16)sherl0k Wrote: [ -> ]The inputstream addon is /disabled by default/ and needs to be enabled for MPEG-DASH to work. I was scratching my head wondering why the checkbox was disabled, and then I read the first post Smile Don't make my mistake, enable the inputstream addon! Go to addons->my addons->all addons->Inputstream and ENABLE it

I dont know if you are replying to me but im not asking how to enabe dash but how to set addon to limit resolution to max 1080p i cant play 4k on raspberrypi
(2016-12-29, 17:27)arokh Wrote: [ -> ]I can confirm, same error as mklein49. Happens when trying to sign in as well. Tested on two devices.

I'm on LibreELEC too, I've tried rebuilding with Python downgraded to 2.7.12 also no go. Tried upgrading LibreSSL to 2.5 same. Tried adding ndg-httpsclient as it was recommended somewhere on the web, still no success. I think there must have been something in the latest Kodi betas, because it was working recently with few other changes.


Reading the LibreELEC forums, found this...

Quote:I can reproduce here. Have no idea what's causing that either, although it seems to be Python related. I have made no mods to Python though, but it was recently upgraded to 2.7.13 in master.
(2016-12-28, 14:41)jdf76 Wrote: [ -> ]Login failed message means your API Key has a typo or was not set up correctly.

In my opinion, a YouTube app which requires no manual configuration is essential to mainstream adoption of the Kodi platform.

Suggestions:

1. Examine the official Roku YouTube app to see how it works without an API key. Manually translate the Roku Brightscript code to Python equivalents.

2. Develop a binary Brightscript interpreter or a Brightscript to Python translator. This would allow other Roku apps to be ported to Kodi more easily, and might allow the Roku app store to be used by Kodi.
(2017-01-02, 11:03)kb87 Wrote: [ -> ]
(2016-12-28, 14:41)jdf76 Wrote: [ -> ]Login failed message means your API Key has a typo or was not set up correctly.

In my opinion, a YouTube app which requires no manual configuration is essential to mainstream adoption of the Kodi platform.

Suggestions:

1. Examine the official Roku YouTube app to see how it works without an API key. Manually translate the Roku Brightscript code to Python equivalents.

2. Develop a binary Brightscript interpreter or a Brightscript to Python translator. This would allow other Roku apps to be ported to Kodi more easily, and might allow the Roku app store to be used by Kodi.

You clearly have no idea how the Youtube addon works.

1) Roku works differently and since its an "official" app it might have its own API key with unlimited quota. That's because Roku manufacturer pays Google!
2) Once again no idea how much effort it takes to do such task. Also not necessary to do such thing as we already have all it takes addon-wise for many sites out there.