Add web to JSON

This commit is contained in:
Marc 2018-09-23 11:47:54 +02:00
parent 2f7dd65d9e
commit 1a93e62f6d
2 changed files with 9 additions and 1 deletions

View File

@ -47,8 +47,9 @@
def to_json(self):
return {
"name": self.name,
"resolution": self.resolution,
"web": self.web,
"logo": self.logo,
"resolution": self.resolution,
"epg_id": self.epg_id,
"options": self.__options_to_json__()
}

View File

@ -30,10 +30,17 @@ def get_channels_from_part(text):
list_to_iterate.remove("\n\n")
for i in range(0, len(list_to_iterate), attributes_per_item):
item_name = list_to_iterate[i].strip()
item_options = list_to_iterate[i + 1].strip()
item_web = list_to_iterate[i + 2].strip()
if len(item_web) > 0 and item_web[0] != "-":
item_web = stringbetween(item_web, "(", ")")
item_resolution = list_to_iterate[i + 3].strip()
item_logo = list_to_iterate[i + 4].strip()
item_epg = list_to_iterate[i + 5].strip()
item_options = item_options.split(" - ")