From 0bc5fde2e757bfbc90fc1561ea92f009669e0648 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 6 Dec 2020 09:47:56 -0500 Subject: [PATCH] test --- fHDHR/origin/origin_channels.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fHDHR/origin/origin_channels.py b/fHDHR/origin/origin_channels.py index 54a28ae..50b1e7b 100644 --- a/fHDHR/origin/origin_channels.py +++ b/fHDHR/origin/origin_channels.py @@ -17,11 +17,15 @@ class OriginChannels(): channel_json_url = self.base_api + channel_json_path api_json = self.fhdhr.web.session.get(channel_json_url).json() - for channel in api_json['channel']['item']: - print(channel["title"]) - print(len(api_json['channel']['item'])) - - return + for channel_dict in api_json['channel']['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/300x300.png?type=color_onBlack" % str(channel_dict["guid"]["value"]) + } + channel_list.append(clean_station_item) return channel_list