How to set description to youtube video ListItem?
#1
I work on some plugin that shows videos from youtube playlist.
I am using youtube API.

I am collecting info from youtube (title, videoId, thumbnail url, description) from all videos from playlist.
ListItems are created:

Code:
url = youtube_url(item.yt_id)
    li = xbmcgui.ListItem(item.title, iconImage=item.thumb)
    li.setProperty('isplayable', 'true')
    li.setProperty('fanart_image', fanart)
    #infoLabels = { 'title': item.title, 'plot' : item.description}
    #li.setInfo( type="video", infoLabels=infoLabels)
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=False)

Now I am trying to set video description to list item by uncommenting lines
Code:
infoLabels = { 'title': item.title, 'plot' : item.description }                                                                                                                
    li.setInfo( type="video", infoLabels=infoLabels)

after that the description is set (and I can see it when switch view to mediaInfo), but the log file is filled with warnings and errors:

Code:
18:06:46 T:140231709697792  NOTICE: Thread BackgroundLoader start, auto delete: false
18:06:46 T:140232471934720 WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.youtube/play/?video_id=bG30_nEl1Wc
18:06:46 T:140232471934720   ERROR: InputStream: Error opening, plugin://plugin.video.youtube/play/?video_id=bG30_nEl1Wc
18:06:46 T:140232480327424 WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.youtube/play/?video_id=NgeldQSW4Ng
18:06:46 T:140232480327424   ERROR: InputStream: Error opening, plugin://plugin.video.youtube/play/?video_id=NgeldQSW4Ng
18:06:46 T:140232480327424 WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.youtube/play/?video_id=p4J_TPRexqI
18:06:46 T:140232480327424   ERROR: InputStream: Error opening, plugin://plugin.video.youtube/play/?video_id=p4J_TPRexqI
18:06:46 T:140232471934720 WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.youtube/play/?video_id=HNaXdswmgMw
18:06:46 T:140232471934720   ERROR: InputStream: Error opening, plugin://plugin.video.youtube/play/?video_id=HNaXdswmgMw


what should I do?
are this warnings/errors dangerous or harmless?
Is there some other way to set descriptions to youtube video items?
any idea?
Reply
#2
I have the same issue in all my add-ons. Can someone explain how to set info properties on a list item properly?

Code:
item = xbmcgui.ListItem('title', thumbnailImage=image)
item.setInfo(type='video', infoLabels={'genre': 'genre', 'plot': 'desc' })

Results in: WARNING: CreateLoader - unsupported protocol(plugin) in plugin://plugin.video....

Any help would be appreciated!

P.S.: Kodi Isengard 15.2
Reply
#3
Sorry for noice.

The answer is simple:

WRONG:
Code:
url="http://www.sample-videos.com/video/mp4/480/big_buck_bunny_480p_10mb.mp4"
uri = sys.argv[0] + '?mode=play&url=%s' % url
item = xbmcgui.ListItem(title, thumbnailImage=image)

item.setInfo(type='video', infoLabels={'genre': 'genre', 'plot': 'desc' })
item.setProperty('IsPlayable', 'true')

xbmcplugin.addDirectoryItem(pluginhandle, uri, item, False)

CORRECT:

Code:
url="http://www.sample-videos.com/video/mp4/480/big_buck_bunny_480p_10mb.mp4"

URI=url
item = xbmcgui.ListItem(title, thumbnailImage=image)

item.setInfo(type='video', infoLabels={'genre': 'genre', 'plot': 'desc' })
item.setProperty('IsPlayable', 'true')

xbmcplugin.addDirectoryItem(pluginhandle, URI, item, False)

Thanks to @ironic_monkey
See: http://forum.kodi.tv/showthread.php?tid=...pid2174378
Reply
#4
I guess you've got it all wrong. As I understand, Kodi tries to read metadata for list items by sending HEAD requests to media sources, which is not possible for plugin:// paths. That is why error messages are written in the log. You have 2 options: don't bother with those messages, or set mime types for your list items if you know ones (I'm not sure what will happen if you set a fake mime): http://romanvm.github.io/Kodistubs/_auto...etMimeType
Reply

Logout Mark Read Team Forum Stats Members Help
How to set description to youtube video ListItem?1