add-ons / service.iptv.manager

Integrate TV and radio channels with EPG data from other add-ons in Kodi PVR.
https://github.com/add-ons/service.iptv.manager/wiki
GNU General Public License v3.0
95 stars 28 forks source link

An invalid program can be played if the EPG is outdated and programs are shifted #29

Closed michaelarnauts closed 4 years ago

michaelarnauts commented 4 years ago

We currently are passing the start-timestamp of a program to the addons, and they can figure out the program to start. But since the latest EPG can shift a bit compared to the one that IPTV Manager is used, it's possible that the previous program is started when playing from the EPG.

I've noticed this happening with VRT NU, they are keeping their EPG up to date quite often.

This doesn't happen in Matrix, since there we can use the correct URL to directly play the program, by using the stream field from the JSON-EPG that is stored in the catchup-id field in the xmltv.

We should do a lookup for this field in Kodi 18, so we can use the direct plugin:// url.

michaelarnauts commented 4 years ago

Another way could be to use the stream info from the JSON-EPG to directly start the program. In Kodi 19, this is how it works in iptv.simple itself, in Kodi 18, IPTV Manager would need to parse the xmltrv (or use a cached JSON-EPG dict) to find out the url.

MarcelRoozekrans commented 4 years ago

I also noticed that using the times is far form ideal, as the minutes can shift and indeed easily fetched the wrong program. The Kodi 19 stream approach is ideal as I know the id's of the streams I can fetch later on when requested.

michaelarnauts commented 4 years ago

I think that will be the better approach. We can even drop the vod of the JSON-STREAMS then.

It would be awesome if I could find a way to get more information about the selected EPG-program in Kodi 18, but so far, I haven't found anything. I've noticed that anything you put after a [CR] of the program's name isn't displayed in the UI, so that might be another hack we could use if we find nothing else.

mediaminister commented 4 years ago

Adding an end timestamp to the VRT NU add-on airdate url may help: For instance: plugin://plugin.video.vrt.nu/play/airdate/ketnet/2020-06-09T06:24:00/2020-06-09T06:30:00

If would also help if you can provide some examples of wrong behaviour.

MarcelRoozekrans commented 4 years ago

Adding an end timestamp to the VRT NU add-on airdate url may help: For instance: plugin://plugin.video.vrt.nu/play/airdate/ketnet/2020-06-09T06:24:00/2020-06-09T06:30:00

If would also help if you can provide some examples of wrong behaviour.

This is what I use now, but what will happen if there is a sudden change in the aired programs ? This logic will select the wrong program to play.

MarcelRoozekrans commented 4 years ago

I think that will be the better approach. We can even drop the vod of the JSON-STREAMS then.

It would be awesome if I could find a way to get more information about the selected EPG-program in Kodi 18, but so far, I haven't found anything. I've noticed that anything you put after a [CR] of the program's name isn't displayed in the UI, so that might be another hack we could use if we find nothing else.

What will happen if there are multiple add-ons supplying the same epg, or even a slightly different one ?

I saw some logic that the player could be choosen if there are multiple supplying these channels.

mediaminister commented 4 years ago

what will happen if there is a sudden change in the aired programs ? This logic will select the wrong program to play.

The logic (using begin and end timestamps) should always select the right program either from the VOD service using realtime EPG data or from the 24-hour livestream cache if there is no VOD available yet.

If this logic currently fails for VRT NU, that means the logic contains a bug that can be fixed. That's why I need examples of wrong behaviour.

michaelarnauts commented 4 years ago

This is not a issue in VRT NU, but it's an issue in IPTV Manager. It used outdated EPG data to select a program, and since it uses only the start time, it can select an earlier program if the requested program is shifted later.

An intermediate solution could be to select the middle of the program, but the right fix is to find a way to use the stream field of the JSON EPG.

MarcelRoozekrans commented 4 years ago

This is not a issue in VRT NU, but it's an issue in IPTV Manager. It used outdated EPG data to select a program, and since it uses only the start time, it can select an earlier program if the requested program is shifted later.

An intermediate solution could be to select the middle of the program, but the right fix is to find a way to use the stream field of the JSON EPG.

You mean the catchup-id field in the EPG.xml ?

mediaminister commented 4 years ago

This is not a issue in VRT NU

I know the real issue is using outdated EPG data. But VRT NU airdate logic can be improved when start and end timestamps are provided. Using the middle of the program in the VRT NU airdate logic is indeed a more failsafe approach.

mediaminister commented 4 years ago

I made two pull requests to improve on this:

michaelarnauts commented 4 years ago

I've updated the issue description to describe the real fix.

michaelarnauts commented 4 years ago

I would say this is fixed by #33 and #34.