Hi Guys
after 2 months, because I don't know anything about python, json and .xml, I have obtained the two information and I have my custom skin.
I watch for 90% of my time the Live TV
I create the epg file with all the information I need (title, episodes, description, poster etc ...) with webgrab+ and I pass the info to tvheandend.
This (I don't understand anything about python and json) is the script I created, one for the poster and one for episodename
Code:
import xbmc
import xbmcaddon
import xbmcgui
import json
from json import dumps
addon = xbmcaddon.Addon()
def NextEpisodeName():
json_string = {'jsonrpc': '2.0', 'id': 'VideoGetItem', 'method': 'Player.GetItem', 'params': {'playerid':1}}
json_string = json.dumps(json_string)
result = xbmc.executeJSONRPC(json_string)
json_rpc = json.loads(result)
chid = json_rpc['result']['item']['id']
json_name = {'jsonrpc': '2.0', 'id': 1, 'method': 'PVR.GetChannelDetails', 'params': {'channelid': int(chid), 'properties': ['broadcastnext']}}
json_name = json.dumps(json_name)
result = xbmc.executeJSONRPC(json_name)
result = json.loads(result)
try:
return result['result']['channeldetails']['broadcastnext']['episodename']
# return result['result']['channeldetails']['broadcastnext']['thumbnail']
except:
return
xbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('MyLabel', NextEpisodeName())
The scripts are the same only the result is different, there is a metod for use only one script ? (I spent two weeks but I'm not able)
In my custom skin I use these
Code:
<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog" id="1106">
<onload>RunScript(script.nextepgposter)</onload>
<onload>RunScript(script.nextepisode)</onload>
<defaultcontrol always="true">9000</defaultcontrol>
<animation effect="fade" start="0" end="100" time="100" delay="500">WindowOpen</animation>
<controls>
<control type="group">
<visible>Window.isActive(fullscreenvideo)</visible>
<include>ColoredBackgroundImages</include>
</control>
<control type="group"> <!-- Screen Info NEXT -->
<include content="ContentPanel">
<param name="left" value="946" />
<param name="width" value="994" />
<param name="top" value="-20" />
</include>
<control type="image" id="1">
<include>OpenClose_Right</include>
<left>1020</left>
<top>180</top>
<width>280</width>
<height>340</height>
<aspectratio align="center" aligny="center">keep</aspectratio>
<texture fallback="DefaultTVShows.png">$INFO[Window(12005).Property(MyPoster)]</texture>
</control>
<control type="label" id="1">
<include>OpenClose_Right</include>
<left>980</left>
<top>90</top>
<width>940</width>
<height>150</height>
<align>center</align>
<shadowcolor>text_shadow</shadowcolor>
<label>$INFO[Window(12005).Property(MyLabel)]</label>
</control>
........
Thanks in advace