Annoyance extra &amp
#1
Brick 
Hi there,

Im would like to set string as follows
Code:
xbmc.executebuiltin("Skin.SetString(AddonSetSeven.3.Path,PlayMedia("plugin://plugin.video.someaddon/?url=27&;mode=125&name=News&iconimage=http%3A%2F%2Fstatic.website.com%2Fcouch%2Fchannels%2F27%2Fextra_big_logo.png&start=na&ch_fanart=na",return))")

but when I run the python program it adds extra & as follows
Code:
PlayMedia("plugin://plugin.video.somaddon/?url=27&;mode=125&name=News&iconimage=http%3A%2F%2Fstatic.website.com%2Fcouch%2Fchannels%2F27%2Fextra_big_logo.png&start=na&ch_fanart=na",return)

breaking the shortcut. I have masked addon and website on purpose in case it can't be mentioned here.

Confused I hope I have explained ok

how can i stop this please. Thank-you for any assistance.
Reply
#2
i don't think you want that xml encoding. the xml encoding is because skin stuff is usually stored in xml files.

you want
Code:
xbmc.executebuiltin("Skin.SetString(AddonSetSeven.3.Path,PlayMedia(\"plugin://plugin.video.someaddon/?url=27&mode=125&name=News&iconimage=http%3A%2F%2Fstatic.website.com%2Fcouch%2Fchannels%2F27%2Fextr​a_big_logo.png%26start=na%26ch_fanart=na\",return))")

ie. escaped quotes (due to python), and url-encoded url (due to url-in-url). but no xml encoding.
Reply
#3
Brick 
(2016-06-30, 13:57)ironic_monkey Wrote: i don't think you want that xml encoding. the xml encoding is because skin stuff is usually stored in xml files.

you want
Code:
xbmc.executebuiltin("Skin.SetString(AddonSetSeven.3.Path,PlayMedia(\"plugin://plugin.video.someaddon/?url=27&mode=125&name=News&iconimage=http%3A%2F%2Fstatic.website.com%2Fcouch%2Fchannels%2F27%2Fextr​a_big_logo.png%26start=na%26ch_fanart=na\",return))")

ie. escaped quotes (due to python), and url-encoded url (due to url-in-url). but no xml encoding.

Ironic_Monkey,
thats almost done it. thanks. the only problem Im getting now is
Code:
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.NameError'>
                                            Error Contents: name 'ch_fanart' is not defined
                                            Traceback (most recent call last):
                                              File "/home/usuario/.kodi/addons/plugin.video.someaddon/default.py", line 1164, in <module>
                                                play_***mon(name, url, iconimage, ch_fanart)
                                            NameError: name 'ch_fanart' is not defined
                                            -->End of Python script error report<--

I have checked, double checked and compared with similar strings from the same addon the only difference seems to be that the good entry ends as so
Big Grin
Code:
**correct ending**extra_big_logo.png&amp;start=na&amp;ch_fanart=na&quot;,return)</setting>
but what I am getting is
Sad
Code:
**bad ending** extra_big_logo.png%26start=na%26ch_fanart=na&quot;,return)</setting>

so it seems the problem is with the
Code:
%26


any more ideas please, Thank you for the help.
Reply
#4
(2016-06-30, 15:06)myfototv Wrote:
(2016-06-30, 13:57)ironic_monkey Wrote: i don't think you want that xml encoding. the xml encoding is because skin stuff is usually stored in xml files.

you want
Code:
xbmc.executebuiltin("Skin.SetString(AddonSetSeven.3.Path,PlayMedia(\"plugin://plugin.video.someaddon/?url=27&mode=125&name=News&iconimage=http%3A%2F%2Fstatic.website.com%2Fcouch%2Fchannels%2F27%2Fextr​a_big_logo.png%26start=na%26ch_fanart=na\",return))")

ie. escaped quotes (due to python), and url-encoded url (due to url-in-url). but no xml encoding.

Ironic_Monkey,
thats almost done it. thanks. the only problem Im getting now is
Code:
NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.NameError'>
                                            Error Contents: name 'ch_fanart' is not defined
                                            Traceback (most recent call last):
                                              File "/home/usuario/.kodi/addons/plugin.video.someaddon/default.py", line 1164, in <module>
                                                play_***mon(name, url, iconimage, ch_fanart)
                                            NameError: name 'ch_fanart' is not defined
                                            -->End of Python script error report<--

I have checked, double checked and compared with similar strings from the same addon the only difference seems to be that the good entry ends as so
Big Grin
Code:
**correct ending**extra_big_logo.png&amp;start=na&amp;ch_fanart=na&quot;,return)</setting>
but what I am getting is
Sad
Code:
**bad ending** extra_big_logo.png%26start=na%26ch_fanart=na&quot;,return)</setting>

so it seems the problem is with the
Code:
%26


any more ideas please, Thank you for the help.

Problem Solved wherever there is a
Code:
&amp;
just leave the
Code:
&
and remove
Code:
amp;
when uning the
Code:
xbmc.executebuiltin("Skin.SetString

Thank you Ironic Monkey for helping me to solve this
Reply

Logout Mark Read Team Forum Stats Members Help
Annoyance extra &amp0