Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 9 of 9 FirstFirst ... 789
Results 121 to 130 of 130

Thread: Cable and FTA Sky UK CustomMix

  1. #121
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,573
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    Quote Originally Posted by dsayers View Post
    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 by Huevos; 24-06-19 at 23:42.
    Help keep OpenViX servers online.Please donate!

  2. The Following User Says Thank You to Huevos For This Useful Post:

    dsayers (25-06-19)

  3. #122
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,752
    Thanks
    472
    Thanked 606 Times in 432 Posts
    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}}

  4. #123
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,573
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    Quote Originally Posted by dsayers View Post
    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"]]
    Help keep OpenViX servers online.Please donate!

  5. The Following User Says Thank You to Huevos For This Useful Post:

    dsayers (26-06-19)

  6. #124
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,573
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    TBH, the whole idea of matching by channel name is pretty fragile. Where SkyUK is the source you could be using "channel_id".
    Help keep OpenViX servers online.Please donate!

  7. #125
    abu baniaz's Avatar
    Title
    Moderator
    Join Date
    Sep 2010
    Location
    East London
    Posts
    23,335
    Thanks
    6,421
    Thanked 9,146 Times in 6,224 Posts
    Quote Originally Posted by Huevos View Post
    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

  8. #126
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,573
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    Quote Originally Posted by abu baniaz View Post
    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:
    Help keep OpenViX servers online.Please donate!

  9. #127
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,752
    Thanks
    472
    Thanked 606 Times in 432 Posts
    Quote Originally Posted by Huevos View Post
    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 by dsayers; 25-06-19 at 18:07.

  10. #128
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,752
    Thanks
    472
    Thanked 606 Times in 432 Posts
    Quote Originally Posted by Huevos View Post
    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"]]

  11. #129
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,573
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    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 by Huevos; 25-06-19 at 18:36.
    Help keep OpenViX servers online.Please donate!

  12. The Following 2 Users Say Thank You to Huevos For This Useful Post:

    Andy_Hazza (26-06-19),dsayers (25-06-19)

  13. #130
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,752
    Thanks
    472
    Thanked 606 Times in 432 Posts
    Changes made here for regional issues thanks to @Huevos https://github.com/davesayers2014/Cu...64c8de8f427d8e users please report any issues and ill try to amend as soon as possible. Thanks

  14. The Following 2 Users Say Thank You to dsayers For This Useful Post:

    Andy_Hazza (26-06-19),Ashley69 (26-06-19)

Page 9 of 9 FirstFirst ... 789

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.