mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-03-18 02:21:15 +01:00
iptv format fix
This commit is contained in:
@@ -35,7 +35,10 @@ def write_bouquet(path, name, bq_type, channels):
|
||||
for ch in channels:
|
||||
if not ch: # if was duplicate
|
||||
continue
|
||||
bouquet.append("#SERVICE {}\n".format(ch.fav_id if ch.service_type == "IPTV" else to_bouquet_id(ch)))
|
||||
if ch.service_type == "IPTV":
|
||||
bouquet.append(ch.fav_id)
|
||||
else:
|
||||
bouquet.append("#SERVICE {}\n".format(to_bouquet_id(ch)))
|
||||
|
||||
with open(path + "userbouquet.{}.{}".format(name, bq_type), "w") as file:
|
||||
file.writelines(bouquet)
|
||||
|
||||
@@ -13,7 +13,8 @@ def parse_m3u(path):
|
||||
count += 1
|
||||
elif count == 1:
|
||||
count = 0
|
||||
fav_id = "#SERVICE 4097:0:1:2:0:0:0:0:0:0:{}#DESCRIPTION:{}".format(line, name)
|
||||
fav_id = "#SERVICE 1:0:1:0:0:0:0:0:0:0:{}:{}\n#DESCRIPTION: {}\n".format(
|
||||
line.strip().replace(":", "%3a"), name, name)
|
||||
channels.append(Channel(*aggr[0:3], name, *aggr[0:3], "IPTV", *aggr, fav_id, None))
|
||||
|
||||
return channels
|
||||
|
||||
Reference in New Issue
Block a user