PDA

View Full Version : [ABM-MISC] CustomLCN, CustomMix, Favourites List, Hacks



Huevos
19-05-15, 08:50
Here are some features for customising bouquet lists in ABM, all available from Hades 009.

A list of ABM providers and the names to be used when manipulataing files is located here: http://www.world-of-satellite.com/showthread.php?49230-ABM-Providers

The readme file can also be found at the following location on your receiver:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom/README.txt

Contents:

1) CustomLCN
2) CustomMix
3) Favourites
4) Hacks
5) Provider keys

----------------------------------------------------------------------------------------------

CustomLCN
---------

CustomLCN allows channels to be moved around within one single provider. CustomLCN is
for providers that don't transmit logical channel numbers (e.g. Sky DE). Its purpose is
to insert logical channel numbers. The CustomLCN list can be complete or partial.
It doesn't have to be in any particular order but having it sequential will make it
easier to avoid making errors.

Each time ABM runs it makes an example CustomLCN xml file for each provider that is scanned,
e.g. 'EXAMPLE_hd_sat_freesat_CustomLCN.xml'. These files are archived in:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom
To make your own custom LCN file just delete 'EXAMPLE_' from the filename,
i.e. hd_sat_freesat_CustomLCN.xml. Configurations in the provider xml file, such as channel swap,
on-top, etc, are done after CustomLCN has been processed.

The following is how to edit the file. Just cut and paste the lines into the order you want.
DO NOT add any channels into more than one place in the list.

Also don't forget to include the ABM custom folder in your backups otherwise your newly
created file may be lost during image updates.

This is an example of the original 'EXAMPLE_" file:
<custom>
<include>yes</include>
<lcnlist>
<configuration lcn="101" channelnumber="101" description="BBC One Lon"></configuration>
<configuration lcn="102" channelnumber="102" description="BBC Two HD"></configuration>
<configuration lcn="103" channelnumber="103" description="ITV"></configuration>
<configuration lcn="104" channelnumber="104" description="Channel 4"></configuration>
<configuration lcn="105" channelnumber="105" description="Channel 5"></configuration>
<configuration lcn="106" channelnumber="106" description="BBC Three HD"></configuration>
<configuration lcn="107" channelnumber="107" description="BBC Four HD"></configuration>
<configuration lcn="108" channelnumber="108" description="BBC One HD"></configuration>
<configuration lcn="109" channelnumber="109" description="BBC Two Eng"></configuration>
<configuration lcn="110" channelnumber="110" description="BBC ALBA"></configuration>

This is how to swap channels.
If you want to swap ITV (103) with BBC Three HD (106) cut and paste both lines.
<custom>
<include>yes</include>
<lcnlist>
<configuration lcn="101" channelnumber="101" description="BBC One Lon"></configuration>
<configuration lcn="102" channelnumber="102" description="BBC Two HD"></configuration>
<configuration lcn="106" channelnumber="106" description="BBC Three HD"></configuration>
<configuration lcn="104" channelnumber="104" description="Channel 4"></configuration>
<configuration lcn="105" channelnumber="105" description="Channel 5"></configuration>
<configuration lcn="103" channelnumber="103" description="ITV"></configuration>
<configuration lcn="107" channelnumber="107" description="BBC Four HD"></configuration>
<configuration lcn="108" channelnumber="108" description="BBC One HD"></configuration>
<configuration lcn="109" channelnumber="109" description="BBC Two Eng"></configuration>
<configuration lcn="110" channelnumber="110" description="BBC ALBA"></configuration>

Now change the lcn numbers. lcn numbers should be in order to avoid errors!!
<custom>
<include>yes</include>
<lcnlist>
<configuration lcn="101" channelnumber="101" description="BBC One Lon"></configuration>
<configuration lcn="102" channelnumber="102" description="BBC Two HD"></configuration>
<configuration lcn="103" channelnumber="106" description="BBC Three HD"></configuration>
<configuration lcn="104" channelnumber="104" description="Channel 4"></configuration>
<configuration lcn="105" channelnumber="105" description="Channel 5"></configuration>
<configuration lcn="106" channelnumber="103" description="ITV"></configuration>
<configuration lcn="107" channelnumber="107" description="BBC Four HD"></configuration>
<configuration lcn="108" channelnumber="108" description="BBC One HD"></configuration>
<configuration lcn="109" channelnumber="109" description="BBC Two Eng"></configuration>
<configuration lcn="110" channelnumber="110" description="BBC ALBA"></configuration>

Removing channels.
Channel removal only applies to unsorted lists, i.e. non-LCN providers where the list has not been
sorted in any way. To remove a channel, just delete the line. NOTE: When <include>is set to 'yes',
all channels not configured in the custom xml will be added at the end of the main bouquet. This way
also new services from the provider will be added at the end of the channel list. Any new channels
will be shown in the ABM log.

Changing 'channel numbers'.
If you wants your own numbering, edit the lcn numbers. lcn numbers should be in order to avoid errors!!
<custom>
<include>no</include>
<lcnlist>
<configuration lcn="1" channelnumber="101" description="BBC One Lon"></configuration>
<configuration lcn="2" channelnumber="102" description="BBC Two HD"></configuration>
<configuration lcn="3" channelnumber="103" description="ITV"></configuration>
<configuration lcn="4" channelnumber="104" description="Channel 4"></configuration>
<configuration lcn="5" channelnumber="105" description="Channel 5"></configuration>
<configuration lcn="6" channelnumber="106" description="BBC Three HD"></configuration>
<configuration lcn="7" channelnumber="107" description="BBC Four HD"></configuration>
<configuration lcn="8" channelnumber="108" description="BBC One HD"></configuration>
<configuration lcn="9" channelnumber="109" description="BBC Two Eng"></configuration>
<configuration lcn="10" channelnumber="110" description="BBC ALBA"></configuration>

NOTE: Be aware of correct sections in the provider xml.
e.g.
<sections>
<section number="101">Entertainment</section>
<section number="200">News and Sport</section>
<section number="300">Movies</section>
<section number="400">Lifestyle</section>
<section number="500">Music</section>
<section number="600">Children</section>
<section number="650">Special Interest</section>
<section number="800">Shopping</section>
<section number="870">Adult</section>
<section number="950">Regional</section>
</sections>

Your lcn numbering should match sections. In this example you can add a custom section.
<sections>
<section number="1">Custom list</section>
<section number="101">Entertainment</section>
<section number="200">News and Sport</section>
<section number="300">Movies</section>
<section number="400">Lifestyle</section>
<section number="500">Music</section>
<section number="600">Children</section>
<section number="650">Special Interest</section>
<section number="800">Shopping</section>
<section number="870">Adult</section>
<section number="950">Regional</section>
</sections>

----------------------------------------------------------------------------------------------

CustomMix
---------

CustomMiX allows tv channels from one provider to be added to the bouquets of another provider.
This is great if you mainly use one provider but want to add a few channels from other providers
but don't want to create a complete list for the other provider. All providers that you want to
receive channels from must be included in every ABM scan but if you don't want complete bouquets
from that provider just set all the bouquet creation options to no.

For each provider you wish to add channels to you need to add an xml configuration file. The xml
configuration files reside in /usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom
and filenames are made up as follows... "provider_key_CustomMix.xml", e.g. for Sky UK the filename
would be "sat_282_sky_uk_CustomMix.xml". For other providers please consult the list of provider
keys below.

This is an example xml configuration file for Sky UK. Filename as above.

<custommix>
<inserts>
<insert provider="cable_uk_virgin" source="150" target="171"></insert> <!-- channel5 hd -->
<insert provider="cable_uk_virgin" source="110" target="106"></insert> <!-- sky one hd -->
</inserts>
<deletes>
<delete target="170"></delete> <!-- Sky 3D -->
</deletes>
</custommix>

The "insert" lines are what do the work but all the tags must be present. The "insert" line has 3
attributes, "provider", "source", and "target". "provider" is the key of provider from which the
channel is being imported. See below for a list of provider keys. "source" is the channel number
being imported. And "target" is the slot in the Sky UK bouquet into which that channel will be
inserted. Each channel that is to be moved requires an "insert" line.

"Delete" lines allow you to remove individual channels from the provider you are customising. Just
set "target" to the number of the channel you want to remove and it will disappear on the next scan.


----------------------------------------------------------------------------------------------

Favourites
----------

Favourites allows the creation of a complete favourites list that will preceed all other ABM bouquets.
Please note, favourites lists are static. ABM will keep your favourites list up to date if there are
changes to service references and transponder parameters but obviously it is not going to be updated
if new channels start broadcasting, so any new channels you want in the list must be added manually.

Channels selected for the favourites list can come from any providers that are being scanned, and these
providers must be scanned on every ABM run. The filename of the configuration file is:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom/favourites.xml

Here is an example favourites.xml file.

<favourites>
<name>My List</name>
<sections>
<section number="100">Entertainment</section>
<section number="200">Movies</section>
<section number="300">Music</section>
<section number="400">Sports</section>
<section number="500">News</section>
<section number="600">Documentaries</section>
<section number="700">Kids</section>
<section number="800">Other</section>
</sections>
<inserts>
<insert provider="sat_282_sky_uk" source="105" target="105"></insert> <!-- channel5 hd -->
<insert provider="sat_282_sky_uk" source="106" target="206"></insert> <!-- sky one hd -->
</inserts>
<bouquets>
<main>1</main> <!-- 0 or 1 -->
<sections>1</sections> <!-- 0 or 1 -->
</bouquets>
</favourites>

"name" is the prefix of you favourites bouquets if you have "prefix" enabled in the ABM menu. "sections"
is used for writing the section markers to your bouquets. You must have at least one section, and only
channels with a greater channel number than the first section number will be added to your favourites
bouquets. The "insert" lines have 3 attributes, "provider", "source", and "target". "provider" is the
key of provider from which the channel is being imported. See below for a list of provider keys. "source"
is the channel number being imported. And "target" is the slot in the favourites into which that channel
will be inserted. Each channel that is to be moved requires an "insert" line.
"main" has a value of 0 or 1. "0" means no main bouquet will be created and "1" that one will. Same for
"sections". If "bouquets" -> "sections" is enabled the favourites list will be divided up into sections
bouquets as per the section numbers above. All tags in the above example a necessary to get this working.


----------------------------------------------------------------------------------------------

Hacks
-----

"Hacks" is available in "Favourites" and "CustomMix". "Hacks" allows Python code to be use to
modify the channel list and sections markers, sort channels by name, make a "+1" bouquet, etc, etc,
and that this can be done dynamically rather than just creating static lists. With "Hacks" the sky
really is the limit in what bouquets can be created by ABM. Here's how "Hacks" looks in a CustomMix
file.

<custommix>
<hacks>
<=!=[=C=D=A=T=A=[

# Python code here

]=]=>
</hacks>
</custommix>

"Hacks" is provided for those with the ability to use it and there will only be basic support
for this feature.

----------------------------------------------------------------------------------------------




Original thread here (http://www.world-of-satellite.com/showthread.php?41203-ABM-custom-LCN-file).

Huevos
15-01-16, 09:47
Adding sections can also be done in CustomMix. Basic syntax is as follows:


<custommix>
<sections>
<section number="30">Section name</section>
</sections>
</custommix>

Steve88
04-08-16, 20:46
Would a CustomMix be the best way to go to include the Uk and Ireland version of the same channel (Sky Sports 5 - for 3pm Saturday games) in the UK - Sports Bouquet?

Huevos
04-08-16, 22:40
Yes. If you want both in the same bouquet CustomMix is the only way.

Or you can switch on "not indexed" and the Irish channel will appear in that bouquet.

lincsat
05-08-16, 13:10
You can use the standard xml to add the channel by id and then rename to put it in sports




1097: 499, # "Sky Sports 5 IE"



1097: "Sky Sports 5 IE",

Huevos
05-08-16, 14:36
You can use the standard xml to add the channel by id and then rename to put it in sports




1097: 499, # "Sky Sports 5 IE"



1097: "Sky Sports 5 IE",That is not a good idea, because... it will get overwritten on updates. This was one of the reasons for CustomMix. These are true user files and not affected by updates.

Quite a bit of stuff overlaps in ABM so there is often more than one way to get the job done, but in general I would discourage users from editing the provider.xml file.

The provider.xml provides the starting point... then edit the output with CustomMix.

CustomMix was made in such a way that people with little to no coding experience can do most stuff and people that can code can do absolutely anything without any modification to any .py file or the provider.xml.

lincsat
05-08-16, 19:17
I am definitely a python novice but can edit the servicehacks in the provider xml OK. I've tried adding the servicehacks from the provider xml to the custom mix but they don't appear to run, if I call them just hacks then they fails with a service not defined error. So I'll keep them in my custom named provider xml for now.

Huevos
05-08-16, 22:35
It is a different set of variables. Service hacks is in a loop and runs on individual services. Hacks runs on the complete dict "customised" and can access all providers and plenty more too. To understand more you need to read CustomMix it tools.py.

lincsat
07-08-16, 23:16
I've tried several different combinations trying to do the rename and insert channel by ID using custommix following the code used in the servicehacks but getting nowhere. This is what I have, can you tell me what's wrong?


<hacks>
<![CDATA[
try:
is_assigned
except:
is_assigned = True
custom = True

channels_to_add_by_id = {
1251: 286, # RTE One
2808: 287, # RTE One+1
1252: 288, # RTE2
1255: 290, # TV3
1025: 291, # TV3+1
1253: 292, # TG4
3615: 293, # 3e
1257: 296, # Oireachtas TV
2804: 295, # RTE News Now
1256: 294, # RTEjr
5315: 993, # "Made In Bristol"
5537: 994, # "Made In Leeds"
5536: 995, # "Made In Cardiff"
5043: 996, # "Made In Tn&Wr"
5421: 997, # "Notts TV"
5090: 990, # "London Live"
5070: 991, # "STV Glasgow"
3527: 992, # "STV Edinburgh"
1097: 499, # "Sky Sports 5 IE"
}

rename = {
# ITV regions
3527: "STV Edinburgh",
5070: "STV Glasgow",
6210: "STV North (Grampian)",
6220: "STV Scottish West",
6325: "STV North (Dundee)",

# Sky Sports Ireland
1312: "Sky Sports 5 IE",
1097: "Sky Sports 5 IE",
}


# Channel renames

for service in sorted(services["sat_282_sky_uk"]["video"].keys()):
if "channel_id" in service and service["channel_id"] in rename(services["sat_282_sky_uk"]["video"][service]):
service["interactive_name"] = rename[service["channel_id"]]


# Add channels by ID
for service in sorted(services["sat_282_sky_uk"]["video"].keys()):
if custom and service["channel_id"] in channels_to_add_by_id and service["service_type"] in DvbScanner.VIDEO_ALLOWED_TYPES and channels_to_add_by_id[service["channel_id"]] not in LCNs_in_use:
LCNs_in_use.append(channels_to_add_by_id[service["channel_id"]])
service["number"] = channels_to_add_by_id[service["channel_id"]]
service["numbers"] = [channels_to_add_by_id[service["channel_id"]]]

]]>

</hacks>

Huevos
08-08-16, 01:59
<custommix>

<hacks>
<![CDATA[

rename = {
# ITV regions
3527: "STV Edinburgh",
5070: "STV Glasgow",
6210: "STV North (Grampian)",
6220: "STV Scottish West",
6325: "STV North (Dundee)",

# Sky Sports Ireland
1312: "Sky Sports 5 IE",
1097: "Sky Sports 5 IE",
}

channels_to_add_by_id = {
1251: 286, # RTE One
2808: 287, # RTE One+1
1252: 288, # RTE2
1255: 290, # TV3
1025: 291, # TV3+1
1253: 292, # TG4
3615: 293, # 3e
1257: 296, # Oireachtas TV
2804: 295, # RTE News Now
1256: 294, # RTEjr
5315: 993, # "Made In Bristol"
5537: 994, # "Made In Leeds"
5536: 995, # "Made In Cardiff"
5043: 996, # "Made In Tn&Wr"
5421: 997, # "Notts TV"
5090: 990, # "London Live"
5070: 991, # "STV Glasgow"
3527: 992, # "STV Edinburgh"
1097: 499, # "Sky Sports 5 IE"
}

# Channel renames
for service in sorted(customised["video"].keys()):
if "channel_id" in customised["video"][service] and customised["video"][service]["channel_id"] in rename:
customised["video"][service]["interactive_name"] = rename[customised["video"][service]["channel_id"]]

# Add channels by ID
for service in sorted(customised["video"].keys()):
if "channel_id" in customised["video"][service] and customised["video"][service]["channel_id"] in channels_to_add_by_id:
customised["video"][channels_to_add_by_id[customised["video"][service]["channel_id"]]] = customised["video"][service]
del customised["video"][service]

]]>

</hacks>
</custommix>

Also, look at this post (http://www.world-of-satellite.com/showthread.php?52721-Can-we-add-the-Irish-sky-sports-5-channel-to-the-sat_282_sky_uk-xml&p=412051&viewfull=1#post412051).

Steve88
09-08-16, 21:54
Yes. If you want both in the same bouquet CustomMix is the only way.

Or you can switch on "not indexed" and the Irish channel will appear in that bouquet.

Thanks for the help, I looked through the thread you linked above and used one of the mixes you posted on there. I might have play around one day but I only really know bash and java......python would be very new to me!
Cheers for all the work on ABM!

dsayers
01-02-17, 18:39
<custommix>

<hacks>
<=!=[=C=D=A=T=A=[

rename = {
# ITV regions
3527: "STV Edinburgh",
5070: "STV Glasgow",
6210: "STV North (Grampian)",
6220: "STV Scottish West",
6325: "STV North (Dundee)",

# Sky Sports Ireland
1312: "Sky Sports 5 IE",
1097: "Sky Sports 5 IE",
}

channels_to_add_by_id = {
1251: 286, # RTE One
2808: 287, # RTE One+1
1252: 288, # RTE2
1255: 290, # TV3
1025: 291, # TV3+1
1253: 292, # TG4
3615: 293, # 3e
1257: 296, # Oireachtas TV
2804: 295, # RTE News Now
1256: 294, # RTEjr
5315: 993, # "Made In Bristol"
5537: 994, # "Made In Leeds"
5536: 995, # "Made In Cardiff"
5043: 996, # "Made In Tn&Wr"
5421: 997, # "Notts TV"
5090: 990, # "London Live"
5070: 991, # "STV Glasgow"
3527: 992, # "STV Edinburgh"
1097: 499, # "Sky Sports 5 IE"
}

# Channel renames
for service in sorted(customised["video"].keys()):
if "channel_id" in customised["video"][service] and customised["video"][service]["channel_id"] in rename:
customised["video"][service]["interactive_name"] = rename[customised["video"][service]["channel_id"]]

# Add channels by ID
for service in sorted(customised["video"].keys()):
if "channel_id" in customised["video"][service] and customised["video"][service]["channel_id"] in channels_to_add_by_id:
customised["video"][channels_to_add_by_id[customised["video"][service]["channel_id"]]] = customised["video"][service]
del customised["video"][service]

]=]=>

</hacks>
</custommix>

Also, look at this post (http://www.world-of-satellite.com/showthread.php?52721-Can-we-add-the-Irish-sky-sports-5-channel-to-the-sat_282_sky_uk-xml&p=412051&viewfull=1#post412051).

Did anyone actually try this the channels display in epg but when selected it goes straight to the channel currently viewing rather than switching to the channel selected

Edit after a reboot it worked sorry

seame
01-04-17, 21:25
What the best way to replace a service with an iptv alternative that won't be overwritten when ABM updates?

For example

ABM populates my entertainment section with "bbc1" pulled from the satellite but I want to replace "bbc1" with "bbc1HD" with the source being an m3u file.

I've changed out a few channels and linked the epg but when ABM scans all my work is undone :mad:

dsayers
01-04-17, 21:28
You'll be best having iptv in separate bouquets from ABM

seame
01-04-17, 21:33
You'll be best having iptv in separate bouquets from ABM

I'd like to have the two combined if possible