service.iptv.manager icon indicating copy to clipboard operation
service.iptv.manager copied to clipboard

Refresh.....

Open Cisse-Moes opened this issue 3 years ago • 19 comments

Hello kodi lovers! I have libreelec running on a mini ashrock. Works fine . Only if I close it and I start again the same day, then the iptv manager does its thing and I get all channels listed as well as the timeline. But when I start the next day everything stays blank. And do I have to refresh manually in the app. I suspect that if this boot, the channels will not be refreshed, but as far as I can see I cannot set this anywhere. Or is there another solution? greetings Cisse

Cisse-Moes avatar Mar 26 '21 20:03 Cisse-Moes

Hi @Cisse-Moes , I have similar issues. In my opinion the problem is that during update in iptvsimple.py errors can happen (other addons not responding) that are causing an uncomplete or empty epg.xml / playlist.m3u8. In case of error the writing of new files should be prevented. Once this problem is solved a more frequent update is possible as now you have to wait one hour to get a valid stream in your epg.

frankdpGH avatar Mar 27 '21 10:03 frankdpGH

@frankdpGH If an add-on fails to return data, it is excluded, but it should not cause an incomplete or empty EPG. If this is the case, it is a bug. I have not seen this myself (and we have seen our fair share of failing add-ons during development).

One improvement is to fall back to cached information when an add-on fails, but that has other implications (more memory use, or more disk activity). Disk activity wears out SD cards.

In any case, this is a corner case and a failing add-on always shows a notification during update. It is probably more effective to ensure add-ons work reliably.

dagwieers avatar Mar 27 '21 14:03 dagwieers

Thanks @dagwieers for the quick response. The main cause of errors is that my Android TV Box goes in standby and Kodi remains running. This causes wrong behavior. I have blocked the error by comparing filesize before renaming in iptvsimple.py. I believe that writing an empty epg as mentioned above should not happen. I'm also pushing more frequent updates (every 10 Mins instead of 1 hour) to have up to date epg links, maybe this is pushing the error too.

frankdpGH avatar Mar 27 '21 14:03 frankdpGH

Some Log material as example of partial disappearing of channels. See Kodi.Log at 18:21 Refresch started after resuming from standby. Different error messages popping up from addons VRT Radio, Go Play, VTM Go. After refresh all VTM channels have disappeared. At 18:44 new manual refresh : all restored. So in the first refresh I would prefer that epg.xml and playlist.m3u8 is not updated in case of error. IPTV_Manager_Refresh_error.zip

frankdpGH avatar Mar 27 '21 18:03 frankdpGH

I haven't looked at the log, but I assume that when there is no network connection (yet) after returning from standby, you'll probably get this behaviour.

michaelarnauts avatar Mar 27 '21 21:03 michaelarnauts

Maybe there is a way for IPTV Manager to check if there is network connectivity.

But yes, if all add-ons fail for this reason, you may end up with nothing. If there is nothing, maybe IPTV should not be writiing to disk.

And at least the channel listing could be cached in memory for when an add-on fails to work.

dagwieers avatar Mar 27 '21 22:03 dagwieers

Hi :) Is there any news ? I don't know why but it happens almost each day and I have to manually refresh the list (plus I only have less than 20 Channels but it takes like 5 Minutes to complete).

daufinsyd avatar May 03 '21 09:05 daufinsyd

@daufinsyd Since you can easily reproduce this, it could help if you looked at the code to find the actual cause, or a quick fix for this. Python code is quite easy to read/modify and the logic is not that hard.

dagwieers avatar May 03 '21 10:05 dagwieers

Hi @dagwieers I'm no python dev but since get_epg() seems to return an empty dict if there is no data (or invalid data), one could simply check that before epg.append(addon.get_epg()).

epg_data = addon.get_epg()
if epg_data:
  epg.append(addon.get_epg())
else:
  # append the current configuration for the channel

get_channels() seems to be analog but with array.

daufinsyd avatar May 03 '21 10:05 daufinsyd

I took a look at your logfile, but it's not really clear what causes this issue. IPTV Manager is supposed to open a port on 127.0.0.1, and asks the Addon to send data to that port, but somehow, the add-on gets a Connection refused error, and IPTV Manager gets a timeout, as if there is a firewall or something on the device blocking the requests?

Are you using a special setup for a VPN or something that changes the network settings?

michaelarnauts avatar May 03 '21 15:05 michaelarnauts

Hi,

Same issue for me on Kodi 18 (raspberry 4). Need to refresh channels manually, it often solve the pb. But sometimes a kodi restart is needed. I've tried to setup librelec to wait for network connection before launching Kodi but it didn't solve the issue.

thedude4ever avatar May 05 '21 20:05 thedude4ever

Hi @popiggy, do you also have the ConnectionRefusedError error in your log?

We also have the same issue for users of Catch-up TV & More (https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/issues/507#issuecomment-841965435)

sy6sy2 avatar May 17 '21 06:05 sy6sy2

Hi @sy6sy2 Don't see any connection refused error, only these ones:

ERROR: [service.iptv.manager] [resources.lib.modules.addon] Something went wrong while calling plugin.video.catchuptvandmore: [Errno -5] No address associated with hostname

ERROR: AddOnLog: PVR IPTV Simple Client: Unable to load channels from file '/storage/.kodi/userdata/addon_data/service.iptv.manager/playlist.m3u8': file is corrupted

thedude4ever avatar May 17 '21 11:05 thedude4ever

@michaelarnauts, another user of CUTV&M also have this ConnectionRefusedError error with an Android TV device (see log here https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/issues/507#issuecomment-841965435).

sy6sy2 avatar May 17 '21 11:05 sy6sy2

Me again.

If you look at the log given here https://github.com/add-ons/service.iptv.manager/issues/82#issuecomment-808775468 you can see that:

  • At 18:21:06.139 IPTVManager open a socket on 45699 and call plugin://plugin.audio.vrt.radio/iptv/channels.
  • At 18:21:17.412 IPTVManager trigger a timeout because 10 seconds have elapsed.
  • At 18:21:20.481 VRT get a ConnectionRefusedError. No surprise here, because at 18:21:17.412 IPTVManager closed the socket on which VRT try to connect.

So, the hypothesis is that just after Kodi starts on Android, Kodi doesn't have an internet connection during the first seconds. So, the video plugins are not able to send channels/epg to IPTVManager and they get a timeout.

Maybe two solutions to try:

  • Delayed the first IPTVManager refresh process
  • If IPTVManager get a timeout for one plugin, keep the previous channels and TV guide.

(Thank you @Psychoses for the help)

sy6sy2 avatar May 17 '21 13:05 sy6sy2

Maybe increase this one ? (like a temp fix for hurry people) i have set the timeout to None and all seems fix

https://github.com/add-ons/service.iptv.manager/blob/513e25d8ce564299628d5f84661c28a472b2709c/resources/lib/modules/addon.py#L254

https://github.com/add-ons/service.iptv.manager/blob/513e25d8ce564299628d5f84661c28a472b2709c/resources/lib/modules/addon.py#L258

Psychoses avatar May 17 '21 13:05 Psychoses

I noted different timing on kodi startup case. I have analyse this sequence on many device :

Waiting for a connection part 1 (m3u)
[Catch-up-TV-&-More.support] Route Execution Time part 1
Closing socket

Waiting for a connection part 2 (epg)
[Catch-up-TV-&-More.support] Route Execution Time part 2
Closing socket

The total time of the full process is between 8s and 5min.

Summary

faster => slower

Device
AMD Ryzen 7 3700X / Xiaomi Redmi Note 4 / Xiaomi MIBOX3 / TCL BeyondTV2

Waiting for a connection part 1 (m3u) => Connected to 127.0.0.1
2s / 21s / 56s / 1min6

[Catch-up-TV-&-More.support] Route Execution Time part 1
166ms / 4s / 4s / 3s

Waiting for a connection part 2 (epg) => Connected to 127.0.0.1
2s / 17s / 40s / 1min4

[Catch-up-TV-&-More.support] Route Execution Time part 2
4s / 22s / 55s / 2min45

Total
8s / 1min10 / 2min30 / 5min

detailed report.txt

Psychoses avatar May 22 '21 10:05 Psychoses

Maybe increase this one ? (like a temp fix for hurry people) i have set the timeout to None and all seems fix

https://github.com/add-ons/service.iptv.manager/blob/513e25d8ce564299628d5f84661c28a472b2709c/resources/lib/modules/addon.py#L254

https://github.com/add-ons/service.iptv.manager/blob/513e25d8ce564299628d5f84661c28a472b2709c/resources/lib/modules/addon.py#L258

Hi @Psychoses : thanks for this hint. Indeed with "timeout = None" all error messages are gone and the xml files are complete. 10 secs is too low, maybe a settings.xml possibility? Indeed the update routine will take will take a few seconds more, but it is not annoying and there are no more errors in the log.

frankdpGH avatar Jun 23 '21 15:06 frankdpGH

@frankdpGH No prob. Thx you for your log @ https://github.com/add-ons/service.iptv.manager/issues/82#issuecomment-808775468, This help us a lot to locate the problem.

I don't know what is the best soluce here, i'm not the main dev and not a expert.

I think, for end user like us, we can just use none here until @dagwieers or @michaelarnauts take the right decision.

Psychoses avatar Jun 23 '21 22:06 Psychoses