From 0d37ba02e8d473911270dfbc322f435d643eee5b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 6 Dec 2020 12:02:13 -0500 Subject: [PATCH] test --- fHDHR/origin/origin_channels.py | 69 ++++----------------------------- fHDHR/origin/origin_epg.py | 16 ++++++++ 2 files changed, 24 insertions(+), 61 deletions(-) diff --git a/fHDHR/origin/origin_channels.py b/fHDHR/origin/origin_channels.py index 2d8c209..a481ee0 100644 --- a/fHDHR/origin/origin_channels.py +++ b/fHDHR/origin/origin_channels.py @@ -18,16 +18,15 @@ class OriginChannels(): api_json = self.fhdhr.web.session.get(channel_json_url).json() for channel_dict in api_json['channel']['item']: - if channel_dict["properties"]["is_live"] == "true": - clean_station_item = { - "name": channel_dict["title"], - "callsign": channel_dict["callsign"], - "number": str(channel_dict["number"]), - "id": str(channel_dict["guid"]["value"]), - "thumbnail": "https://image.xumo.com/v1/channels/channel/%s/512x512.png?type=color_onBlack" % str(channel_dict["guid"]["value"]) - } - channel_list.append(clean_station_item) + clean_station_item = { + "name": channel_dict["title"], + "callsign": channel_dict["callsign"], + "number": str(channel_dict["number"]), + "id": str(channel_dict["guid"]["value"]), + "thumbnail": "https://image.xumo.com/v1/channels/channel/%s/512x512.png?type=color_onBlack" % str(channel_dict["guid"]["value"]) + } + channel_list.append(clean_station_item) return channel_list @@ -70,55 +69,3 @@ class OriginChannels(): return bestStream.absolute_uri else: return m3u8_url - - -""" -{ - "title": "GameSpot", - "description": "GameSpot is the world's leading source for gaming.", - "guid": { - "value": "9999216", - "isPermaLink": false - }, - "number": 300, - "callsign": "XGAME", - "genre": [ - { - "value": "Entertainment", - "genreId": 1 - } - ], - "properties": { - "hybrid_type": "popular", - "is_live": "true", - "brand_color": "rgba(238,64,53,1)", - "has_vod": "true" - } -} - -{ - "title": "CBS News", - "description": "", - "guid": { - "value": "9999158", - "isPermaLink": false - }, - "number": 125, - "callsign": "XCBSNWS", - "genre": [ - { - "value": "News", - "genreId": 13 - } - ], - "properties": { - "simulcast_only": "true", - "hybrid_type": "promoted", - "is_live": "true", - "brand_color": "rgba(48,129,180,1)", - "has_vod": "false", - "is_simulcast": "true", - "has_discontinuity": "true" - } -} -""" diff --git a/fHDHR/origin/origin_epg.py b/fHDHR/origin/origin_epg.py index 525eb69..f1acfbb 100644 --- a/fHDHR/origin/origin_epg.py +++ b/fHDHR/origin/origin_epg.py @@ -8,4 +8,20 @@ class OriginEPG(): def update_epg(self, fhdhr_channels): programguide = {} + for fhdhr_id in list(self.channels.list.keys()): + c = self.channels.list[fhdhr_id].dict + + if str(c["number"]) not in list(programguide.keys()): + programguide[str(c["number"])] = { + "callsign": c["callsign"], + "name": c["name"], + "number": c["number"], + "id": c["origin_id"], + "thumbnail": c["thumbnail"], + "listing": [], + } + + for hour_num in range(1, 24): + print(hour_num) + return programguide