From 2a12ecc7349b44ff7d395d8e6f1dd10a62cdec72 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 6 Dec 2020 12:13:45 -0500 Subject: [PATCH] test --- fHDHR/origin/origin_channels.py | 39 ++++++++++++++++++++++++++------- fHDHR/origin/origin_epg.py | 4 ++-- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/fHDHR/origin/origin_channels.py b/fHDHR/origin/origin_channels.py index a481ee0..e171f3e 100644 --- a/fHDHR/origin/origin_channels.py +++ b/fHDHR/origin/origin_channels.py @@ -19,14 +19,16 @@ class OriginChannels(): 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/512x512.png?type=color_onBlack" % str(channel_dict["guid"]["value"]) - } - channel_list.append(clean_station_item) + if not self.xumo_bad(channel_dict["title"]): + + 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 @@ -53,6 +55,27 @@ class OriginChannels(): streamurl = self.m3u8_beststream(streamurl) return streamurl + def xumo_bad(name): + missing = ["ACC Digital Network", "Above Average", "Adventure Sports Network", "Ameba", + "America's Funniest Home Videos", "Architectural Digest", "Billboard", "Bloomberg Television", + "CBC NEWS", "CHIVE TV", "CNET", "CollegeHumor", "Condé Nast Traveler", "Cooking Light", + "CoolSchool", "Copa90", "Cycle World", "FBE", "FOX Sports", "Family Feud", "Field & Stream", + "Food52", "Football Daily", "Fox Deportes", "Funny or Die", "Futurism", "GQ", "GameSpot", + "Glamour", "Got Talent Global", "Great Big Story", "HISTORY", "Hard Knocks Fighting Championship", + "Just For Laughs", "Just For Laughs Gags", "Kid Genius", "MMAjunkie", "MOTORVISION.TV", + "Mashable", "Motorcyclist", "NEW K.ID", "Newsy", "Nitro Circus", "Nosey", "NowThis", + "Outside TV+", "PBS Digital", "People Are Awesome", "People Magazine", "PeopleTV", + "Popular Science", "Real Nosey", "Refinery29", "Rowan and Martin's Laugh-In", + "SYFY WIRE", "Saveur", "Southern Living", "Sports Illustrated", "TIME Magazine", + "TMZ", "TODAY", "The Hollywood Reporter", "The Inertia", "The New Yorker", "The Pet Collective", + "The Preview Channel", "This Is Happening", "Titanic Channel", "Toon Goggles", "USA TODAY News", + "USA Today SportsWire", "Uzoo", "Vanity Fair", "Vogue", "Wochit", "World Surf League", + "Young Hollywood", "ZooMoo", "batteryPOP", "comicbook", "eScapes"] + if name in missing: + return True + else: + return False + def m3u8_beststream(self, m3u8_url): bestStream = None videoUrlM3u = m3u8.load(m3u8_url) diff --git a/fHDHR/origin/origin_epg.py b/fHDHR/origin/origin_epg.py index 056e325..c9cd5d3 100644 --- a/fHDHR/origin/origin_epg.py +++ b/fHDHR/origin/origin_epg.py @@ -21,7 +21,7 @@ class OriginEPG(): "listing": [], } - for hour_num in range(1, 24): - print(hour_num) + # for hour_num in range(1, 24): + # print(hour_num) return programguide