youtube plugin issue with personal addon
#1
Has anyone else had an issue with the youtube plugin not playing URLs within their own addons?

I have the following code:
li = xbmcgui.ListItem('li_name')
li.setProperty('isPlayable','True')
url = 'plugin://plugin.video.youtube/?action=play_video&videoid=XXXXX'
xbmcplugin.addDirectoryItem(handle=addon_handle , url=url, listitem=li)
# xbmc.Player(xbmc.PLAYER_CORE_MPLAYER).play('plugin://plugin.video.youtube?action=play_video&videoid=XXXXX')
#xbmc.executebuiltin('PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=XXXXXX)')

The #commented sections work just fine, but when I use the addDirectory option the URL does not play.
I am currently using Kodi v15.0 alpha if that has any say in the issue.
Reply
#2
Not sure if I am going the right direction with this or not, but I got it to kind of work combining the url with the builtin.

url = xbmc.executebuiltin('PlayMedia(plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=XXXXX'

The problem now is that when I esc from the clip the clip just restarts. Essentially it is a loop, but if I pause the movie before pressing esc I am still able to navigate through Kodi. Does anyone have any idea what could cause the loop, or maybe even away to resolve it so that it doesn't occur. Is there an exit procedure on esc?
Reply
#3
After looking through the youtube plugin docs the correct format is ( plugin://plugin.video.youtube/play/?video_id=[Vid ID] ), but when I use this in the url = 'plugin://plugin.video.youtube/play/?video_id=[Vid ID]' the field is changed in the Kodi Log to include ".tbn". I do not understand where the text is being pulled from since my script does not contain that information.

Kodi Log: My DEBUG Log on xbmclogs.com

Code from script: My script on Pastebin.com

Thanks to Bromix for pointing out the url issue.
Reply
#4
I have managed to get it so I no longer get "WARNING: CreateLoader - unsupported protocol(plugin) in " within my Kodi.log, but the video still doesn't play. I have a feeling that the url is not being identified as a string, but I have no idea how to get the player to play.

Naito333's Updated Kodi Log: CLICK HERE
http://www.xbmclogs.com/pqtnm1wqo

Updated Py script: CLICK HERE
http://pastebin.com/UL7kZatv


The only thing I did was get it so that the .tbn was taken out of the string before it was passed as the actual URL. I managed to do this by re.sub.

elif mode[0] == 'folder' and name[0] == '2010':
# foldername = args['foldername'][0]

li = xbmcgui.ListItem('21 March 2010 - "Introduction" video')
li.setProperty('isplayable', 'true')
li.setProperty('Video', 'true')
ytplugin_link = 'plugin://plugin.video.youtube/play/?video_id=JS7GZhNb7eM'
url = re.sub(r'[^.tbn]', '', ytplugin_link)
xbmcplugin.addDirectoryItem(handle=addon_handle , url=url, listitem=li, isFolder=False)
xbmcplugin.endOfDirectory(addon_handle)
Reply
#5
Any update on this?
Reply
#6
Not the at this time. I am in the process of moving so it might be a while yet before I can get a chance to get back to it. To be honest I didn't rush it originally because I didn't think anyone was having the same issue.
Reply

Logout Mark Read Team Forum Stats Members Help
youtube plugin issue with personal addon0