2018-01-14, 20:27
I have a list of paths to plug-in directories with movies and episodes (example below), and I'm trying access all of the ListItems in those paths. I don't want to actually open the plugin windows because this script will be running in a background service. How do I access these items from a Python script?
I've tried all of the built-in functions I can think of... GetDirectory, RunAddon, RunPlugin, RunScript, ActivateWindow... None of them do what I need. I think skins are able to access ListItems from plugins, but I don't have enough experience with them to figure out how.
I do know how to access all of the ListItems in the current container, so would it be possible to load the plugin items into a "hidden" container? Then, I could run a script similar to this one.
Since I only want the path of the items, is there an easier way to do this? Maybe a JSON-RPC call?
Any help is much appreciated
python:example_list = ['plugin://plugin.video.crackle/?id=%2fmovies&mode=101', 'plugin://plugin.video.foodnetwork/?mode=GE&url=http%3A%2F%2Fwww.foodnetwork.com%2Fvideos%2Ffull-episodes%2Fgood-eats']
I've tried all of the built-in functions I can think of... GetDirectory, RunAddon, RunPlugin, RunScript, ActivateWindow... None of them do what I need. I think skins are able to access ListItems from plugins, but I don't have enough experience with them to figure out how.
I do know how to access all of the ListItems in the current container, so would it be possible to load the plugin items into a "hidden" container? Then, I could run a script similar to this one.
python:
# example: loop through all items in current container and get paths
item_paths = []
ref_path = xbmc.getInfoLabel('ListItem.FileNameAndPath')
path = xbmc.getInfoLabel('ListItem.FileNameAndPath')
offset = 0
while True:
item_paths.append(path)
offset += 1
path = xbmc.getInfoLabel('Container.ListItem(%s).FileNameAndPath' % offset)
# returned ListItems will wrap back to beginning, so just check for the original item path
if path == ref_path:
break
Since I only want the path of the items, is there an easier way to do this? Maybe a JSON-RPC call?
Any help is much appreciated