test
This commit is contained in:
parent
f95a4923c6
commit
0c00aa2da1
@ -11,10 +11,6 @@ class OriginChannels():
|
||||
self.base_api_url = "https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3"
|
||||
self.base_station_url = "https://ott-stationselection.sinclairstoryline.com/stationSelectionByAllStates"
|
||||
|
||||
"https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/channels/stirr?station=abc3340"
|
||||
|
||||
"https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/status/40b80f75-2efc-49af-813b-2a674e69ea59"
|
||||
|
||||
def get_channels(self):
|
||||
|
||||
channel_list = []
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
|
||||
|
||||
class OriginEPG():
|
||||
@ -20,13 +21,16 @@ class OriginEPG():
|
||||
epg_json = epg_opn.json()
|
||||
|
||||
for listing in epg_json["channel"][0]["programme"]:
|
||||
|
||||
timestampdict = self.stirr_time_convert(listing["start"], listing["stop"])
|
||||
|
||||
clean_prog_dict = {
|
||||
"time_start": None,
|
||||
"time_end": None,
|
||||
"duration_minutes": None,
|
||||
"title": "Unavailable",
|
||||
"time_start": timestampdict["start"],
|
||||
"time_end": timestampdict["end"],
|
||||
"duration_minutes": timestampdict["duration"],
|
||||
"title": listing["title"]["value"],
|
||||
"sub-title": "Unavailable",
|
||||
"description": "Unavailable",
|
||||
"description": listing["desc"]["value"],
|
||||
"rating": "N/A",
|
||||
"episodetitle": None,
|
||||
"releaseyear": None,
|
||||
@ -34,7 +38,7 @@ class OriginEPG():
|
||||
"seasonnumber": None,
|
||||
"episodenumber": None,
|
||||
"isnew": False,
|
||||
"id": None,
|
||||
"id": "%s_%s" % (chan_obj.dict["origin_id"], timestampdict['time_start']),
|
||||
"thumbnail": None
|
||||
}
|
||||
|
||||
@ -42,3 +46,9 @@ class OriginEPG():
|
||||
programguide[str(chan_obj.number)]["listing"].append(clean_prog_dict)
|
||||
|
||||
return programguide
|
||||
|
||||
def stirr_time_convert(self, starttime, endtime):
|
||||
starttime = datetime.datetime.strptime(str(starttime), "%Y%m%d%H%M%S").timestamp()
|
||||
endtime = datetime.datetime.strptime(str(endtime), "%Y%m%d%H%M%S").timestamp()
|
||||
duration = (endtime - starttime) / 60
|
||||
return {"start": starttime, "end": endtime, "duration": duration}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user