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.
Results 1 to 6 of 6

Thread: How to do multiple hacks to CustomMix.xml

  1. #1

    Title
    Forum Supporter
    Donated Member
    Join Date
    Nov 2016
    Posts
    41
    Thanks
    13
    Thanked 1 Time in 1 Post

    How to do multiple hacks to CustomMix.xml

    Hi,

    I fancy using more than one of the stickied CustomMix hacks at the same time and assume I can, but....

    Is there a specific layout or something I should be using to have more than one hack in the file? Do I just leave a single blank line between hacks or something?

    (Have pity, I've never seen Python or FireZilla before this month & a ZX81 was cutting edge when I left school )

    Bod

  2. #2
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,607
    Thanks
    2,005
    Thanked 4,941 Times in 3,265 Posts
    The hacks were just examples. Pretty much anything is possible but you need to be able to write some simple python code. Which hacks did you want to combine?
    Help keep OpenViX servers online.Please donate!

  3. #3

    Title
    Forum Supporter
    Donated Member
    Join Date
    Nov 2016
    Posts
    41
    Thanks
    13
    Thanked 1 Time in 1 Post
    I've successfully downloaded and installed the Timeshift bouquet from the .zip file & was thinking of adding the ITV regions one - to be honest, as much to learn how as for actual use.

    ...Then thinking of moving on to playing with a Favourites folder (If I can do so whilst keeping original Sky numbering in place).

    To be honest, if it involves more than a blank line or simple bit of linking text I can live without it. I'm mostly just playing around to see what I can do/learn with ABM that's safely within my capabilities

  4. #4
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,607
    Thanks
    2,005
    Thanked 4,941 Times in 3,265 Posts
    No, you can't just put one after the other. You would need to rewrite it so they work together. There is no support for this function. It is there for people that know some Python.
    Help keep OpenViX servers online.Please donate!

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

    Bodmass (30-12-16)

  6. #5

    Title
    Forum Supporter
    Donated Member
    Join Date
    Nov 2016
    Posts
    41
    Thanks
    13
    Thanked 1 Time in 1 Post
    OK - understood.

    Thanks for coming back to me anyway

    Bod

  7. #6

    Title
    ViX Beta Tester
    Join Date
    May 2011
    Posts
    681
    Thanks
    56
    Thanked 236 Times in 163 Posts
    Quote Originally Posted by Bodmass View Post
    I've successfully downloaded and installed the Timeshift bouquet from the .zip file & was thinking of adding the ITV regions one - to be honest, as much to learn how as for actual use.

    ...Then thinking of moving on to playing with a Favourites folder (If I can do so whilst keeping original Sky numbering in place).

    To be honest, if it involves more than a blank line or simple bit of linking text I can live without it. I'm mostly just playing around to see what I can do/learn with ABM that's safely within my capabilities
    That's pretty much what I did. If you use my code, note the non-standard naming of the xml files - sat_282_sky_uk_alt.xml & sat_282_sky_uk_alt_CustomMix.xml

    Code:
    <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_alt"]["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_alt"]["video"][service] and (service in [103,178] or (service in range(last_section, 1450) and '+1' not in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] and ('ITV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] or 'STV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] or 'UTV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"]))):
    			ITVs.append(services["sat_282_sky_uk_alt"]["video"][service])
    			
    		# ITV +1 regions
    		elif 'interactive_name' in services["sat_282_sky_uk_alt"]["video"][service] and (service in [133] or (service in range(last_section, 1450) and '+1' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] and ('ITV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] or 'STV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"] or 'UTV' in services["sat_282_sky_uk_alt"]["video"][service]["interactive_name"]))):
    			ITVsPlusOne.append(services["sat_282_sky_uk_alt"]["video"][service])
    		
    		else:
    			rest.append(services["sat_282_sky_uk_alt"]["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_alt"]["video"].keys()):
    	if service in range(last_section, 1450):
    		rest.append(services["sat_282_sky_uk_alt"]["video"][service])
    	elif service < 1000 and ("+1" in services["sat_282_sky_uk_alt"]["video"][service]["service_name"] or "+2" in services["sat_282_sky_uk_alt"]["video"][service]["service_name"]):
    		timeshift.append(services["sat_282_sky_uk_alt"]["video"][service])
    		
    i = last_section
    sections[i] = "Timeshifted Channels"
    
    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
    	
    	
    ############################################################################################
    
    # make a csv file in tmp
    	
    	
    
    csv = ["Service ref, Name, LCN, CHID, CA, Provider\r\n"]
    
    for number in sorted(customised["video"].keys()):
        csv.append("1:0:%x:%x:%x:%x:%x:0:0:0:, %s, %d, %d, %d, %s\r\n" % (
                        customised["video"][number]["service_type"],
                        customised["video"][number]["service_id"],
                        customised["video"][number]["transport_stream_id"],
                        customised["video"][number]["original_network_id"],
                        customised["video"][number]["namespace"],
                        customised["video"][number]["service_name"],
                        number,
                        customised["video"][number]["channel_id"],
                        customised["video"][number]["free_ca"],
                        customised["video"][number]["provider_name"]
                    ))
                        
    with open("/tmp/skyuk.csv", "w") as csv_file:
        csv_file.write(''.join(csv))
    			
    ]]>
    	</hacks>
    </custommix>

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.