Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £99! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £149! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[ABM-MISC] Cable and FTA Sky UK CustomMix

For my region 113 named ITV HD
Ok, so what is happening is 113 is getting saved to "move_dict" but we continue searching and then it finds another match at 179 and overwrites the first match. So we need to avoid that happening.

Code:
source = "sat_282_sky_uk"
dest = "cable_uk_virgin"

move_dict = {
	'bbc one': {"source": None, "dest": None}, 
	'bbc two': {"source": None, "dest": None},
	'itv': {"source": None, "dest": None},
	'channel 4': {"source": None, "dest": None},
}

if source in services and dest in services:
	for key in move_dict.keys():
		for service in range(101, 201) + range(801, 900):
			if move_dict[key]["source"] is None and \
				service in services[source]["video"] and \
				services[source]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[source]["video"][service]["service_name"].lower().startswith(key) :
				move_dict[key]["source"] = service
			if move_dict[key]["dest"] is None and \
				service in services[dest]["video"] and \
				services[dest]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[dest]["video"][service]["service_name"].lower().startswith(key):
				move_dict[key]["dest"] = service
			if move_dict[key]["source"] and move_dict[key]["dest"]:
				break

for key in move_dict.keys():
	if move_dict[key]["source"] and move_dict[key]["dest"]:
		customised["video"][move_dict[key]["dest"]] = services[source]["video"][move_dict[key]["source"]]
 
Last edited:
I think your getting close but it seems to add ITV2 HD to 1113

Code:
{'bbc one': {'dest': 108, 'source': 115}, 'itv': {'dest': 113, 'source': 118}, 'bbc two': {'dest': 102, 'source': 802}, 'channel 4': {'dest': 141, 'source': 138}}
 
I think your getting close but it seems to add ITV2 HD to 1113

Code:
{'bbc one': {'dest': 108, 'source': 115}, 'itv': {'dest': 113, 'source': 118}, 'bbc two': {'dest': 102, 'source': 802}, 'channel 4': {'dest': 141, 'source': 138}}
How can it add something at 1113? That is outside your range.
Code:
for service in range(101, 201) + range(801, 900)
Also any channels you know that trip it up could be added to an avoid list.
Code:
source = "sat_282_sky_uk"
dest = "cable_uk_virgin"

move_dict = {
	'bbc one': {"source": None, "dest": None}, 
	'bbc two': {"source": None, "dest": None},
	'itv': {"source": None, "dest": None},
	'channel 4': {"source": None, "dest": None},
}

avoid_list = [ # lower case
	"itv2 hd",
]

if source in services and dest in services:
	for key in move_dict.keys():
		for service in range(101, 201) + range(801, 900):
			if move_dict[key]["source"] is None and \
				service in services[source]["video"] and \
				services[source]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[source]["video"][service]["service_name"].lower().startswith(key) and \
				services[source]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["source"] = service
			if move_dict[key]["dest"] is None and \
				service in services[dest]["video"] and \
				services[dest]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[dest]["video"][service]["service_name"].lower().startswith(key) and \
				services[dest]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["dest"] = service
			if move_dict[key]["source"] and move_dict[key]["dest"]:
				break

for key in move_dict.keys():
	if move_dict[key]["source"] and move_dict[key]["dest"]:
		customised["video"][move_dict[key]["dest"]] = services[source]["video"][move_dict[key]["source"]]
 
TBH, the whole idea of matching by channel name is pretty fragile. Where SkyUK is the source you could be using "channel_id".
 
That is not going to work as the file is being used for more than one area
Should work because we are looking for the first instance. So you are just checking:
Code:
if channel_id in channel_id_list:
 
How can it add something at 1113? That is outside your range.
Code:
for service in range(101, 201) + range(801, 900)

Sorry that was a typo it added source 118 ITV2 HD TO 113.

This maybe getting over complected as we have other regional names i.e STV.
 
Last edited:
Also any channels you know that trip it up could be added to an avoid list.
Code:
source = "sat_282_sky_uk"
dest = "cable_uk_virgin"

move_dict = {
	'bbc one': {"source": None, "dest": None}, 
	'bbc two': {"source": None, "dest": None},
	'itv': {"source": None, "dest": None},
	'channel 4': {"source": None, "dest": None},
}

avoid_list = [ # lower case
	"itv2 hd",
]

if source in services and dest in services:
	for key in move_dict.keys():
		for service in range(101, 201) + range(801, 900):
			if move_dict[key]["source"] is None and \
				service in services[source]["video"] and \
				services[source]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[source]["video"][service]["service_name"].lower().startswith(key) and \
				services[source]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["source"] = service
			if move_dict[key]["dest"] is None and \
				service in services[dest]["video"] and \
				services[dest]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[dest]["video"][service]["service_name"].lower().startswith(key) and \
				services[dest]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["dest"] = service
			if move_dict[key]["source"] and move_dict[key]["dest"]:
				break

for key in move_dict.keys():
	if move_dict[key]["source"] and move_dict[key]["dest"]:
		customised["video"][move_dict[key]["dest"]] = services[source]["video"][move_dict[key]["source"]]

I had to add

avoid_list = [ # lower case
"itv2 hd",
"itv3 hd",
"itv4 hd",
]

So now I have

Code:
source = "sat_282_sky_uk"
dest = "cable_uk_virgin"

move_dict = {
	'bbc one': {"source": None, "dest": None}, 
	'bbc two': {"source": None, "dest": None},
	'itv': {"source": None, "dest": None},
	'channel 4': {"source": None, "dest": None},
}

avoid_list = [ # lower case
	"itv2 hd",
	"itv3 hd",
	"itv4 hd",
]

if source in services and dest in services:
	for key in move_dict.keys():
		for service in range(101, 201) + range(801, 900):
			if move_dict[key]["source"] is None and \
				service in services[source]["video"] and \
				services[source]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[source]["video"][service]["service_name"].lower().startswith(key) and \
				services[source]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["source"] = service
			if move_dict[key]["dest"] is None and \
				service in services[dest]["video"] and \
				services[dest]["video"][service]["service_type"] in DvbScanner.HD_ALLOWED_TYPES and \
				services[dest]["video"][service]["service_name"].lower().startswith(key) and \
				services[dest]["video"][service]["service_name"].lower() not in avoid_list:
				move_dict[key]["dest"] = service
			if move_dict[key]["source"] and move_dict[key]["dest"]:
				break

for key in move_dict.keys():
	if move_dict[key]["source"] and move_dict[key]["dest"]:
		customised["video"][move_dict[key]["dest"]] = services[source]["video"][move_dict[key]["source"]]
 
No, it is not over complicated. You just add "stv" or "utv" to your move dict. Then if you are in Scotland and your cable has "STV" and you pick Sky Scotland, it will do the swap.

Main point is to try to write an algorithm that works fo all cases. That way you can just make changes to the dict to add new channels.
 
Last edited:

OpenViX Feeds Status

Back
Top