epg icon indicating copy to clipboard operation
epg copied to clipboard

Fix: elcinema.com wrong times

Open aahmyu opened this issue 2 years ago • 3 comments

Describe your issue

I tried this source and it looked fine except that all the times are shifted by a few hours.

I cloned the repo and ran the script locally and the times are correct.

It seems that the times are using the local time zone of the script, so the will never work globally.

Is this the intended behavior?

aahmyu avatar Aug 20 '22 18:08 aahmyu

You are right, the problem is in the wrong time zone, or more precisely in the conversion from the local time (specified on the site) to UTC.

Every time we make a request to elcinema.com, it tries to determine our time zone by our IP and adjust dates in the guide accordingly.

But because we use GitHub servers located all over the world, we can not specify any specific time zone in config in advance.

I tried to solve this problem with automatic time zone detection (https://github.com/iptv-org/epg/blob/master/sites/elcinema.com/elcinema.com.config.js#L80), but from my observations, it did not help.

But maybe someone else can find a solution to this problem in the future.

freearhey avatar Aug 28 '22 17:08 freearhey

https://github.com/szenius/set-timezone Could you use this to action environment to a specific timezone, then use the same tz in config.js

RevGear avatar Sep 21 '22 13:09 RevGear

The thing is that the time zone specified on server does not matter. The output on the site only changes when the IP address changes. On our side, we have only to guess the result for which country we received the response.

Here are some examples:

UK IPv4, no cookies (Europe/London: UTC+1) image

Germany IPv6, no cookies (Europe/Berlin: UTC+2) image

But just in case I'm missing something, you can try to add this action to the workflow yourself and test it locally with nektos/act. What if it really helps.

freearhey avatar Sep 21 '22 21:09 freearhey

Random idea that will possibly complicate things more than it will help but could we add an step that query the ipconfig.io site to check where the runner is located and only continue if we receive a runner located in X country.

PopeyeTheSai10r avatar Nov 22 '22 22:11 PopeyeTheSai10r

if we receive a runner located in X country

And what country should it be?

freearhey avatar Nov 23 '22 03:11 freearhey