VideoAddon Questions
#1
Lightbulb 
Hi there, I am beginner in Python Development, I have managed to make my Addon Working but:

When going to, Video->Video Addons->TestPlugin, it takes little long to load, Its noting to worry about because it just opening website, and getting fresh links for videos(live tv with token) and showing it up as a list, with updated links every time when You are opening that addon,

I have couple of questions, I have tried doing it without python as an xml file, but i cannot use it because token is generated lets say once in couple of hours, so i would have to change update xml manually, or run python script with delay every 1 min, to keep those links updated,

But, i have several sources of one channel and is it any chance to make listings manually as a folders eg. Channel 1, Channel 2, etc...
and inside channel folders, if you go inside of it then run python script for resolving url for those channels?

Also if channel has wrong any of url will not go as a SCRIPT FAILED just let other channels to show up except broken ones maybe instead of
channel 1 - source 1 it would show channel 1 - source 1 failed or something??

Any thoughts? thanks, a lot.
Here is my example code for one of them:

Quote:#Nickolodeon start
urlsNICKELODEON = "http://www.example.net/mobillinks/player.php?playerurl=http://111.22.242.126/streamer/?d=140289"
regextokensNICKELODEON = '<a href="(.+?)"><div class="btn_container">'
patternNICKELODEON = re.compile(regextokensNICKELODEON)
len(urlsNICKELODEON)
htmlfile = urllib.urlopen(urlsNICKELODEON)
htmltext = htmlfile.read()
videourlNICKELODEON = re.findall(patternNICKELODEON, htmltext)
videourlNICKELODEONstr = str(videourlNICKELODEON)
surlNICKELODEON = videourlNICKELODEONstr.replace("['", "")
surlNICKELODEON2 = surlNICKELODEON.replace("']", "")

li = xbmcgui.ListItem('NICKELODEON', iconImage='http://pixelatedpop.com/sites/default/files/u3/(Nick)NickShows.jpg')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=surlNICKELODEON2, listitem=li)
#print surlNICKELODEON2

I Was thinking if
Quote: url=surlNICKELODEON2
could be
Quote: url=execbuildin(NICKELODEON2.py)
then if url would be taken of python resolver just before you press play on that stream list?
Reply
#2
- add the items as files not directories. encode all info you need to identify an item in the plugin url.
- when a user clicks an item in xbmc, you then get a callback to your plugin with this url.
- resolve the actual playback url, and return it with setResolvedUrl()
- world domination.
Reply
#3
(2014-08-12, 11:36)ironic_monkey Wrote: - add the items as files not directories. encode all info you need to identify an item in the plugin url.
- when a user clicks an item in xbmc, you then get a callback to your plugin with this url.
- resolve the actual playback url, and return it with setResolvedUrl()
- world domination.

Thanks for Your reply.
So adding a list as a directory would be done this way:

li = xbmcgui.ListItem('NICKELODEON', iconImage='http://pixelatedpop.com/sites/default/files/u3/(Nick)NickShows.jpg')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=surlNICKELODEON2, listitem=li folder=true)
Then add stream list after adding directory.
Will i need to remove url section? Coz i dont want to resolve it streight away.
Reply
#4
url needs to be a plugin url as i said. See e.g. plugin.video.rbk.no for an example.
Reply
#5
Hi there again, thanks for your reply.
Would you like to help me with that kind of url?

surlholo = 'rtmp://195.168.22.241:2451/live swfUrl=http://example.com/static/sk/shared/swf/flowplayer.commercial-3.2.4.swf live=true pageUrl=http://example/player/LiveStream.php?channel=holo swfVfy=true playpath=holo.sdp'


xbmc.executebuiltin( "PlayMedia("+surlholo+")" )

Cant figure out how should i make it working?

// edit that was my fault url what i tried to play it has never worked... tried other one and with this code it does work.. thanks
Reply

Logout Mark Read Team Forum Stats Members Help
VideoAddon Questions0