Solved v19 - Can't playing local plugin url (Kodi crashes)
#16
@jbinkley60 
No, It's is still not working, running the external url still makes kodi to crash.
What I said is that I probably found the location where the code fails / not works as should be, and maybe that what cause kodi to crash.

The log show that "xbmcgui.ListItem" has a value (<xbmcgui.ListItem object at 0x00000150186DDA50>), so it's not None.
All the variables of the "setInfo" params has values too (As I wrote in the previous comment)
So what does make the "setInfo" to fail? (Maybe these specific string values makes it to fail?)
I follow the docs and I don't find anything wrong.
https://codedocs.xyz/AlwinEsch/kodi/grou...2888fb5f14

(In Kodi 17.6 it works perfectly)
Reply
#17
deleted
Reply
#18
(2021-09-01, 14:20)burekas Wrote: @jbinkley60 
No, It's is still not working, running the external url still makes kodi to crash.
What I said is that I probably found the location where the code fails / not works as should be, and maybe that what cause kodi to crash.

The log show that "xbmcgui.ListItem" has a value (<xbmcgui.ListItem object at 0x00000150186DDA50>), so it's not None.
All the variables of the "setInfo" params has values too (As I wrote in the previous comment)
So what does make the "setInfo" to fail? (Maybe these specific string values makes it to fail?)
I follow the docs and I don't find anything wrong.
https://codedocs.xyz/AlwinEsch/kodi/grou...2888fb5f14

(In Kodi 17.6 it works perfectly)
Ok, I looked at your code again.  You posted it earlier as:

 listItem.setInfo(type="video", infoLabels={"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})

I think the valid options are:

infoLabels = "mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0}
listItem.setInfo(type="video", infoLabels)

or

 listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})

One of those should work for you.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#19
(2021-09-01, 22:56)jbinkley60 Wrote:
(2021-09-01, 14:20)burekas Wrote: @jbinkley60 
No, It's is still not working, running the external url still makes kodi to crash.
What I said is that I probably found the location where the code fails / not works as should be, and maybe that what cause kodi to crash.

The log show that "xbmcgui.ListItem" has a value (<xbmcgui.ListItem object at 0x00000150186DDA50>), so it's not None.
All the variables of the "setInfo" params has values too (As I wrote in the previous comment)
So what does make the "setInfo" to fail? (Maybe these specific string values makes it to fail?)
I follow the docs and I don't find anything wrong.
https://codedocs.xyz/AlwinEsch/kodi/grou...2888fb5f14

(In Kodi 17.6 it works perfectly)
Ok, I looked at your code again.  You posted it earlier as:

 listItem.setInfo(type="video", infoLabels={"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})

I think the valid options are:

infoLabels = "mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0}
listItem.setInfo(type="video", infoLabels)

or

 listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})

One of those should work for you.


Jeff
@jbinkley60 
Doesn't work.
You can't mix, positional argument follows keyword argument

The first options return a syntax error:

Code:
infoLabels={"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0}    
listItem.setInfo(type="video", infoLabels)

Code:
ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                  - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                 Error Type: <class 'SyntaxError'>
                 Error Contents: positional argument follows keyword argument (default.py, line 184)
                   File "D:\Program Files (x86)\Kodi v19.1 x64\portable_data\addons\plugin.video.israelive\default.py", line 184
                     listItem.setInfo(type="video", infoLabels)
                                                    ^
                 SyntaxError: positional argument follows keyword argument
               -->End of Python script error report<--

The second option return the same error:
Code:
listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})

Code:
ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                  - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                 Error Type: <class 'SyntaxError'>
                 Error Contents: positional argument follows keyword argument (default.py, line 184)
                   File "D:\Program Files (x86)\Kodi v19.1 x64\portable_data\addons\plugin.video.israelive\default.py", line 184
                     listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": 0, "season": 0})
                                                    ^
                 SyntaxError: positional argument follows keyword argument
                 -->End of Python script error report<--

I don't think this is the problem, I think maybe one of the variables valus cause a problem.
Although that in kodi 17.6 it's working well.
In addition, running the addon manually and playing it, setInfo doesn't make kodi to crash.
This is something with running the plugin with the external url and not the syntax.

By the way when doing "setInfo" it print to the logs this lines:
Code:
ERROR <general>: 127.0.0.1 - - [02/Sep/2021 00:14:19] "GET /?url=plugin://plugin.video.israelive/&channelid=3&mode=11 HTTP/1.1" 200 -
(Sometimes one, sometimes three times) then kodi crash.
Reply
#20
Ok, the likely problem is that season and episode need to be strings not integers.  Try this:


info = "mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": "0", "season": "0"}
listItem.setInfo(type="video", info)

or

 listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": "0", "season":"0"})

Also make sure channelName and programmeName are strings.  If unsure then change them to str(channelName) and str(programmeName).  I convert all of mine to strings for good measure.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#21
(2021-09-01, 23:56)jbinkley60 Wrote: Ok, the likely problem is that season and episode need to be strings not integers.  Try this:


info = "mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": "0", "season": "0"}
listItem.setInfo(type="video", info)

or

 listItem.setInfo(type="video", {"mediatype": "movie", "studio": channelName, "title": programmeName, "plot": description, "tvshowtitle": channelName, "episode": "0", "season":"0"})

Also make sure channelName and programmeName are strings.  If unsure then change them to str(channelName) and str(programmeName).  I convert all of mine to strings for good measure.


Jeff
@jbinkley60 
Still the same syntax error, you can't mix named argument with an argument.

If it was syntax issue the "setInfo" it wasn't working at all.
But as I said running in 17.6 (external url) or by enter to the addon and run it manually (v19) "setInfo" works.
There is something in the background the make setInfo to crash Kodi when running the addon with the external url I posted in the main comment.
Reply
#22
Ok, I am at a loss.  I checked the documentation and it says integer is the correct type for episode and season.  I think I am at the limit of my skills on this one.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#23
One other thought, which I ran across with porting my addon to Kodi 19, was when I was passing a URL to it was some default behavior with change Python 3.x (I don't remember which version of 3.x where this behavior changed) but I was unable to get my Kodi 19 version to properly parse a passed URL.  The change was in the urllib module as a security feature where semicolons were not allowed.  I ended up adding some code to check for this.  My point is that it isn't working when called externally and I believe sys.argv is used to pass everything to the addon when called this way so you might look at your sys.argv parsing and ensure you are getting the correct arguements after parsing.  I'd write the sys.argvs to the Kodi logfile and look for any differences, after parsing.  Your issue doesn't look to be semicolon related but url parsing with the different urllib library versions between Python 2 and 3 is different.  It took me awhile to find my issue.

Here's my before and after code:

Kodi 18

addon = xbmcaddon.Addon()
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])


Kodi 19

addon = xbmcaddon.Addon()
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
argmod = sys.argv[2][1:].replace(';','&')    #  Handle change in urllib parsing to default to &
args = urllib.parse.parse_qs(argmod)
 


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#24
@jbinkley60 
It doesn't seems that there is a problem with the sys.argv.
It parse it correctly.
But maybe one of the encoding/decoding that I remove do somthing, I don't know.
When it running the setInfo kodi crashes, I tryied set another values to the parameters it gets but still the same.

Code:
sys.argv[0]: plugin://plugin.video.israelive/
sys.argv[1]: 25
sys.argv[2]: ?channelid=3&mode=11

Code:
params = dict(urlparse.parse_qsl(sys.argv[2].replace('?','')))

Code:
params: {"channelid": "3", "mode": "11"}
mode: 11
channelID: 3
Reply
#25
Ok, that looks fine from a parsing output.  For the setinfo I'd instrument all of the inflabel variables into the Kodi logfile and run the addon and internally call it where it works and then call it externally when it crashes and see which variables are different.  Something has to be different otherwise setinfo would work.  You might also try utf-8 encoding the URL that is calling the addon (if it had utf-8 encoding in your pre-Kodi 19 version).

As an FYI, here's a sample of how I build all of my info dictionary variables.  I default everything unless I get a better value from my uPNP server.  This way I know there won't be any issues:

                episode_text = ''
                episode = item.find('.//{urnConfusedchemas-upnp-org:metadata-1-0/DIDL-Lite/}episode')
                if episode != None:
                    episode_text = episode.text
                 
                season_text = ''
                season = item.find('.//{urnConfusedchemas-upnp-org:metadata-1-0/DIDL-Lite/}season')
                if season != None:
                    season_text = season.text
                 
                playcount = 0
                playcount_text = ''
                playcountElem = item.find('.//{urnConfusedchemas-upnp-org:metadata-1-0/DIDL-Lite/}playcount')
                
                if playcountElem != None:
                    playcount_text = playcountElem.text
                    playcount = int(playcount_text)



Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#26
@jbinkley60 

Regarding your first thought:
I checked the variable by printing them to the log on those cases:
- Kodi 17.6 (Internal/External)
- Kodi 19.1 (Internal/External)

All of them show exactly the same values of the setInfo params.

Regarding the second thought:
The external url is parsed in Kodi level and pass as sys.argv to the addon.
The sys.argv parsed diffferently due to py2-py3 changes, but the values are the same. (urlparse.parse_qsl ===> urllib.parse.parse_qsl)
We already saw that it works correctly: Running the correct plugin and parses the external url with the correct parameters.
I didn't see any decoding/encoding relevant issue.

What I see in the logs that Kodi for some reason running again the plugin immediatly after the first try failed by the setInfo failure.
After the second time kodi is crashing.

I think the problem is in Kodi System level and not Addon level.
Something has changed between Kodi 17 to Kodi 19 about running addons by external url.
Reply
#27
@jbinkley60 

A new finding:
Also listItem.setArt makes Kodi to crash.
So it seems a problem with all the functions that relates to the "ListItem".
Reply
#28
Interesting.  I've never called an addon via a URL.  Is there an option to use the Kodi built-in RunScript or RunAddon functions ?  I use RunScript all the time and pass variables.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#29
(2021-09-04, 17:00)jbinkley60 Wrote: Interesting.  I've never called an addon via a URL.  Is there an option to use the Kodi built-in RunScript or RunAddon functions ?  I use RunScript all the time and pass variables.


Jeff
@jbinkley60 

I don't understand what have you meant by "RunScript or RunAddon functions",

But according to the log kodi run the plugin and this is what I see in the log:

Kodi 17.6
Code:
DEBUG: XFILE::CPluginDirectory::StartScript - calling plugin GlobeTV('plugin://plugin.video.israelive/','19','?channelid=3&mode=11')

Kodi 19.1:
Code:
DEBUG <general>: XFILE::CPluginDirectory::StartScript - calling plugin GlobeTV('plugin://plugin.video.israelive/','2','?channelid=3&mode=11','resume:false')

There is an additional new arg "resume", but it's there also when running the item internally from the addon.
So I'm in doubt if it relates the problem.

I'm basically using the external url to play a specific element in one of the addon menus.
But when it reaches to one of the ListItem's functions, the addon crash at first, then it seems to try a second chance by running the pluging again, then kodi crashes too when it gets to the same point  :/

The crash log shows the Thread id of this log (I guess it's a Kodi Thread)
Reply
#30
I understand that you are using a URL to call the addon.  What I am less clear about is what is generating the URL and instead of generating a URL to call the addon can it use either "RunScript or RunAddon functions" ?  What you are seeing in the logs is Kodi translating the URL to a native RunScript command internally.  My question is whether the URL approach can be bypassed and use the direct native approach ?  Maybe not and in the end you may be 100% right in that setting info from an externally addon call for a listitem may have gotten broken with Kodi 19.  The Kodi developers need to weigh in here.  I don't do any listitem creation with any of my RunScript calls. 


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
v19 - Can't playing local plugin url (Kodi crashes)0