Kodi Community Forum
How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? (/showthread.php?tid=350179)



How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? - wedok - 2019-12-17

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 ?


RE: How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? - GavinCampbell - 2019-12-17

(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)



RE: How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? - wedok - 2019-12-17

this works Smile
xbmc.executebuiltin( "PlayMedia(pvr://channels/radio/All channels/pvr.dvbviewer_406.pvr)" )


RE: How to Play PVR Radio Channel with the Channel Number 91 with "Autoexec.py"? - Gtmnyc - 2020-11-12

old thread, but hoping someone can tell me where pvr://channels/tv/All channels/pvr.iptvsimple_ numbers are listed ... thanks