adddirectoryitem sys.argv error
#1
Ok, I did research this and found out I was trying to execute the addon as a script and that was my problem.. so I did a test and it worked:

I changed it to

Code:
<extension point="xbmc.python.pluginsource" library="default.py">

and it worked.. but then I needed it to run as a service and now it is giving me:

Code:
08:42:07 T:5532   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "C:\Users\default.py", line 46, in <module>
                                                params=get_params()
                                              File "C:\Users\default.py", line 10, in get_params
                                                paramstring=sys.argv[2]
                                            IndexError: list index out of range
                                            -->End of Python script error report<--

yet again. any ideas?

EDIT:::

I just was messing around with it and I found out that when I go to video addons and click my addon it works. but I need to be able to call Categories() on PlaybackEnded
Reply
#2
You can't add ListItems (or more generic: Do what a plugin does) from a service add-on.
My GitHub. My Add-ons:
Image
Reply
#3
Ok so just to make sure. I cant have my addon automatically start and create a list of streaming videos in any way?

Thank you for your response
Reply
#4
You can't just take a video plugin and let it be a service add-on.

But you CAN create an service add-on which executes
Code:
xbmc.executebuiltin('Container.Update(YOUR_PLUGIN_URL)')
e.g.
Code:
xbmc.executebuiltin('Container.Update(plugin://plugin.video.youtube/)')
To open your video plugin (to a given view).

And if you got this working you can do it in a single add-on with multiple extension points and multiple python files.

EDIT:
This is untested! It may be required to switch the window before updating the container.
My GitHub. My Add-ons:
Image
Reply
#5
ok, I created multiple extension points and everthing works..

Code:
<extension point="xbmc.python.script" library="default.py">
    <provides>executable</provides>
</extension>
<extension point="xbmc.python.pluginsource" library="pluginfile.py">
    <provides>video</provides>
</extension>
<extension point="xbmc.service" name="tvpromos.service" library="default.py" start="login" />

the list of videos works as well but ONLY if I go to video addons and start it that way. any other way I try to start it I get this:

Code:
WARNING: Attempt to use invalid handle -1

any Idea on how to just open this part as if I were clicking on it under video addons?

EDIT::::

ok my mistake I need to use:

Code:
xbmc.executebuiltin("XBMC.ActivateWindow(?,plugin://script.tv.promos/)")

Just have to figure out what ID to use in place of the ?
Reply
#6
(2013-08-31, 03:31)karrade Wrote:
Code:
xbmc.executebuiltin("XBMC.ActivateWindow(?,plugin://script.tv.promos/)")

Just have to figure out what ID to use in place of the ?

What about "Videos" (10006)?
Code:
xbmc.executebuiltin("XBMC.ActivateWindow(Videos,plugin://script.tv.promos/)")
xbmc.executebuiltin("XBMC.ActivateWindow(10006,plugin://script.tv.promos/)")
My GitHub. My Add-ons:
Image
Reply
#7
It works but when I try to get out of it with backspace it takes me through other menus. I. Trying to figure out a way to have it play videos like 10006 but exit like 10028
Reply
#8
Try it with "ReplaceWindow" instead "ActivateWindow". Untested.
My GitHub. My Add-ons:
Image
Reply
#9
Still the same thing... what about monitoring for a backspace press?

Or is that not a good idea in xbmc?
Reply

Logout Mark Read Team Forum Stats Members Help
adddirectoryitem sys.argv error0