Kodi Community Forum

Full Version: Stream addon, prevent watched flag and XFILE::CFileFactory::CreateLoader error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have two problems I think are somewhat related. I'm making an addon to play any online stream supported by streamlink, but once I build the list of playable URLs, all items that have the watched flag show an error and warning like the following:
Code:
11:35:05 T:8044 WARNING: XFILE::CFileFactory::CreateLoader - unsupported protocol(plugin) in plugin://plugin.video.streamlink-player/?action=play&url=http%3A%2F%2Fwww.npo.nl%2Flive%2Fnpo-1
11:35:05 T:8044   ERROR: InputStream: Error opening, plugin://plugin.video.streamlink-player/?action=play&url=http%3A%2F%2Fwww.npo.nl%2Flive%2Fnpo-1

I would like to somehow tell Kodi to not mark any stream as watched ever, since it makes little sense for such a plugin. This in itself would seem to take care of the other problem probably, but I'm also hoping to prevent that in a more elegant way. I'm assuming Kodi is trying to extract thumbnails and resolution and stuff, but the problem is that the URL will not be resolved until it is requested to be played. Since the URL is temporary and the resolving takes time, there's also no way to do it during the creation of the list.

My addon.py and addon.xml.

Is there a native way to tell Kodi the plugin provides live streams?
I think that error is from the thumbnail or some info lookup failing, setting infolabels should fix that - something like setInfo(type='Video', infoLabels={'Title':'title','mediatype':'video'})

as for the checkmarks you can turn those off globally in advancedsetting.xml or append garbage to all listitem urls so that they are always seen as unwatched new items
I am pretty sure you can just not set the flags for watched, and or progress if you want to prevent those icons from showing up. At least on my addons they were never there unless I specifically added the info so kodi knew they were needed.
(2017-01-18, 14:09)V8MEM Wrote: [ -> ]I think that error is from the thumbnail or some info lookup failing, setting infolabels should fix that - something like setInfo(type='Video', infoLabels={'Title':'title','mediatype':'video'})

as for the checkmarks you can turn those off globally in advancedsetting.xml or append garbage to all listitem urls so that they are always seen as unwatched new items
By garbage you mean add some random number each time I build the list? I guess that'll work, the only problem is that I want to favourite some of the streams I'll use, so those links will be static.

Thanks about the hint about infolables. I played around with that before posting but couldn't figure out how it works (the current documentation is confusing for a beginner imo).
Ok, using ".setInfo('video', infoLabels={'Title':'test','mediatype':'video'})" on all listitems solved both problems, but I'm not really clear on why. Neither can I find what infolabels are available, if I go to http://kodi.wiki/view/InfoLabels there is no mediatype mentioned for instance.

[edit]
Using http://mirrors.kodi.tv/docs/python-docs/...em-setInfo I did see a mention for playcount, but it doesn't seem to have any effect sadly. Using the random number approach I'm afraid to spam my database (I plan to use the plugin daily). The infolabels approach isn't sufficient to prevent the watched flag for another plaugin of mine for some reason. As said above, I frankly don't even get why it works for the first plugin.
(2017-01-23, 13:19)kingmob Wrote: [ -> ]Ok, using ".setInfo('video', infoLabels={'Title':'test','mediatype':'video'})" on all listitems solved both problems, but I'm not really clear on why. Neither can I find what infolabels are available, if I go to http://kodi.wiki/view/InfoLabels there is no mediatype mentioned for instance.

[edit]
Using http://mirrors.kodi.tv/docs/python-docs/...em-setInfo I did see a mention for playcount, but it doesn't seem to have any effect sadly. Using the random number approach I'm afraid to spam my database (I plan to use the plugin daily). The infolabels approach isn't sufficient to prevent the watched flag for another plaugin of mine for some reason. As said above, I frankly don't even get why it works for the first plugin.

are you able to use xbmc.Player().play instead of setResolvedUrl for your playable urls?
i don't have time to dig up the why right now, but remove the content type - 'video' is not supported and some code breaks due to (i suspect) assumptions that the value is valid. okay, located, "merely" a skin issue.

opened a pr to quell the folder.jpg warning
you would need to change the content type to videos.

for more info on content types and media types (a.k.a. dbtypes) see:
http://forum.kodi.tv/showthread.php?tid=299107
So after some testing it appears that adding infoLabel playcount=0 works perfectly well to achieve this for live streams.

Here is a reference to our feature request and implementation: https://github.com/pietje666/plugin.vide...-503773325