Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"?
#1
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 ?
Reply
#2
(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)
Reply
#3
this works Smile
xbmc.executebuiltin( "PlayMedia(pvr://channels/radio/All channels/pvr.dvbviewer_406.pvr)" )
Reply
#4
old thread, but hoping someone can tell me where pvr://channels/tv/All channels/pvr.iptvsimple_ numbers are listed ... thanks
Reply

Logout Mark Read Team Forum Stats Members Help
How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"?0