convertjson2xmltv-gz.py aktualisiert
This commit is contained in:
@@ -54,7 +54,7 @@ def convert_to_xmltv(json_data):
|
|||||||
return ET.ElementTree(tv)
|
return ET.ElementTree(tv)
|
||||||
|
|
||||||
# Einlesen und Schreiben
|
# Einlesen und Schreiben
|
||||||
with open("/export/scripts/weeklyepg.json", "r", encoding="utf-8") as f:
|
with open("sample.json", "r", encoding="utf-8") as f:
|
||||||
json_data = json.load(f)
|
json_data = json.load(f)
|
||||||
|
|
||||||
# XML generieren
|
# XML generieren
|
||||||
@@ -66,5 +66,5 @@ xmltv_tree.write(xml_io, encoding="unicode", xml_declaration=True)
|
|||||||
xml_string = xml_io.getvalue()
|
xml_string = xml_io.getvalue()
|
||||||
|
|
||||||
# Als .xml.gz speichern
|
# Als .xml.gz speichern
|
||||||
with gzip.open("/var/www/html/stream/api/epg_stadtfilter.xml.gz", "wt", encoding="utf-8") as f:
|
with gzip.open("epg_stadtfilter.xml.gz", "wt", encoding="utf-8") as f:
|
||||||
f.write(xml_string)
|
f.write(xml_string)
|
||||||
|
|||||||
Reference in New Issue
Block a user