How to use ChannelSelection.py

There are 5 replies in this Thread which was already clicked 1,415 times. The last Post () by KiddaC.

  • Hi All!


    I'm working on a plugin which will present a user with a list of channels (Lets say just BBC services for arguments sakes). In order to change the channel from the menu I have been looking into the ChannelSelection.py module. I have written a very basic plugin that presents the user with a list of channels however I have not worked out how to import ChannelSelection.py properly.


    I have successfully imported the module using the "from Screens.ChannelSelection import ChannelSelection however I haven't managed to move much further than this point. I just get errors when I try to use functions such as getCurrentServicePath. Does anybody know how to use this module / could anybody post an example Python script.


    I have also come across the PlayService() function however once again I cannot find a lot of information on how to use it. I understand that it takes a channel reference but which modules do I need to import to use this function and how can I get a list of service references in Python.


    Currently I have no bouquets set up on my receiver, all I have done is take it out the box and perform a scan for free to air services.


    Any help with this would be great!


    All the best,


    Oliver.

    • Official Post

    Welcome to the forum....

    there is plugins that do this already, look at how they do it and what modules they use

    Autobouquetsmaker plugin handles cable sat and terrestrial channels

    Jedimakerextream for iptv


    What are you actually trying to achieve ??

  • Hello! Thank you for your reply.


    I will have a look into the plugins that you have mentioned.


    Essentially, what I want to do is present the user with a simplified interface when the box boots up. The plugin will be loaded on start-up and will simply be a list of channels available on the box. Kind of like an EPG but with just channel names, no program data. This is to add a layer of abstraction to the box and to prevent access to other settings on the box (Something I know if quite frowned upon...). This is due to the environment in which this box will be used in. At a later stage I will try to add program data but for now its not necessary.


    Thank you,


    Oliver

  • Parental controls would certainly be an option, however I would need to be able to set this up on several receivers in exactly the same way. Would it be possible to write a plugin that could set up parental controls, limit what channels are displayed on the EPG and then ensure that when the box loses power / is shut down, when it reboots it loads the channel it was playing last?


    The reason why I would like to build a plugin is because it can theoretically be run on virtually any box and can be setup to only respond to certain button presses on the remote control.


    The boxes are being used in an office environment to pick up certain satellite feeds and I basically want to create a GUI that locks them down to just this task (while the plugin is running).


    Thanks again for your help!


    All the best,


    Oliver.

  • Here is some further advice. Seems like you are re-inventing the wheel here.


    Run autobouquetmaker hide sections. Hide the sections you do not want. Run a scan.


    a9d67a1.png


    What this does is put a hide parameter in etc/bouquets.tv

    f29a58fa0b3f85dc460cde277.png


    So my current stripped down channels look like this

    a464fd6d8ab4ab38291ea7.png


    You can also then go into any bouquet, press menu. Remove channel.


    There is also a plugin that does very similar to what you are after


    Go into plugins. Download plugins. System plugins

    Download bouquet protector.

    reboot gui.


    This can then be found in menu...setup.. bouquet protection.


    218a4f9d8617afd1.png
    e2f9ee73c2fae9031cb.png


    Then go into channel select press menu... Add bouquet protection to the ones you want to hide. (red number 1)

    Then when you are done. Hide them. (red number 2)
    0967d732b3e.png


    to show them again you just go back into that menu and unlock protected services.


    Warning this does bugger the bouquet order up when reshowing them. It puts them at the bottom of the list. So you may need to do a abm scan after the have got muddled up. Showing hidden channels you also have to press menu, reload services to get them all back viewing and in order.

    Bouquet protection plugin is a good idea. It could be implemented better though ;)

    ** A person who feels appreciated will always do more than what is expected **

Participate now!

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