JSON, Websocket and live EPG - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: JSON, Websocket and live EPG (/showthread.php?tid=341710) |
JSON, Websocket and live EPG - danofun - 2019-03-07 Greetings! I'm attempting to build a rudimentary web interface to send Kodi a few commands. I'd like to display what is currently airing on a few specific PVR channels. Thanks to a few examples on these forums, I'm able to connect to Kodi via websocket and retrieve the current on-air data. However, when the next program goes to air the EPG data does not update. Am I missing something or does a change to broadcastnow not trigger a websocket message? Is there another way to acquiring live updated JSON data? You help is greatly appreciated!
RE: JSON, Websocket and live EPG - danofun - 2019-03-15 A change in EPG does not trigger a websocket message. One solution is to send a command at a set interval which will trigger a websocket message.
RE: JSON, Websocket and live EPG - MrTarantula - 2019-03-15 It looks like you're only calling PVR.GetChannelDetails only when you open the socket connection. When Autoupdate() runs, r will be null, because on_message will be trying to parse the results from Player.GetItem. Try this:
RE: JSON, Websocket and live EPG - MrTarantula - 2019-03-15 But I hate using timeouts and intervals, so I would check that the value of j.result.channeldetails.broadcastnow is not null when receiving any message, and if it is, then you know you received a notification, and should update the name. This is quick and dirty (and untested):
RE: JSON, Websocket and live EPG - danofun - 2019-03-16 @MrTarantula Thank you for the reply. I think I have a slightly better grasp on Kodi's websocket request results and notifications. FWIW I put together a front-end controller for the upcoming NCAA basketball tournament. It is currently in a working state but could use some cleanup. Hopefully there's something in there that can help out a future developer. RE: JSON, Websocket and live EPG - konrul - 2021-11-21 Hello, I am able to get EPG data (live PVR TV title) which is what I want to get (I couldn't quote the entry, 3rd entry of this thread is working for me; https://forum.kodi.tv/showthread.php?tid=341710&pid=2834357#pid2834357 ). However, the "channelid" is changing every day as a random number. Therefore, I want to get channelid from channel name in my list. How can I do that? @danofun I have seen your codes in github (danofun/MarchMadnessTVControl). In that file, you have just defined channel names and the system can get channelid automatically. I want to do so as simple as the codes above. I am sorry if my language is bad. I will be thankful of your help. Thanks in advance. |