Epg offset tutorial by @ravstar

There are 137 replies in this Thread which was already clicked 17,887 times. The last Post () by k3k.

  • NEW INSTRUCTIONS & UPDATED SCRIPT 28/11/2021 v1.2


    What's new in v1.2

    * No need to uninstall the previous version before updating to new version.

    * Script will automatically remove the old cron without deleting other crons in the list.

    * Daily update time changed to 06:10am as some providers update their epg.xml at 6:00am hence the script was unable to fetch the data at 6:00am.


    Please note: This version will automatically remove the previous version of this script.


    How to fix offset EPG of your IPTV provider i.e. if your epg is ahead or behind and showing wrong program information. You can adjust the offset time between any range from 1 minute to up to 23 hours.


    HOW DOES IT WORK: The below script will fix the offset time issue of your provider's epg by downloading it onto your HDD and fixing it so you get the correct programme guide. This will also setup a daily cron that will update the data everyday at 6:00am


    PLEASE NOTE: This will ONLY work if you have created bouquets and playlist with JediMakerxtreme


    HOW TO EXECUTE: You only need to run the below script ONCE. Follow my setup by step guide.


    Note: If 'Automatic live bouquet update' is enabled in your jedimakerextreme then make sure you set it's start time before 05:30am by going into jedimakerextreme > settings.


    You will need SSH client: to connect to your Enigma2 box to run the below script, I personally use Putty available from http://www.putty.org/

    OpenATV users can use the terminal within OpenWebif


    Step 1: Connect to your enigma2 box using SSH and login to your box


    Step 2: Paste the below link and hit enter.


    wget -O /tmp/setup.sh "https://github.com/ravstar/Enigma2/raw/main/setup.sh" && cd /tmp/ && chmod 755 setup.sh && ./setup.sh


    Step 3: Follow instructions on the terminal and it will set everything up for you.


    Point to be noted: The time taken by script from start to finish would depend on EPG data and processing power of your box. For example: my provider's epg.xml file is 40Mb in size so my Zgemma H9S takes around 9 mins to update the file everyday on other side Zgemma H2S takes 50-60 mins to update the file. But it will run in the background and won't interrupt if you are watching any programme.


    Once done,


    Step 4: Go into epgimporter


    Look for option named 'Clearing current EPG before import' and turn it to yes. (Note: you need to clear EPG for the first run only so do not press save after turning it to Yes).


    Import EPG manually by pressing yellow button.


    EPGimporter will start importing EPG data.


    Make sure you set your epg importer 'automatic start time' not before 7:10am


    All done! Happy viewing.


    IF you get an ERROR (very rarely) saying Script has been installed though it won't work until you follow one more step manually


    it will print additional text saying


    ""My xml HHMM is: +/-four digits and I want to adjust it by: +/-four digits""


    Here's how you can fix it


    Let's say the above text printed on your terminal as


    My xml HHMM is: +0400 and I want to adjust it by: -0100


    meaning your epg is an hour ahead so you need to change +0400 to +0300 (i.e. +0400-0100=+0300)

    then you have to run below command as


    sed -i 's|+0000|+0400|g; s|-0100|+0300|g' /usr/script/xmltv.sh && ./xmltv.sh


    this will complete the setup


    Another example: text printed on your terminal as

    My xml HHMM is: -0500 and I want to adjust it by: +0300

    meaning your epg is 3 hours behind so you need to change -0500 to -0200 (i.e. -0500+0300=-0200)

    then you have to run command as sed -i 's|+0000|-0500|g; s|+0300|-0200|g' /usr/script/xmltv.sh && ./xmltv.sh


    One more example: text printed on your terminal as

    My xml HHMM is: -0300 and I want to adjust it by: -0200

    meaning your epg is 2 hours ahead so you need to change -0200 to -0500 (i.e. -0300-0200=-0500)

    then you have to run command as sed -i 's|+0000|-0300|g; s|-0200|-0500|g' /usr/script/xmltv.sh && ./xmltv.sh


    If you still need help, then post that message here in this thread and I will make the command for you to run to fix the error.


    If you would like to uninstall above script and changes it has made for any reason, then paste following link in your SSH client and hit enter.


    cd /usr/script && ./uninstall1.sh

  • It might be tricky to use the above if you have more than one provider. Can you take a screenshot of your etc/epgimport folder or I can get connected with you over the team viewer and add everything manually and get it sorted in one go.

  • ravstar the provider names real is the one with timeshift out but I do not use it as main one it is only there as backup and I could use it to record from because it works with (DVB) 1 where as the others don't.

    I can install teamviewer if needed but if timeshift can only work with one provider then it does not matter I will keep trying epg editor see if I can get that working.

  • ravstar the provider names real is the one with timeshift out but I do not use it as main one it is only there as backup and I could use it to record from because it works with (DVB) 1 where as the others don't.

    I can install teamviewer if needed but if timeshift can only work with one provider then it does not matter I will keep trying epg editor see if I can get that working.

    That is fine give me a minute and I will give you an another link that will do it for you for your 'Real' provider. No need to teamview. meanwhile Please run the below script to uninstall the changes that script has made earlier


    wget -O /tmp/uninstall.sh "https://github.com/ravstar/Enigma2/raw/main/uninstall.sh" && cd /tmp/ && chmod 755 uninstall.sh && ./uninstall.sh

  • wget -O /tmp/setup.sh "https://github.com/ravstar/Enigma2/raw/main/Setup-urie.sh" && sed -i 's,llllll,http://DOMAIN-URL:PORT,g;s,uuuuuu,USERNAME,g;s,pppppp,PASSWORD,g;s/temp/-HHMM/g' /tmp/setup.sh && cd /tmp/ && chmod 755 setup.sh && ./setup.sh


    Here's your script that should work- Make those changes as I mentioned above and run it same as per previous instructions

    I have ran script and rebooted GUI it did come up with this when I ran it

    rm: can't remove '/etc/epgimport/new.EPG.sources.xml': No such file or directory


    but we know that :)

    Edited 2 times, last by ravstar ().

  • ravstar , thanks for making script for me putty is still busy but I can now see new.EPG.sources.xml in epgimport folder.

    Perfect! So it is busy meaning it is applying those changes to iptvepg.xml file in your /media/HDD/epg folder. You can go into epgimport and it sould show the new source in it and make sure to uncheck previous source of 'REAL' epg

  • Uncheck previous REAL one in epg importer done allready :)


    I though originally the script actually ran epgimporter at 0.6am so setting Clearing current EPG before import' and turn it to yes.

    I thought would delete other provider bouquets but that is not the case it does not run epgimporter it downloads and edits the epg file is that correct.

    Because some times I manually Clearing current EPG before import' and turn it to NO. when just updating one provider it is quicker.

  • Uncheck previous REAL one in epg importer done allready :)


    I though originally the script actually ran epgimporter at 0.6am so setting Clearing current EPG before import' and turn it to yes.

    I thought would delete other provider bouquets but that is not the case it does not run epgimporter it downloads and edits the epg file is that correct.

    Because some times I manually Clearing current EPG before import' and turn it to NO. when just updating one provider it is quicker.

    I though originally the script actually ran epgimporter at 0.6am so setting Clearing current EPG before import' and turn it to yes.

    I thought would delete other provider bouquets but that is not the case it does not run epgimporter it downloads and edits the epg file is that correct.


    The script runs at 6am so basically it download new epg.xml file from your provider's url and change the time. I have mentioned to set automatic start time at 7:10am as this will give the script enough time to download and make those changes to .xml file that resides in hdd/epg folder.


    Because some times I manually Clearing current EPG before import' and turn it to NO. when just updating one provider it is quicker.


    Clearing current EPG before import is only required once at first run hence I didn't mention word Save after that. So you don't need to keep it to yes all the time.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!