PDA

View Full Version : [ABM-MISC] ABM Hacks Examples by Huevos



Willmoore
09-08-15, 10:44
Two hacks posted - ITV Regions and Timeshift when upzipped have the same name - sat_282_sky_uk_CustomMix.xml so when placed in /usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker/custom as instructed one overwrites the other. Or have I mis-understood (as usual) :confused:

Huevos
09-08-15, 13:32
They are just examples. So each file only does one thing. To use both you would have to combine them in one file. The order you combine them will dictate the order of the bouquets.

Something like this.

<custommix>
<hacks>
<![CDATA[

# Make ITV regions bouquet

ITVs = []
ITVsPlusOne = []
rest = []
last_section = max(sections.keys())
last_section_name = sections[last_section]

for service in sorted(services["sat_282_sky_uk"]["video"].keys()):
if service in range(last_section, 1450) or service in [103, 133, 178]:
# ITV regions
if 'interactive_name' in services["sat_282_sky_uk"]["video"][service] and (service in [103,178] or (service in range(last_section, 1450) and '+1' not in services["sat_282_sky_uk"]["video"][service]["interactive_name"] and ('ITV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"] or 'STV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"] or 'UTV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"]))):
ITVs.append(services["sat_282_sky_uk"]["video"][service])

# ITV +1 regions
elif 'interactive_name' in services["sat_282_sky_uk"]["video"][service] and (service in [133] or (service in range(last_section, 1450) and '+1' in services["sat_282_sky_uk"]["video"][service]["interactive_name"] and ('ITV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"] or 'STV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"] or 'UTV' in services["sat_282_sky_uk"]["video"][service]["interactive_name"]))):
ITVsPlusOne.append(services["sat_282_sky_uk"]["video"][service])

else:
rest.append(services["sat_282_sky_uk"]["video"][service])

i = last_section
sections[i] = "ITV Regions"

sort_list = []
for x in ITVs:
sort_list.append((x, re.sub('^(?![a-z])', 'zzzzz', x['interactive_name'].lower())))
sort_list = sorted(sort_list, key=lambda listItem: listItem[1])
for service in sort_list:
customised["video"][i] = service[0]
i += 1

sort_list = []
for x in ITVsPlusOne:
sort_list.append((x, re.sub('^(?![a-z])', 'zzzzz', x['interactive_name'].lower())))
sort_list = sorted(sort_list, key=lambda listItem: listItem[1])
for service in sort_list:
customised["video"][i] = service[0]
i += 1

sections[i] = last_section_name
sort_list = []
for x in rest:
sort_list.append((x, re.sub('^(?![a-z])', 'zzzzz', x['service_name'].lower())))
sort_list = sorted(sort_list, key=lambda listItem: listItem[1])
for service in sort_list:
customised["video"][i] = service[0]
i += 1

################################################## ##########################################

# make a timeshift bouquet

timeshift = []
rest = []
last_section = max(sections.keys())
last_section_name = sections[last_section]

for service in sorted(services["sat_282_sky_uk"]["video"].keys()):
if service in range(last_section, 1450):
rest.append(services["sat_282_sky_uk"]["video"][service])
elif service < 1000 and ("+1" in services["sat_282_sky_uk"]["video"][service]["service_name"] or "+2" in services["sat_282_sky_uk"]["video"][service]["service_name"]):
timeshift.append(services["sat_282_sky_uk"]["video"][service])

i = last_section
sections[i] = "Timeshift"

sort_list = []
for x in timeshift:
sort_list.append((x, re.sub('^(?![a-z])', 'zzzzz', x['service_name'].lower())))
sort_list = sorted(sort_list, key=lambda listItem: listItem[1])
for service in sort_list:
customised["video"][i] = service[0]
i += 1

sections[i] = last_section_name
sort_list = []
for x in rest:
sort_list.append((x, re.sub('^(?![a-z])', 'zzzzz', x['service_name'].lower())))
sort_list = sorted(sort_list, key=lambda listItem: listItem[1])
for service in sort_list:
customised["video"][i] = service[0]
i += 1

]]>
</hacks>
</custommix>