IPTV EPG (solved)

There are 20 replies in this Thread which was already clicked 10,949 times. The last Post () by abu baniaz.

  • Solved: at least in my case but should be valid for all !


    Context:


    My STB plays SAT TV channels with #SERVICE starting with 1: and IPTV channels with #SERVICE starting with 4097:


    Historical context:


    When BH was created, only SAT TV channels exist and the convention of #SERVICE starting with 1: was taken to identify them together with SID, TSID, ONID received from the satellite and stored in the file lamedb.


    In the same spirit, EPG data base is created for #SERVICE starting with 1: (and nothing else).


    Creation of IPTV channels in bouquets:


    The IPTV channel is usually of the form:


    #SERVICE 4097:0:1:1067:0:0:0:0:0:0:http%3a//mystream/750.ts


    where 1067 is just a sequence number in my list of IPTV channels.


    As explained in many forums, there are 2 approaches to get EPG:


    either you modify the SERVICE to introduce SID, TSID and ONID of the same channel on satellite


    #SERVICE 4097:0:19:245B:440:1:C00000:0:0:0:http%3a//mystream/750.ts


    or you create your own EPG with


    < channel id="Rytec ID of the channel">1:0:1:1067:0:0:0:0:0:0:http%3a//dummy.com</channel>


    Note: in this case, you may not use 4097: but only 1: (see historical context).



    Well, after all this stuff ... EPG is still not working for IPTV channels.


    The explanation is the following:


    BH calls the functions of the component EpgList.py to process the EPG requests and that is the problem !


    If the #SERVICE starts with 4097:, nothing will be found in the EPG data base as all references start with 1:.



    The solution is to modify EpgList.py functions like the following (and this should be valid for all images!):



    Original code for single EPG:

    Code
     test = [ 'RIBDT', (service.ref.toString(), 0, -1, -1) ]
     self.list = self.queryEPG(test)


    Note: a query on EPG data base is made for 1 "service"



    Modified code for IPTV:

    Code
     mywork=service.ref.toString()
     if mywork.startswith("4097:"):
         service2=mywork.replace("4097:","1:",1)
     else:
         service2=mywork
     test = [ 'RIBDT', (service2, 0, -1, -1) ]
     self.list = self.queryEPG(test)



    Original code for multi EPG:

    Code
     test = [ (service.ref.toString(), 0, stime) for service in services ]
     self.list = self.queryEPG(test)


    Note: a query on EPG data base is made for all services in "services"



    Modified code for IPTV:

    Code
     test=[]
     for service in services:
         mywork=service.ref.toString()
         if mywork.startswith("4097:"):
             service2=mywork.replace("4097:","1:",1)
        else:
             service2=mywork
         test.append((service2, 0, stime))
     test.insert(0, 'X0RIBDTCn')
     self.list = self.queryEPG(test)



    After modification, EpgList.py will be re-compiled automatically.



    Enjoy !!!

  • Brilliant find !


    I've applied your code to use with 5002 Exteplayer3 instead of 4097 and it works great in OpenATV ( by the way your else in the multi EPG section has an incorrect indentation )


    Anyway, after sorting that it does work. However, the Channels list is still not filled, ( This is the list where each channel in the bouquet is listed and it has EPG at the side of it, before selecting the given channel ) so I suspect this uses a different converter.


    Do you happen to know which it is ?

    I've a feeling it may actually be a renderer rather than a converter, but whatever it is, this file needs modding too.


    Ian.

  • About Channels list not filled: got the same problem but it is OK if you restart GUI ... Don't know why !

    I have found the reason why channels list is not filled !

    To workaround that problem, I need Python expertise to modify a "list of list of tuples" ... working on that point.

    Edited once, last by webdef ().

  • Some improvements !

    When playing an IPTV channel:

    <EPG>: give details on current event

    <EPG> -> <yellow>: give list of events for the day for the channel

    <EPG> -> <blue>: give the current events for all channels of the bouquet

    At this point, <blue>: go forward in time and show events for all channels and <yellow> go backward.


    Limitations:

    When selecting a bouquet, current events are not shown: problem is identified but need some more Python knowledge to improve !

    Graphical EPG does not show IPTV channels: got less priority as it is more "cosmetics"


    Some feedback:

    When booting on IPTV channel, date/time of the box not correct and EPG is not loaded: need either to select a sat channel (time is taken from sat transponder) or to have a system time plugin (to get time from internet): in both case, restart GUI is necessary to load EPG.

    When own EPG is created (ex: using epgimport with channels.channels.xml file), EPG has sometimes to be re-imported to be visible !


    Let me know your feedback.

    ENJOY


    If you like graphical EPG for IPTV channels:

    In Plugins/GraphMultiEPG, replace GraphMultiEpg.py by the attachment !

    Do not forget to replace gstreamer 4097 by your player code !

    ENJOY

  • It doesn't work in ATV, it causes a crash when trying to populate the single EPG and I've simply not had the time due to work, to solve it yet.


    Fixing the crash will be child's play, but finding the reason why the current events are not populated from Bouquets will take more time than I have at the moment.


    So hopefully, webdef will find a solution soon.

  • can i use it on openatv image? i see that openatv use "pyo" extension and not "py"

    No problem: just replace the original .py files by the posted files: they will be recompiled automaticcaly into .pyo files !

    File .py = source code; File .pyo = compiled version of the source code.

  • It doesn't work in ATV, it causes a crash when trying to populate the single EPG and I've simply not had the time due to work, to solve it yet.


    Fixing the crash will be child's play, but finding the reason why the current events are not populated from Bouquets will take more time than I have at the moment.


    So hopefully, webdef will find a solution soon.

    I just make a new test with the posted files (as I have removed the debugging code in the posted files): no problem, all is working !

    Please, send me more info on the reason of the crash ! Crash log or on the screen, last lines give the reason of the crash ... and I will check if it has something to do with EPG.

  • Attached is a new file with the Indents corrected, and re usage to change the service reference corrected too.


    There is a def at the bottom of the EpgList.py file entitled


    def fillBouquetList(self, bouquets): (This maybe OpenATV only though)


    Which you would think would be what we are looking for, however, so far modifying this def has not worked either in getting the EPG to populate in the Bouquets list.


    Ian.



    ps I meant that I made a post but couldn't find how to delete it.


    EpgList.py

  • 1) The posted epglist.py is not running on my Vuduo: it is a more recent version (also available on GitHub) and needs a lot of other files to run (.py, .png, ...)

    So cannot help for that version.

    2) Bouquet and EPG

    After analysis of a lot of code, I come to the conclusion (but I can be wrong !) that the bouquet is not populated by query on the EPG DB (code has been modified to intercept all calls with 4097, ...) BUT, for performance reason, the bouquet is populated by a lookup ... IN THE EPGCACHE !

    A statement like:

    event = self.epgcache.lookupEventId(service.ref, eventid)

    With my limited python knowlegde, I was not able to check/modify service.ref for 4097, ... !


    So far, taking now some holidays in Spain, back M10.

  • Dear ian1095,


    i've tried your code and i can get EPG on single channels , but as you said not in channel list.


    I've also got modified Lcdpicon.py and Picon.py from openatv git repository (with latest commit) to make Picons works when service is 5002 , with no luck.


    Do you have any news about channel list epg display and Picons?


    Regards,


    ciuko

  • no news under the sun ... in OpenPli 6.0RC this problem is fixed working on Serviceapp plugin and not modifying enigma2 python scripts .....


    I'm wondering if it will be possibile to fix the Bouquet List problem just by editing those scripts .... :(

  • Ive pushed ATV on their Github to implement the fix that Pli use, its just a simple removal of an obsolete check that was added some 10yrs ago. However, even after this the EPG still doesn't populate when using 5002 or 5001 ect. I think the reason being that the mx3L Serviceapp plugin had an EPG fix applied to it several months ago now ( it now also has many more mods too ) but this version wont run on ATV due to the different OpenSSL used, and until mx3L ups the version number, ATV probably wont pick up these updates and build a new version.


    Ian.

  • Ok finally ATV have given in to my pressure lol


    Today's update includes mx3L's Serviceapp EPG fix from nearly 12months ago giving full EPG using 4097,5001 or 5002


    So this problem is now solved.


    Ian.

Participate now!

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