Jump to content


Photo

CI0.XML is always deleted !


  • Please log in to reply
38 replies to this topic

Re: CI0.XML is always deleted ! #21 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 4 December 2023 - 18:11

@Dimitrij,

 

This needs fixing in the CI assignment plugin ?

???

It's all already there

	def saveXML(self):
		try:
			fp = open(self.filename, 'w')
			fp.write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n")
			fp.write("<ci>\n")
			fp.write("\t<slot>\n")
			fp.write("\t\t<id>%s</id>\n" % self.ci_slot)
			for item in self.selectedcaid:
				if len(self.selectedcaid):
					fp.write("\t\t<caid id=\"%s\" />\n" % item[0])
			for item in self.servicelist:
				if len(self.servicelist):
					name = item[0].replace('<', '&lt;')
					name = name.replace('&', '&amp;')
					name = name.replace('>', '&gt;')
					name = name.replace('"', '&quot;')
					name = name.replace("'", '&apos;')
					if item[2] == 1:
						fp.write("\t\t<provider name=\"%s\" dvbnamespace=\"%s\" />\n" % (stringToXML(name), item[3]))
					else:
						fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (stringToXML(name), item[3]))
			fp.write("\t</slot>\n")
			fp.write("</ci>\n")
			fp.close()
		except:
			print("[CI_Config_CI%d] xml not written" % self.ci_slot)
			os.unlink(self.filename)
def stringToXML(text):
	illegal_xml_chars_RE = re.compile('[\x00-\x08\x0b\x0c\x0e-\x1F\uD800-\uDFFF\uFFFE\uFFFF]')
	if isinstance(text, (bytes, bytearray)):
		text = illegal_xml_chars_RE.sub('', text.decode('utf-8'))
	else:
		text = illegal_xml_chars_RE.sub('', text)
	return text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace("'", '&apos;').replace('"', '&quot;')

Edited by Dimitrij, 4 December 2023 - 18:12.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #22 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 4 December 2023 - 18:29

Maybe...

<service name="Science&Vie" ref="1:0:1:1CF:26AC:13F:820000:0:0:0::Science&Vie" />

- fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (stringToXML(name), item[3]))
+ fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (stringToXML(name), ':'.join(item[3].split(':')[:11])))

https://github.com/O...4acd299537d0328

and this realy need?


Edited by Dimitrij, 4 December 2023 - 18:34.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #23 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 4 December 2023 - 18:49

And not sure what you mean by that the problem is that

<service name="Science&Vie" ref="1:0:1:1CF:26AC:13F:820000:0:0:0::Science&Vie" />

should be

<service name="Science&amp;Vie" ref="1:0:1:1CF:26AC:13F:820000:0:0:0::Science&amp;Vie" />

it has nothing to do with utf-8 or not.

 

If the code to deal with this is already there, it suggests that the TS didn't create the xml file manually, but copied it from somewhere, and thus introduced the invalid XML.


 


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #24 pybear38

  • Senior Member
  • 91 posts

+5
Neutral

Posted 4 December 2023 - 19:33

Hello,

 

I had done the 2  ways to add the file "ci0.xml"... (1 x my own file made on my PC) and another time directly on the receiver. and each time the file was deleted.

 

I never think a simple letter as " & " could do a problem like that.

 

so now it's in the past and all is ok.

 

and again thak you.

Pat


TNT/Sat : VU+ Duo 4K SE - Home cinema : Onkyo TX NR686 | Air Gay Radio


Re: CI0.XML is always deleted ! #25 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 5 December 2023 - 12:50

If you used the CI assignment plugin, and that produced the fautly XML, the code needs to be fixed.

 

In the snippet Dimitrij posted, it seems to check the name only, not the service reference which also contains the name.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #26 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 5 December 2023 - 17:52

Maybe...

 

[CommonInterfaceAssignment] save only clean service ref

 

but...

name="Science&Vie" same string &


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #27 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 5 December 2023 - 17:59

All need to be replaced, no matter what attribute it is in. It is an XML requirement.

 

That code doesn't fix things are item[3] is stil added without encoding.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #28 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 5 December 2023 - 18:17

ref="1:0:1:1CF:26AC:13F:820000:0:0:0::Science&Vie"

ref="1:0:1:1CF:26AC:13F:820000:0:0:0:"


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #29 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 5 December 2023 - 18:18

That would also fix it, yes, as long as the name is still encoded.

 

I can't judge whether removing that has side effects or not, I assume it was added for some reason?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #30 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 6 December 2023 - 06:26

What would also fix it, yes, as long as the name is still encoded.

 

I can't judge whether removing that has side effects or not, I assume it was added for some reason?

I don't know.

This PR contains your name ;) .


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #31 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 6 December 2023 - 12:24

Which PR? I do not write python code.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #32 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 6 December 2023 - 14:00

Which PR? I do not write python code.

This https://github.com/O...4acd299537d0328


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #33 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 6 December 2023 - 14:27

That is a python 3 str to bytes / bytes fix, that has nothing to do with HTML character encoding, nor with construction of the CI xml and it's required format ?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #34 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 6 December 2023 - 15:14

Then how do you explain it?

<service name="Science&Vie" ref="1:0:1:1CF:26AC:13F:820000:0:0:0::Science&Vie"(this solved!) />

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #35 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 6 December 2023 - 15:24

How do I explain what?

 

The fact that that line says "&" instead of "&amp;" (in both name and ref) has nothing to do with the bytes to string conversion.

 

I'm completely lost in this conversation.

 

Your code already does the HTML entity conversion for "name" (which was not visable in the xml file from the TS, so that xml file was either created before the fix, or manually), and you suggested in your PR to strip the name from the ref to fix that attribute.

 

And my only question was if stripping that name from the ref attribute has byeffects or not?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: CI0.XML is always deleted ! #36 Dimitrij

  • PLi® Core member
  • 10,370 posts

+354
Excellent

Posted 6 December 2023 - 17:21

And my only question was if stripping that name from the ref attribute has byeffects or not?

I think there won't be any problems.

 

I generally have the opinion that this file was not generated on the OpenPli image.

 

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: CI0.XML is always deleted ! #37 Pr2

  • PLi® Contributor
  • 6,188 posts

+261
Excellent

Posted 9 December 2023 - 10:16

PyBear38 doesn't use the CommonInterface plugin to create the ci0.xml he is using its own script to generate the ci0.xml and ci1.xml

So the problem was on its side, since its generated ciX.xml file were wrongly formatted due to the & the content was stripped off.

 

So don't look inside the plugin code, if he was using the CommonInterface Assignment plugin, he won't have the problem since it already generate a properly escaped file.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: CI0.XML is always deleted ! #38 pybear38

  • Senior Member
  • 91 posts

+5
Neutral

Posted 10 December 2023 - 07:01

Hello,

 

On the receiver: After I recall some channels with the "&" i have had the problem.

 

On PC: When I have had the problem,  I verified the file with notepad++.

 

So, finally it's important to know to write the file with the good words.


TNT/Sat : VU+ Duo 4K SE - Home cinema : Onkyo TX NR686 | Air Gay Radio


Re: CI0.XML is always deleted ! #39 WanWizard

  • PLi® Core member
  • 70,764 posts

+1,830
Excellent

Posted 10 December 2023 - 15:36

verifying with notepad++ is useless, it isn't a characterset issue, it is a HTML encoding issue.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.



4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users