(2019-12-17, 16:32)wedok Wrote: i only found this:
xbmc.executebuiltin("PlayMedia(pvr://channels/radio/All channels/pvr.hts_1595007353.pvr)")
Now, what is the correct pvr.hts_xxxxxxxxxx.pvr for my Radio Channel 91 ?
This is what I do. I have this set under my master profile so at startup a specific channel starts playing. It basically waits for the pvr service to start up and then loads the channel. You would probably want to replace references to Channel91 in the code with what you need but hopefully it helps you to put together something that works. By the way I'm running this on Kodi 17.6 so not sure if it will work properly on the newer versions.
python:
import xbmc
import time
import json
xbmc.log('[AUTOEXEC] Started.',level=xbmc.LOGNOTICE)
i = 1
while i < 100:
if xbmc.getCondVisibility("Pvr.HasTVChannels"):
xbmc.log('[AUTOEXEC] PVR ready.',level=xbmc.LOGNOTICE)
json_channels = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelgroupid": "alltv", "properties" :["uniqueid"]},"id": 1}')
json_channels_data = json.loads(json_channels)
for j in json_channels_data['result']['channels']:
if j['label'].startswith("Channel91"):
xbmc.log('[AUTOEXEC] Found Channel91: ' + str(j['uniqueid']),level=xbmc.LOGNOTICE)
xbmc.executebuiltin('Notification(Loading Channel91 ...,,5000)')
xbmc.executebuiltin('PlayMedia(pvr://channels/tv/All channels/pvr.iptvsimple_' + str(j['uniqueid']) + '.pvr)')
break
break
else:
xbmc.log('[AUTOEXEC] PVR not yet ready.',level=xbmc.LOGNOTICE)
i += 1
time.sleep(2)
xbmc.log('[AUTOEXEC] Finished.',level=xbmc.LOGNOTICE)